Update function to be flexible with the use of multiple bootloaders --- src/core/libs/lib-ui-interactive.sh | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index b244a6e..062c420 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -883,7 +883,7 @@ interactive_grub() { fi fi # Create and edit the grub menu.lst - interactive_grub_menulst + interactive_bootloader_menu "grub" $grubmenu DEVS="$(findblockdevices '_ ')" if [ "$DEVS" = " " ]; then @@ -1070,15 +1070,6 @@ initrd $subdir/kernel26-fallback.img EOF } -interactive_grub_menulst () { - generate_grub_menulst - local helptext= - grep -q '^/dev/mapper' $TMP_FSTAB && helptext=" /dev/mapper/ users: Pay attention to the kernel line!" - notify "Before installing GRUB, you must review the configuration file. You will now be put into the editor. After you save your changes and exit the editor, you can install GRUB.$helptext" - seteditor || return 1 - $EDITOR $grubmenu -} - interactive_grub_install () { debug FS "interactive_grub_install called. P1 = $1, P2 = $2, P3 = $3" # $1 = bootpart @@ -1120,6 +1111,21 @@ EOF fi } +# $1 - Bootloader Name +# $2 - Bootloader Configuration Files +interactive_bootloader_menu() { + if [[ $1 = grub ]]; then + generate_grub_menulst + fi + + grep -q '^/dev/mapper' $TMP_FSTAB && local helptext=" /dev/mapper/ users: Pay attention to the kernel line!" + notify "Before installing $1, you must review the configuration file. You will now be put into the editor. After you save your changes and exit the editor, you can install $1.$helptext" + + seteditor || return 1 + + $EDITOR $2 +} + get_kernel_parameters() { get_device_with_mount '/' || return 1 local rootpart="$ANSWER_DEVICE" -- 1.7.4.1