diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2008-12-05 18:51:20 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2008-12-05 18:51:20 +0100 |
commit | e22f3102ca185b43ca975ee3f960e949aa0e8185 (patch) | |
tree | 502ffb7e159d7f38c058f71959bf1653c5e9bfe0 /src/core | |
parent | 81f23c78763d8c21c82c146f3821988cd9b3a338 (diff) |
cleanups and fixes
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/libs/lib-blockdevices-filesystems.sh | 17 | ||||
-rw-r--r-- | src/core/libs/lib-ui-interactive.sh | 7 |
2 files changed, 21 insertions, 3 deletions
diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index b95fa9a..8e49fbf 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -494,3 +494,20 @@ process_filesystem () return 0 } + + +# $1 filesystem type +get_filesystem_program () +{ + [ -z "$1" ] && die_error "get_filesystem_program needs a filesystem id as \$1" + [ $1 = ext2 ] && echo mkfs.ext2 + [ $1 = ext3 ] && echo mkfs.ext3 + [ $1 = reiserfs ] && echo mkreiserfs + [ $1 = xfs ] && echo mkfs.xfs + [ $1 = jfs ] && echo mkfs.jfs + [ $1 = vfat ] && echo mkfs.vfat + [ $1 = lvm-pv ] && echo pvcreate + [ $1 = lvm-vg ] && echo vgcreate + [ $1 = lvg-lv ] && echo lvcreate + [ $1 = dm_crypt ] && echo cryptsetup +}
\ No newline at end of file diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index c58e371..4a77227 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -288,7 +288,7 @@ interactive_filesystem () # Determine which filesystems/blockdevices are possible for this blockdevice FSOPTS= [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which mkfs.ext2 &>/dev/null && FSOPTS="$FSOPTS ext2 Ext2" - [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which mkfs.ext2 &>/dev/null && FSOPTS="$FSOPTS ext3 Ext3" + [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which mkfs.ext3 &>/dev/null && FSOPTS="$FSOPTS ext3 Ext3" [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which mkreiserfs &>/dev/null && FSOPTS="$FSOPTS reiserfs Reiser3" [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which mkfs.xfs &>/dev/null && FSOPTS="$FSOPTS xfs XFS" [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which mkfs.jfs &>/dev/null && FSOPTS="$FSOPTS jfs JFS" @@ -347,7 +347,8 @@ interactive_filesystem () # ask opts default= [ -n "$fs_opts" ] && default="$fs_opts" - _dia_DIALOG --inputbox "Enter any additional opts for the program that will make $fs_type on $part" 8 65 "$default" 2>$ANSWER || return 1 + program=`get_filesystem_program $fs_type` + _dia_DIALOG --inputbox "Enter any additional opts for $program" 8 65 "$default" 2>$ANSWER || return 1 fs_opts=$(cat $ANSWER) [ -z "$fs_type" ] && fs_type=no_type @@ -438,7 +439,7 @@ interactive_filesystems() { fi # update the menu - sed -i "s/^$part $part_type $part_label.*/$part $part_type $part_label $fs/" $BLOCK_DATA + sed -i "s#^$part $part_type $part_label.*#$part $part_type $part_label $fs#" $BLOCK_DATA # '#' is a forbidden character ! done |