Skip to content
Snippets Groups Projects
Commit daa62f53 authored by Pietsch, Martin's avatar Pietsch, Martin
Browse files

bugfix: bad handling of swap partition

parent 08d662d9
No related branches found
No related tags found
No related merge requests found
...@@ -155,6 +155,12 @@ initialDiskPartitionLayout() { ...@@ -155,6 +155,12 @@ initialDiskPartitionLayout() {
fsize=$(echo ${part} | cut -f 1 -d ";") fsize=$(echo ${part} | cut -f 1 -d ";")
size=$(convertSizeToByte $(echo ${part} | cut -f 1 -d ";")) size=$(convertSizeToByte $(echo ${part} | cut -f 1 -d ";"))
end=$((${start} + ${size})) end=$((${start} + ${size}))
if [ "${fs}" = "swap" ];
then
fs="linux-swap"
fi
case ${scheme} in case ${scheme} in
"mbr" | "msdos") "mbr" | "msdos")
parted -a optimal -s -m /dev/$1 mkpart primary ${fs} $(convertByteToSize ${start} "MiB") $(convertByteToSize ${end} "MiB") parted -a optimal -s -m /dev/$1 mkpart primary ${fs} $(convertByteToSize ${start} "MiB") $(convertByteToSize ${end} "MiB")
...@@ -264,7 +270,7 @@ formatDiskPartion() { ...@@ -264,7 +270,7 @@ formatDiskPartion() {
"ext3") mkfs.ext3 -q -F ${device} >/dev/null || retval=1 ;; "ext3") mkfs.ext3 -q -F ${device} >/dev/null || retval=1 ;;
"fat32") mkfs.fat -F 32 ${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 ;; "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 ;; "ntfs") mkntfs -q -f ${device} >/dev/null || retval=1 ;;
"btrfs") mkfs.btrfs -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 ;; "reiserfs") mkreiserfs -q ${device} >/dev/null || retval=1 ;;
...@@ -353,6 +359,7 @@ generateFSTab() { ...@@ -353,6 +359,7 @@ generateFSTab() {
if [ "${fs}" = "swap" -o "${fs}" = "linux-swap" ]; if [ "${fs}" = "swap" -o "${fs}" = "linux-swap" ];
then then
mntpnt="none" mntpnt="none"
fs="swap"
fi fi
if [ -n "${fs}" -a -n "${mntpnt}" -a -n "${uuid}" ]; if [ -n "${fs}" -a -n "${mntpnt}" -a -n "${uuid}" ];
...@@ -433,6 +440,9 @@ createTargetDirectoryLayout(){ ...@@ -433,6 +440,9 @@ createTargetDirectoryLayout(){
else else
mount -t ${fs} ${partdev} $1${mntpnt} -o ${opts} mount -t ${fs} ${partdev} $1${mntpnt} -o ${opts}
fi fi
elif [ "${fs}" = "swap" -o "${fs}" = "linux-swap" ];
then
swapon ${partdev}
fi fi
done done
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment