From 3bd2e78eafc88355d6055b55aa494aa6d52bb13c Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 8 Jul 2016 16:28:18 +0200 Subject: [PATCH] usbinstall.sh: support grub-install run from loop device (makedist) and more grub.cfg customization --- src/usbinstall.sh | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/usbinstall.sh b/src/usbinstall.sh index 005048a..2dd1378 100644 --- a/src/usbinstall.sh +++ b/src/usbinstall.sh @@ -341,7 +341,27 @@ else cp $ISOMOUNTDIR/boot/{initrd*,vmlinuz*} boot/ # basic extlinux.conf -> grub.cfg conversion - echo "search --no-floppy --label --set=root openmamba_live" > $MOUNTDIR_EFI/EFI/BOOT/grub.cfg + echo "\ +# +# GRUB configuration generated by openmamba usbinstall tool +# +font=unicode +set gfxmode=auto +insmod all_video +insmod gfxterm +insmod gettext +terminal_output=gfxterm +timeout=30 +# theme +insmod=png +set menu_color_normal=white/black +set menu_color_highlight=white/green +search --no-floppy --label --set=root openmamba_live + +# +# Boot entries taken from ISO bootloader +# +" > $MOUNTDIR_EFI/EFI/BOOT/grub.cfg while read line; do case $line in "MENU LABEL "*) [ "$CURR_BRACKET_OPEN" = "1" ] && echo "}" >> $MOUNTDIR_EFI/EFI/BOOT/grub.cfg @@ -354,6 +374,7 @@ else "append "*) set -- ${line/append initrd=} CURR_INITRD="$1" CURR_CMDLINE="${line/append initrd=$CURR_INITRD}" + CURR_CMDLINE="${CURR_CMDLINE/vga=792}" echo "linux ${CURR_KERNEL} ${CURR_CMDLINE}" >> $MOUNTDIR_EFI/EFI/BOOT/grub.cfg echo "echo \"Loading ${CURR_INITRD}\"" >> $MOUNTDIR_EFI/EFI/BOOT/grub.cfg echo "initrd ${CURR_INITRD}" >> $MOUNTDIR_EFI/EFI/BOOT/grub.cfg @@ -384,7 +405,7 @@ fi set_status $"Writing bootloader..." echo $"Writing bootloader..." -sudo grub-install --removable --boot-directory boot/ $SELECT_USB &>>$LOGFILE || { +sudo grub-install --modules="part_msdos part_gpt ext2" --removable --boot-directory=boot/ $SELECT_USB &>>$LOGFILE || { errorAndExit $"Error: failed to install bootloader into device (${SELECT_USB})" } set_pbar 90