From 25785c78530311c77b89c04b11a60f4ff83822f0 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Fri, 5 Dec 2008 19:58:53 +0100 Subject: fix for no choice in FS --- src/core/libs/lib-ui-interactive.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 7fb91df..ca1bb7f 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -298,11 +298,18 @@ interactive_filesystem () [ $part_type = lvm-vg ] && which lvcreate &>/dev/null && FSOPTS="$FSOPTS lvm-lv LVM_Logical_Volume" [ $part_type = raw -o $part_type = lvm-lv ] && which cryptsetup &>/dev/null && FSOPTS="$FSOPTS dm_crypt DM_crypt_Volume" - # ask FS - default= - [ -n "$fs_type" ] && default="--default-item $fs_type" - ask_option no "Select a filesystem for $part:" $FSOPTS || return 1 - fs_type=$ANSWER_OPTION + # determine FS + fsopts=($FSOPTS); + if [ ${#fsopts[*]} -lt 4 ] # less then 4 words in the $FSOPTS string. eg only one option + then + infofy "Automatically picked ${fsopts[1]}. It's the only option for $part_type blockdevices" + fs_type=${fsopts[0]} + else + default= + [ -n "$fs_type" ] && default="--default-item $fs_type" + ask_option no "Select a filesystem for $part:" $FSOPTS || return 1 + fs_type=$ANSWER_OPTION + fi # ask mountpoint, if relevant if [[ $fs_type != lvm-* && "$fs_type" != dm_crypt ]] -- cgit v1.2.3-54-g00ecf