summaryrefslogtreecommitdiffstats
path: root/rescue
diff options
context:
space:
mode:
Diffstat (limited to 'rescue')
-rwxr-xr-xrescue/restore-image.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/rescue/restore-image.sh b/rescue/restore-image.sh
index 425057113..ddb12f5e8 100755
--- a/rescue/restore-image.sh
+++ b/rescue/restore-image.sh
@@ -177,8 +177,10 @@ function expand_fs()
sfdisk -d $disk | sed -e "\|$main_part| s/size=.*,/size= $main_part_sectors,/" | sfdisk -f $disk
e2fsck -fy $main_part
resize2fs $main_part
- parted $disk -- mkpartfs primary linux-swap ${main_part_sectors}s -1s yes
- mkswap -L swap $swap_part
+ if [ -n "$SWAP_BLOCKS" ]; then
+ parted $disk -- mkpartfs primary linux-swap ${main_part_sectors}s -1s yes
+ mkswap -L swap $swap_part
+ fi
fi
}