Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 468598 - sys-apps/busybox: swapon: add support for the -e option
Summary: sys-apps/busybox: swapon: add support for the -e option
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
: 487088 (view as bug list)
Depends on:
Blocks: openrc-busybox
  Show dependency tree
 
Reported: 2013-05-04 17:54 UTC by William Hubbs
Modified: 2015-12-16 18:01 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for busybox 1.20 and 1.21 (busybox-1.20-swaponoff-ifexists.patch,2.82 KB, patch)
2014-12-07 17:05 UTC, René Rhéaume
Details | Diff
Patch for busybox 1.22 (busybox-1.22-swaponoff-ifexists.patch,2.77 KB, patch)
2014-12-07 17:05 UTC, René Rhéaume
Details | Diff
Patch for busybox master branch (busybox-master-swaponoff-ifexists.patch,2.87 KB, patch)
2014-12-07 17:06 UTC, René Rhéaume
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description William Hubbs gentoo-dev 2013-05-04 17:54:54 UTC
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?
Comment 1 Dustin C. Hatch 2013-08-08 01:49:38 UTC
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.
Comment 2 Chris Brannon (RETIRED) gentoo-dev 2013-08-27 20:33:14 UTC
The swapon implementation in busybox doesn't support nofail, either.

Is there any reason why OpenRC's swap service needs to run before localmount?
Comment 3 William Hubbs gentoo-dev 2013-09-05 18:43:34 UTC
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.
Comment 4 William Hubbs gentoo-dev 2013-10-06 16:48:37 UTC
*** Bug 487088 has been marked as a duplicate of this bug. ***
Comment 5 René Rhéaume 2014-12-07 17:05:16 UTC
Created attachment 391144 [details, diff]
Patch for busybox 1.20 and 1.21
Comment 6 René Rhéaume 2014-12-07 17:05:58 UTC
Created attachment 391146 [details, diff]
Patch for busybox 1.22
Comment 7 René Rhéaume 2014-12-07 17:06:40 UTC
Created attachment 391148 [details, diff]
Patch for busybox master branch
Comment 8 René Rhéaume 2014-12-07 17:07:57 UTC
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
Comment 9 René Rhéaume 2015-01-06 04:44:54 UTC
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?
Comment 10 SpanKY gentoo-dev 2015-12-16 18:01:43 UTC
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