From 19d53a7429e587ea32b40c268b3c1d881631d279 Mon Sep 17 00:00:00 2001 From: Andrew Engelbrecht Date: Tue, 29 Aug 2023 14:10:55 -0400 Subject: [PATCH] actually fix GRUB booting issue --- live-usb-loader.sh | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/live-usb-loader.sh b/live-usb-loader.sh index 8348e6c..3bbfc6b 100755 --- a/live-usb-loader.sh +++ b/live-usb-loader.sh @@ -56,11 +56,6 @@ cp -vr $ISOTMP/* $ISOTMP/.disk $DEVTMP || true 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. -## ^ this may be a red herring -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 @@ -69,15 +64,16 @@ mv $DEVTMP/isolinux $DEVTMP/isolinux.bak umount $DEVTMP umount $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 +rmdir $DEVTMP +rmdir $ISOTMP -# GRUB needs the isolinux directory to boot -mount ${DEV}1 $DEVTMP -mv $DEVTMP/isolinux.bak $DEVTMP/isolinux -umount $DEVTMP +# the order of steps might be wrong, so we run these commands twice +for times in 1 2 ; do + # 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 +done rmdir $DEVTMP rmdir $ISOTMP -- 2.25.1