From e85487169a542eac82244b448e9bb4882ee7a4da Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 24 Oct 2013 14:21:23 +0200 Subject: setup-disk: add swap to /etc/fstab --- setup-disk.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup-disk.in b/setup-disk.in index 8d3e14d..9e222fb 100644 --- a/setup-disk.in +++ b/setup-disk.in @@ -286,6 +286,10 @@ install_mounted_root() { mv "$mnt"/etc/fstab "$mnt"/etc/fstab.old fi enumerate_fstab "$mnt" >> "$mnt"/etc/fstab + if [ -n "$SWAP_DEVICE" ]; then + echo -e "${SWAP_DEVICE}\tswap\tswap\tdefaults\t0 0" \ + >> "$mnt"/etc/fstab + fi cat >>"$mnt"/etc/fstab </dev/null echo -e "$swap_dev\tswap\t\tswap\tdefaults 0 0" >> /etc/fstab done + SWAP_DEVICE="$(uuid_or_device $swap_dev)" swapon -a rc-update --quiet add swap boot } -- cgit v1.2.3