summaryrefslogtreecommitdiffstats
path: root/rescue/restore-image.sh
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-11-12 10:13:07 +0000
committerOlivier Blin <oblin@mandriva.com>2008-11-12 10:13:07 +0000
commitbf8643b3bcb9bd8eb8161a56d32d46fa098b33a1 (patch)
tree575f89c589b0d32ae4731506f9b9daf8777456aa /rescue/restore-image.sh
parent77d5b5d58705d88fd834a394c5f3a1be99ec620b (diff)
downloaddrakx-bf8643b3bcb9bd8eb8161a56d32d46fa098b33a1.tar
drakx-bf8643b3bcb9bd8eb8161a56d32d46fa098b33a1.tar.gz
drakx-bf8643b3bcb9bd8eb8161a56d32d46fa098b33a1.tar.bz2
drakx-bf8643b3bcb9bd8eb8161a56d32d46fa098b33a1.tar.xz
drakx-bf8643b3bcb9bd8eb8161a56d32d46fa098b33a1.zip
really make swap creation conditional
Diffstat (limited to 'rescue/restore-image.sh')
-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
}