usbinstall.sh: support grub-install run from loop device (makedist) and more grub.cfg customization
This commit is contained in:
parent
ae46a54186
commit
3bd2e78eaf
@ -341,7 +341,27 @@ else
|
|||||||
cp $ISOMOUNTDIR/boot/{initrd*,vmlinuz*} boot/
|
cp $ISOMOUNTDIR/boot/{initrd*,vmlinuz*} boot/
|
||||||
|
|
||||||
# basic extlinux.conf -> grub.cfg conversion
|
# 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
|
while read line; do
|
||||||
case $line in
|
case $line in
|
||||||
"MENU LABEL "*) [ "$CURR_BRACKET_OPEN" = "1" ] && echo "}" >> $MOUNTDIR_EFI/EFI/BOOT/grub.cfg
|
"MENU LABEL "*) [ "$CURR_BRACKET_OPEN" = "1" ] && echo "}" >> $MOUNTDIR_EFI/EFI/BOOT/grub.cfg
|
||||||
@ -354,6 +374,7 @@ else
|
|||||||
"append "*) set -- ${line/append initrd=}
|
"append "*) set -- ${line/append initrd=}
|
||||||
CURR_INITRD="$1"
|
CURR_INITRD="$1"
|
||||||
CURR_CMDLINE="${line/append initrd=$CURR_INITRD}"
|
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 "linux ${CURR_KERNEL} ${CURR_CMDLINE}" >> $MOUNTDIR_EFI/EFI/BOOT/grub.cfg
|
||||||
echo "echo \"Loading ${CURR_INITRD}\"" >> $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
|
echo "initrd ${CURR_INITRD}" >> $MOUNTDIR_EFI/EFI/BOOT/grub.cfg
|
||||||
@ -384,7 +405,7 @@ fi
|
|||||||
|
|
||||||
set_status $"Writing bootloader..."
|
set_status $"Writing bootloader..."
|
||||||
echo $"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})"
|
errorAndExit $"Error: failed to install bootloader into device (${SELECT_USB})"
|
||||||
}
|
}
|
||||||
set_pbar 90
|
set_pbar 90
|
||||||
|
Loading…
Reference in New Issue
Block a user