aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-09-20 19:16:33 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-09-20 19:16:33 -0300
commit7aa82be2bd031fc10a5c787f641a881a4157d00a (patch)
tree86b60f6ee16f812ad5f91f7c3851fd5c1efa07c6
parent793a4889babe1f98cd2937eeef2fad0892ddfa38 (diff)
downloadhydra-7aa82be2bd031fc10a5c787f641a881a4157d00a.tar.gz
hydra-7aa82be2bd031fc10a5c787f641a881a4157d00a.tar.bz2
Provision: swap fixes
-rwxr-xr-xshare/hydractl/provision12
1 files changed, 6 insertions, 6 deletions
diff --git a/share/hydractl/provision b/share/hydractl/provision
index 628e82c..9bd8aac 100755
--- a/share/hydractl/provision
+++ b/share/hydractl/provision
@@ -169,7 +169,7 @@ hydra_safe_run vgchange -a y $vg
hydra_provision_lvcreate root $root_size
# Create swap partition
-if [ "$swap" != "0" ]; then
+if [ "$swap_size" != "0" ]; then
hydra_provision_lvcreate swap $swap_size
fi
@@ -197,7 +197,7 @@ if [ "$garbage" == "y" ]; then
dd if=/dev/urandom of=/dev/mapper/$vg-var
fi
- if [ "$swap" != "0" ]; then
+ if [ "$swap_size" != "0" ]; then
dd if=/dev/urandom of=/dev/mapper/$vg-swap
fi
fi
@@ -210,7 +210,7 @@ for folder in proc dev home var boot sys; do
done
# Create swap fs.
-if [ "$swap" != "0" ] && [ "$random_swap" != "y" ]; then
+if [ "$swap_size" != "0" ] && [ "$random_swap" != "y" ]; then
hydra_cryptsetup /dev/mapper/$vg-swap
hydra_safe_run cryptsetup luksOpen /dev/mapper/$vg-swap provision-swap
hydra_safe_run mkswap /dev/mapper/provision-swap
@@ -306,13 +306,13 @@ var /dev/mapper/$vg-var none luks
EOF
fi
-if [ "$swap" != "0" ] && [ "$random_swap" == "y" ]; then
+if [ "$swap_size" != "0" ] && [ "$random_swap" == "y" ]; then
cat >> /tmp/debootstrap/etc/crypttab <<-EOF
swap /dev/mapper/$vg-swap /dev/random swap,cipher=aes-xts-plain64:sha256
EOF
fi
-if [ "$swap" != "0" ] && [ "$random_swap" != "y" ]; then
+if [ "$swap_size" != "0" ] && [ "$random_swap" != "y" ]; then
cat >> /tmp/debootstrap/etc/crypttab <<-EOF
swap /dev/mapper/$vg-swap none luks,swap
EOF
@@ -321,7 +321,7 @@ fi
# Fstab.
echo "Configuring fstab..."
echo "" > /tmp/debootstrap/etc/fstab
-if [ "$swap" != "0" ]; then
+if [ "$swap_size" != "0" ]; then
cat >> /tmp/debootstrap/etc/fstab <<-EOF
/dev/mapper/swap none swap sw 0 0
EOF