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()
{
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}"
BOOT_PARTITION="$TARGET"
;;
hda)
- USE_MBR=1
BOOT_PARTITION="/dev/hda"
;;
sda)
- USE_MBR=1
BOOT_PARTITION="/dev/sda"
;;
nowhere)
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%' \
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
}
# interactive mode {{{
interactive_mode()
{
+ welcome_dialog
prompt_for_target
prompt_for_bootmanager
prompt_for_mirror
[ -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