From 69822ed7f7207f61eb9b77bd0bebd522d0ba2690 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 27 Aug 2008 02:25:21 +0200 Subject: [PATCH] Fix groot and grub handling --- grml-debootstrap | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/grml-debootstrap b/grml-debootstrap index 221f8d3..ac188e1 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -149,6 +149,14 @@ while [ "$#" -gt "0" ] ; do done # }}} +# welcome screen {{{ +welcome_dialog() +{ + dialog --title "$PN" --msgbox "Welcome to the interactive configuration of grml-debootstrap." 0 0 + # TODO: improve message +} +# }}} + # ask for target {{{ prompt_for_target() { @@ -199,7 +207,6 @@ prompt_for_bootmanager() case "$GETMBR" in mbr) - USE_MBR=1 # /dev/md0: has to be installed in MBR of /dev/md0 and not in /dev/md: if echo $TARGET | grep -q "*md*" ; then BOOT_PARTITION="${TARGET}" @@ -211,11 +218,9 @@ prompt_for_bootmanager() BOOT_PARTITION="$TARGET" ;; hda) - USE_MBR=1 BOOT_PARTITION="/dev/hda" ;; sda) - USE_MBR=1 BOOT_PARTITION="/dev/sda" ;; nowhere) @@ -250,7 +255,7 @@ grubdevice() { echo 'quit' | grub --device-map="$device_map" 1>/dev/null 2>&1 fi - # taken from d-i's trunk/packages/arch/i386/grub-installer/grub-installer: + # based on code from d-i's trunk/packages/arch/i386/grub-installer/grub-installer: tmp_disk=`echo "$device" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' \ -e 's%\(fd[0-9]*\)$%\1%' \ -e 's%/part[0-9]*$%/disc%' \ @@ -267,12 +272,7 @@ grubdevice() { echo "$tmp_drive" ;; *) # we expect something like 'hd0,0' - # make sure we don't install into MBR if $USE_MBR is not set - if [ -z "$USE_MBR" ] ; then - echo "$tmp_drive" | sed "s%$%,`expr $tmp_part - 1`%" - else - echo "$tmp_drive" | sed "s%,[0-9]%%" - fi + echo "$tmp_drive" | sed "s%$%,`expr $tmp_part - 1`%" ;; esac } @@ -281,6 +281,7 @@ grubdevice() { # interactive mode {{{ interactive_mode() { + welcome_dialog prompt_for_target prompt_for_bootmanager prompt_for_mirror @@ -288,13 +289,6 @@ interactive_mode() [ -n "$BOOT_PARTITION" ] && GRUB="$(grubdevice $BOOT_PARTITION)" [ -n "$TARGET" ] && GROOT="$(grubdevice $TARGET)" - # FIXME - echo "debug: BOOT_PARTITION=$BOOT_PARTITION" - echo "debug: TARGET=$TARGET" - echo "debug: MIRROR=$MIRROR" - echo "debug: GROOT=$GROOT" - echo "debug: GRUB=$GRUB" - # TODO # ask for raid # ask for lvm -- 2.1.4