In the swap service, OpenRC uses swapon's -e option to allow it to skip over fstab entries pointing to non-existent swap files or devices. The internal swapon for busybox does not support this option. Should it?
This breaks automounting of swap devices on systems where swapon is provided by busybox. In my opinion, having the `-e` option isn't a good idea in the first place. Without a warning for missing swap devices, users may not notice that they mistyped the device path in /etc/fstab and happily go along without any swap. For users who do have swap devices coming and going, there's the nofail fstab option. As such, I think OpenRC should not use -e.
The swapon implementation in busybox doesn't support nofail, either. Is there any reason why OpenRC's swap service needs to run before localmount?
I suppose it could be argued that the sooner swap is active the better. I think swapon in busybox should respect the nofail option in fstab and/or support the -e command line option; right now it does neither. -e option.
*** Bug 487088 has been marked as a duplicate of this bug. ***
Created attachment 391144 [details, diff] Patch for busybox 1.20 and 1.21
Created attachment 391146 [details, diff] Patch for busybox 1.22
Created attachment 391148 [details, diff] Patch for busybox master branch
I created a patch to add -e to busybox swapon/swapoff for every version in portage. Also submitted upstream, see http://permalink.gmane.org/gmane.linux.busybox/40435
Upstream applied my patch for the master branch. However, it would not come until next year release, if I extrapolate from the last few years/releases. Any plans to integrate the patches to Gentoo?
it's in the version in the tree now, although the patch sent upstream wasn't entirely correct -- it would still exit(1) and issue a warning when the device did not exist. i've fixed that upstream now though. https://git.busybox.net/busybox/commit/?id=5f11ec3f6a7e4fe6cc2626ccb7cda4ecb5c3938a