From 5ceae8dbe5ef37f3f6051ae1fd1bbc98772edbd8 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 08 Mar 2016 15:49:42 -0500 Subject: Make swap file --- diff --git a/hosts/alsvid200 b/hosts/alsvid200 index 077e5c0..964e897 100644 --- a/hosts/alsvid200 +++ b/hosts/alsvid200 @@ -5,10 +5,10 @@ part_script=' ,+,83,* ' -# fs mp type options dump pass +# fs mp type options dump pass fstab=' - @DEV1@ / ext4 errors=remount-ro 0 1 - /var/swap swap swap defaults 0 0 + @DEV1@ / ext4 errors=remount-ro 0 1 + /var/swap0 swap swap defaults,pri=100 0 0 ' mirror='http://httpredir.debian.org/debian' @@ -91,6 +91,13 @@ postinst_pkgs=' do_postinst() { + # Make swap file and set vm.swappiness. + in_target fallocate -l 4GiB /var/swap0 + in_target chmod 0600 /var/swap0 + in_target mkswap /var/swap0 + printf 'vm.swappiness = 10\n' \ + >"${target}/etc/sysctl.d/vm-swappiness.conf" + # Add "deb-src" line and backports. cat >"${target}/etc/apt/sources.list" <<-EOF deb http://httpredir.debian.org/debian jessie main -- cgit v0.9.1