cp -vr $DEVTMP/isolinux $DEVTMP/syslinux
mv $DEVTMP/syslinux/isolinux.cfg $DEVTMP/syslinux/syslinux.cfg
+# apparently running syslinux command when /syslinux/ and /isolinux/ both exist
+# leads to GRUB not detecting the isolinux directory.
+mv $DEVTMP/isolinux $DEVTMP/isolinux.bak
+
# Create persistency file
# dd if=/dev/zero of=$DEVTMP/casper-rw bs=1M count=$PERSISTENCESIZE oflag=sync status=progress
# mkfs.ext4 -L casper-rw -F $DEVTMP/casper-rw
umount $DEVTMP
umount $ISOTMP
-rmdir $DEVTMP
-rmdir $ISOTMP
-
# Set up bootloader, requires syslinux. version 6.04 has been tested.
syslinux --directory /syslinux/ --install ${DEV}1
sudo dd if=/usr/lib/SYSLINUX/mbr.bin of=${DEV}
parted $DEV set 1 boot on
+mount ${DEV}1 $DEVTMP
+mv $DEVTMP/isolinux.bak $DEVTMP/isolinux
+umount $DEVTMP
+
+rmdir $DEVTMP
+rmdir $ISOTMP
+
#eject $DEV
sync