summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2012-02-20 11:30:03 -0600
committerWilliam Hubbs <williamh@gentoo.org>2012-02-20 11:30:03 -0600
commit297720787f914ca34f2d04c66980c18c57700865 (patch)
tree3eb0c9f06946f3e48289e4b7c4e1d4a2b57626ad
parent47c3b284599cb4cfc9d1263af6d2039d67906b43 (diff)
downloadopenrc-297720787f914ca34f2d04c66980c18c57700865.tar.gz
openrc-297720787f914ca34f2d04c66980c18c57700865.tar.bz2
openrc-297720787f914ca34f2d04c66980c18c57700865.tar.xz
swap: go back to using swapon for Linux systems
There are several reasons for going back to this: - fstabinfo doesn't work with labels in fstab - when a device is passed to swapon individually, the swap priority from fstab is not honored. - We also add the -e option to only activate available swap devices. reported-by: Duncan <1i5t5.duncan@cox.net> X-Gentoo-Bug: 405021 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=405021
-rw-r--r--init.d/swap.in10
1 files changed, 1 insertions, 9 deletions
diff --git a/init.d/swap.in b/init.d/swap.in
index 0b229a1..fa08b4d 100644
--- a/init.d/swap.in
+++ b/init.d/swap.in
@@ -12,15 +12,7 @@ start()
{
ebegin "Activating swap devices"
case "$RC_UNAME" in
- Linux)
- local dev
- for dev in $(fstabinfo -b -t swap); do
- case "$dev" in
- /dev/loop*) ;;
- *) swapon $dev >/dev/null;;
- esac
- done
- ;;
+ Linux) swapon -a -e >/dev/null;;
NetBSD|OpenBSD) swapctl -A -t noblk >/dev/null;;
*) swapon -a >/dev/null;;
esac