summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-12-05 19:58:53 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-12-05 19:58:53 +0100
commit25785c78530311c77b89c04b11a60f4ff83822f0 (patch)
treef7491d8810acb878c38e4dc38ae0b453099e10ec
parent60e53af497d8dbe11b2305ea83b702d71ae13bd2 (diff)
fix for no choice in FS
-rw-r--r--src/core/libs/lib-ui-interactive.sh17
1 files 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 ]]