diff --git a/files/diskspreparation.sh b/files/diskspreparation.sh index 88b5c90cfa90ef674f76990b3bb18e1234e383ea..030294e48293776e0dc6291b90ed4adebca52a53 100755 --- a/files/diskspreparation.sh +++ b/files/diskspreparation.sh @@ -155,6 +155,12 @@ initialDiskPartitionLayout() { fsize=$(echo ${part} | cut -f 1 -d ";") size=$(convertSizeToByte $(echo ${part} | cut -f 1 -d ";")) end=$((${start} + ${size})) + + if [ "${fs}" = "swap" ]; + then + fs="linux-swap" + fi + case ${scheme} in "mbr" | "msdos") parted -a optimal -s -m /dev/$1 mkpart primary ${fs} $(convertByteToSize ${start} "MiB") $(convertByteToSize ${end} "MiB") @@ -264,7 +270,7 @@ formatDiskPartion() { "ext3") mkfs.ext3 -q -F ${device} >/dev/null || retval=1 ;; "fat32") mkfs.fat -F 32 ${device} >/dev/null || retval=1 ;; "fat16") mkfs.fat -F 16 ${device} >/dev/null || retval=1 ;; - "swap") mkswap ${device} >/dev/null || retval=1 ;; + "swap" | "linux-swap") mkswap ${device} >/dev/null || retval=1 ;; "ntfs") mkntfs -q -f ${device} >/dev/null || retval=1 ;; "btrfs") mkfs.btrfs -q -f ${device} >/dev/null || retval=1 ;; "reiserfs") mkreiserfs -q ${device} >/dev/null || retval=1 ;; @@ -353,6 +359,7 @@ generateFSTab() { if [ "${fs}" = "swap" -o "${fs}" = "linux-swap" ]; then mntpnt="none" + fs="swap" fi if [ -n "${fs}" -a -n "${mntpnt}" -a -n "${uuid}" ]; @@ -433,6 +440,9 @@ createTargetDirectoryLayout(){ else mount -t ${fs} ${partdev} $1${mntpnt} -o ${opts} fi + elif [ "${fs}" = "swap" -o "${fs}" = "linux-swap" ]; + then + swapon ${partdev} fi done }