usbinstall.sh: support for recent ISO images with GRUB bootloader replacing Isolinux

This commit is contained in:
Silvan Calarco 2022-10-05 16:21:53 +02:00
parent 122509b6a5
commit 279bd34386

View File

@ -282,8 +282,6 @@ else
mkdir LiveOS boot rwroot ovlwork
cp $ISOMOUNTDIR/boot/{initrd*,vmlinuz*} boot/
TARGET_ARCH=`cat $ISOMOUNTDIR/etc/openmamba-release | sed "s|.*for \(.*\) .*|\1|"`
[ "$TARGET_ARCH" ] || TARGET_ARCH=x86_64
set_status $"Copying SquashFS image from ISO image..."
echo $"Copying SquashFS image..."
@ -304,7 +302,9 @@ else
ps $CPPID >/dev/null
done
if [ -e $ISOMOUNTDIR/boot/isolinux/isolinux.cfg ]; then
# basic extlinux.conf -> grub.cfg conversion
# Legacy for old openmamba iso images with isolinux bootloader
echo "\
#
# GRUB configuration generated by openmamba usbinstall tool
@ -354,6 +354,11 @@ search --no-floppy --label --set=root openmamba_live
cp $MOUNTDIR_EFI/EFI/BOOT/grub.cfg boot/grub/grub.cfg
umount $ISOMOUNTDIR
rmdir $ISOMOUNTDIR
else
cp -a $ISOMOUNTDIR/boot/grub boot/
sed -i "s|root=live:LABEL=[^[:space:]]*|root=live:LABEL=openmamba_live rd.live.overlay=/dev/disk/by-label/openmamba_live:/rwroot|" boot/grub/grub.cfg
cp boot/grub/grub.cfg $MOUNTDIR_EFI/EFI/BOOT/grub.cfg
fi
fi
set_pbar 85