From 337ee783ec0e902d2f8441576274762a3914932f Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Fri, 26 Nov 2004 08:57:00 +0000 Subject: [PATCH] Clifford Wolf: Added instant grub installer to setup procedure [2004111111405314491] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@4855 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- package/x86/grub/grub.conf | 1 + package/x86/grub/stone_mod_grub.sh | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/package/x86/grub/grub.conf b/package/x86/grub/grub.conf index d1883383b..84dfdcc38 100644 --- a/package/x86/grub/grub.conf +++ b/package/x86/grub/grub.conf @@ -28,6 +28,7 @@ grub_postmake() { cp -v $datadir/grub/$trg/* $root/boot/grub/ cp $confdir/stone_mod_grub.sh $root/etc/stone.d/mod_grub.sh + echo '$STONE grub grub_setup' > $root/etc/stone.d/setup_grub.sh if [ ! -f $root/boot/grub/menu.lst ] ; then cp docs/menu.lst $root/boot/grub/ diff --git a/package/x86/grub/stone_mod_grub.sh b/package/x86/grub/stone_mod_grub.sh index f8af59c3d..f5a97390c 100644 --- a/package/x86/grub/stone_mod_grub.sh +++ b/package/x86/grub/stone_mod_grub.sh @@ -90,8 +90,7 @@ grub_install() { gui_cmd 'Installing GRUB' "echo -e 'root $bootdrive\\nsetup (hd0)\\nquit' | grub --batch --device-map=/boot/grub/device.map" } -main() { - while +grub_init() { rootdev="`grep ' / ' /proc/mounts | tail -n 1 | \ awk '/\/dev\// { print $1; }'`" bootdev="`grep ' /boot ' /proc/mounts | tail -n 1 | \ @@ -126,6 +125,19 @@ main() { if [ "$rootdrive" = "$bootdrive" ] then bootpath="/boot" ; else bootpath="" ; fi +} + +grub_setup() { + if gui_yesno "Do you want to install the GRUB bootloader in MBR now?"; then + grub_init; create_device_map + grub_init; create_boot_menu + grub_init; grub_install + fi +} + +main() { + while + grub_init gui_menu grub 'GRUB Boot Loader Setup' \ '(Re-)Create GRUB Device Map' 'create_device_map' \