diff --git a/build.sh b/build.sh index 9a66c3d..778e116 100755 --- a/build.sh +++ b/build.sh @@ -13,7 +13,7 @@ CWD=$(pwd) IMG_NAME=${IMG_NAME:-"SlackwareARM_cubitruck"} VERSION=${VERSION:-0.2} COMPILE=${COMPILE:-"false"} -DEST=${DEST:-~/cubieslack} +DEST=${DEST:-$CWD/dist} CUBIETRUCK_DISPLAY=${CUBIETRUCK_DISPLAY:-"HDMI"} # "HDMI" or "VGA" IMAGE_SIZE_MB=${IMAGE_SIZE_MB:-2000} SLACKWARE_VERSION=${SLACKWARE_VERSION:-14.1} @@ -136,7 +136,7 @@ if [ "$COMPILE" = "true" ]; then echo "--------------------------------------------------------------------------------" echo "Clone / Pull sources and patch" echo "--------------------------------------------------------------------------------" - mkdir -p $DEST/output + mkdir -p $DEST/image # Boot loader if [ -d "$DEST/u-boot-sunxi" ]; then @@ -246,8 +246,8 @@ fi echo "--------------------------------------------------------------------------------" echo "Creating SD Image" echo "--------------------------------------------------------------------------------" -mkdir -p $DEST/output -cd $DEST/output +mkdir -p $DEST/image +cd $DEST/image echo "create image and mount image to next free loop device" dd if=/dev/zero of=${IMG_NAME}-${VERSION}_rootfs_SD.raw bs=1M count=$IMAGE_SIZE_MB @@ -272,8 +272,8 @@ echo "create filesystem" mkfs.ext4 $LOOP1 echo "create mount point and mount image" -mkdir -p $DEST/output/sdcard/ -mount $LOOP1 $DEST/output/sdcard/ +mkdir -p $DEST/image/sdcard/ +mount $LOOP1 $DEST/image/sdcard/ @@ -284,12 +284,12 @@ mount $LOOP1 $DEST/output/sdcard/ echo "------ Get basic Slackware System" -cd $DEST/output/sdcard/ +cd $DEST/image/sdcard/ [ ! -e $CWD/slack-$SLACKWARE_VERSION-miniroot_$ROOTFS_VERSION.tar.xz ] && wget -c ftp://ftp.arm.slackware.com/slackwarearm/slackwarearm-devtools/minirootfs/roots/slack-$SLACKWARE_VERSION-miniroot_$ROOTFS_VERSION.tar.xz -O $CWD/slack-$SLACKWARE_VERSION-miniroot_$ROOTFS_VERSION.tar.xz tar xf $CWD/slack-$SLACKWARE_VERSION-miniroot_$ROOTFS_VERSION.tar.xz echo "Configuring Slackware" -cat > $DEST/output/sdcard/etc/motd < $DEST/image/sdcard/etc/motd < $DEST/output/sdcard/etc/motd <> $DEST/output/sdcard/etc/rc.d/rc.local +cat <> $DEST/image/sdcard/etc/rc.d/rc.local # Uncomment the following line to turn off the leds after booting # /bin/disable_led.sh EOF echo "scripts for autoresize at first boot from cubian" -cp $CWD/scripts/resize2fs-arch.sh $DEST/output/sdcard/root/resize2fs-root.sh -chmod +x $DEST/output/sdcard/root/resize2fs-root.sh +cp $CWD/scripts/resize2fs-arch.sh $DEST/image/sdcard/root/resize2fs-root.sh +chmod +x $DEST/image/sdcard/root/resize2fs-root.sh echo "set hostname" -echo darkstar > $DEST/output/sdcard/etc/HOSTNAME +echo darkstar > $DEST/image/sdcard/etc/HOSTNAME echo "setup fstab" ### declare root partition in fstab -echo '/dev/mmcblk0p1 / ext4 defaults 1 1' >> $DEST/output/sdcard/etc/fstab +echo '/dev/mmcblk0p1 / ext4 defaults 1 1' >> $DEST/image/sdcard/etc/fstab ### mount /tmp as tmpfs -echo 'tmpfs /tmp tmpfs defaults,nosuid,size=30% 0 0' >> $DEST/output/sdcard/etc/fstab +echo 'tmpfs /tmp tmpfs defaults,nosuid,size=30% 0 0' >> $DEST/image/sdcard/etc/fstab echo "modules to load" -cat >> $DEST/output/sdcard/etc/rc.d/rc.modules <> $DEST/image/sdcard/etc/rc.d/rc.modules <