From f67c3e73ad3784f053afaaa03b5fe04d061ad125 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 7 Dec 2008 19:03:14 +0100 Subject: support for swap can be useful --- src/core/libs/lib-blockdevices-filesystems.sh | 1 + src/core/libs/lib-ui-interactive.sh | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index 9e79454..df055de 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -561,6 +561,7 @@ process_filesystem () get_filesystem_program () { [ -z "$1" ] && die_error "get_filesystem_program needs a filesystem id as \$1" + [ $1 = swap ] && echo mkswap && return 0 [ $1 = ext2 ] && echo mkfs.ext2 && return 0 [ $1 = ext3 ] && echo mkfs.ext3 && return 0 [ $1 = reiserfs ] && echo mkreiserfs && return 0 diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index dbdb299..a6b94fb 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -133,7 +133,7 @@ interactive_autoprepare() do ask_number "Enter the size (MB) of your / partition. Recommended size:7500. The /home partition will use the remaining space.\n\nDisk space left: $BLOCKDEVICE_SIZE MB" 1 $BLOCKDEVICE_SIZE || return 1 ROOT_PART_SIZE=$ANSWER_NUMBER - ask_yesno "$(($BLOCKDEVICE_SIZE-$ROOT_PART_SIZE)) MB will be used for your /home partition. Is this OK?" && ROOT_PART_SET=1 + ask_yesno "$(($BLOCKDEVICE_SIZE-$ROOT_PART_SIZE)) MB will be used for your /home partition. Is this OK?" yes && ROOT_PART_SET=1 done CHOSEN_FS="" @@ -257,6 +257,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 `get_filesystem_program swap` &>/dev/null && FSOPTS="$FSOPTS swap Swap" [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which `get_filesystem_program ext2` &>/dev/null && FSOPTS="$FSOPTS ext2 Ext2" [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which `get_filesystem_program ext3` &>/dev/null && FSOPTS="$FSOPTS ext3 Ext3" [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which `get_filesystem_program reiserfs` &>/dev/null && FSOPTS="$FSOPTS reiserfs Reiser3" @@ -282,7 +283,7 @@ interactive_filesystem () fi # ask mountpoint, if relevant - if [[ $fs_type != lvm-* && "$fs_type" != dm_crypt ]] + if [[ $fs_type != lvm-* && "$fs_type" != dm_crypt && $fs_type != swap ]] then default= [ -n "$fs_mountpoint" ] && default="$fs_mountpoint" -- cgit v1.2.3-54-g00ecf