summaryrefslogtreecommitdiffstats
path: root/hosts
diff options
context:
space:
mode:
Diffstat (limited to 'hosts')
-rw-r--r--hosts/alsvid2009
1 files changed, 6 insertions, 3 deletions
diff --git a/hosts/alsvid200 b/hosts/alsvid200
index 298f2f5..166e79c 100644
--- a/hosts/alsvid200
+++ b/hosts/alsvid200
@@ -96,9 +96,12 @@ postinst_pkgs='
do_postinst()
{
# Make swap file and set vm.swappiness.
- in_target fallocate -l 12GiB /var/swap || return 1
- in_target chmod 0600 /var/swap || return 1
- in_target mkswap /var/swap || return 1
+ # mkswap needs to be given the full path to the swap file including the
+ # root file system's mount point, or else this false error happens:
+ # mkswap: error: /var/swap is mounted; will not make swapspace
+ fallocate -l 12GiB "${target}/var/swap" || return 1
+ chmod 0600 "${target}/var/swap" || return 1
+ mkswap "${target}/var/swap" || return 1
printf 'vm.swappiness = 10\n' \
>"${target}/etc/sysctl.d/vm-swappiness.conf"