diff --git a/src/rootfsinstall.sh b/src/rootfsinstall.sh index 4245409..a37de2c 100755 --- a/src/rootfsinstall.sh +++ b/src/rootfsinstall.sh @@ -206,10 +206,10 @@ mke2fs -q -t $SYSTEMFSTYPE -j -L "openmamba" $PARTITION2 || { exit 1 } -BOOTMP=`mktemp -d -t rootfsinstall.XXXXXXXX` +[ "$BOOTFSTYPE" ] && BOOTMP=`mktemp -d -t rootfsinstall.XXXXXXXX` ROOTMP=`mktemp -d -t rootfsinstall.XXXXXXXX` -[ -d $BOOTMP -a -d $ROOTMP ] || { +[ -d $ROOTMP ] || { echo "Error: unable to create temporary mount points; aborting." exit 1 } @@ -218,7 +218,7 @@ mount $PARTITION2 $ROOTMP || { echo "ERROR: unable to mount partition $PARTITION2; aborting." exit 1 } -trap "[ -e $ROOTMP ] && umount $ROOTMP;[ -e $BOOTMP ] && umount $BOOTMP" 0 HUP INT QUIT ABRT KILL TERM +trap "[ "$ROOTMP" -a -e $ROOTMP ] && umount $ROOTMP && rmdir $ROOTMP;[ "$BOOTMP" -a -e $BOOTMP ] && umount $BOOTMP && rmdir $BOOTMP" 0 HUP INT QUIT ABRT KILL TERM if [ "$BOOTFSTYPE" ]; then mount $PARTITION1 $BOOTMP || { @@ -292,7 +292,7 @@ framebuffer_ignore_alpha=1" > $BOOTMP/config.txt [ "$SWHOME" -a "${SWHOME:0:4}" = "/tmp" ] && rm -rf $SWHOME elif [ "$TARGETDEVICE" = "cubox" ]; then - [ "$VIDEO_MODE" ] || VIDEO_MODE=1920x1080-32@60" + [ "$VIDEO_MODE" ] || VIDEO_MODE="1920x1080-32@60" mkdir -p $BOOTMP/boot echo "Creating u-boot boot.scr..." cat > $BOOTMP/boot/boot.txt << _EOF @@ -359,6 +359,8 @@ if [ "$SETHOSTNAME" ]; then sed -i "s|\(127\.0\.0\.1\W*\)\(.*\)|\1 $SETHOSTNAME.localdomain $SETHOSTNAME localhost.localdomain localhost|" $ROOTMP/etc/hosts fi +[ -e /usr/bin/qemu-arm.static ] && cp /usr/bin/qemu-arm.static $ROOTMP/usr/bin/qemu-arm + if [ "$ROOTPASSWORD" ]; then echo "$ROOTPASSWORD" | chroot $ROOTMP passwd root --stdin || { echo "ERROR: unable to set password for root; aborting." @@ -382,12 +384,6 @@ if [ "$CHROOTCOMMAND" ]; then fi sync -if [ "$BOOTFSTYPE" ]; then - umount $PARTITION1 - rmdir $BOOTMP -fi -umount $PARTITION2 -rmdir $ROOTMP echo "Done." exit 0