[arch-releng] [PATCH 1/3] Rename interactive_grub_menulst to interactive_bootloader_menu

pyther at pyther.net pyther at pyther.net
Sun Feb 20 23:09:35 EST 2011


Function was updated to be flexible with the use of multiple bootloaders
---
 src/core/libs/lib-ui-interactive.sh |   27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh
index b244a6e..85a3a5f 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,22 @@ EOF
 	fi
 }
 
+interactive_bootloader_menu() {
+	# $1 - Bootloader Name
+	# $2 - Bootloader Configuration Files
+
+	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



More information about the arch-releng mailing list