From e48fd6ba2e6c075ad1a1182fa197afef114958ab Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 16 Mar 2016 10:35:05 -0400 Subject: Don't run mkswap in target --- (limited to 'hosts') 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" -- cgit v0.9.1