summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-10-24 14:21:23 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2013-10-24 14:21:23 +0200
commite85487169a542eac82244b448e9bb4882ee7a4da (patch)
tree4d7898bae284e08efb7b05809ee5600058c06739
parentc9533d0ea64f29de872e48be67b6eaa10b7e2ca3 (diff)
downloadalpine-conf-e85487169a542eac82244b448e9bb4882ee7a4da.zip
setup-disk: add swap to /etc/fstab
-rw-r--r--setup-disk.in5
1 files changed, 5 insertions, 0 deletions
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 <<EOF
/dev/cdrom /media/cdrom iso9660 noauto,ro 0 0
/dev/fd0 /media/floppy vfat noauto 0 0
@@ -573,6 +577,7 @@ setup_swap_dev() {
mkswap $swap_dev >/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
}