From b7a87de6512d3864b4b6dec5b0a6f91fc832e131 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Fri, 5 Mar 2010 21:08:55 +0100 Subject: fix + crashfix when no disks found --- src/core/libs/lib-ui-interactive.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/core/libs') diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 5aedda2..9ee8668 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -242,10 +242,13 @@ interactive_autoprepare() notify "Available Disks:\n\n$(_getavaildisks)\n" ask_option no 'Harddrive selection' "Select the hard drive to use" required $(finddisks 1 _) || return 1 DISC=$ANSWER_OPTION + elif [ -z "$DISCS" ]; then + ask_string "Could not find disk. Please enter path of devicefile manually" "" || return 1 + DISC=$ANSWER_STRING else DISC=$DISCS fi - + # TODO : some checks if $DISC is really a blockdevice is probably a good idea DISC=${DISC// /} # strip all whitespace. we need this for some reason.TODO: find out why get_blockdevice_size $DISC MiB @@ -910,7 +913,7 @@ interactive_grub() { DEVS=$(finddisks 1 _) DEVS="$DEVS $(findpartitions 1 _)" - if [ "$DEVS" = "" ]; then + if [ "$DEVS" = " " ]; then notify "No hard drives were found" return 1 fi -- cgit v1.2.3-54-g00ecf