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
This commit is contained in:
William Hubbs 2012-02-20 11:30:03 -06:00
parent 47c3b28459
commit 297720787f

View File

@ -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