Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 622888 - sys-kernel/dracut (thru 044-r3): kmod shouldn't be required for monolithic kernels
Summary: sys-kernel/dracut (thru 044-r3): kmod shouldn't be required for monolithic ke...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-28 05:05 UTC by Duncan
Modified: 2017-07-02 23:28 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan 2017-06-28 05:05:13 UTC
Current dracut hard-RDEPENDs on kmod, which shouldn't be required for users that build monolithic kernels.

Since dracut-033 in 2013 (apparently[1]) I've been merging dracut with a simple patch that removes a single non-optional scripted rmmod installation call, and filling the dracut ebuild's kmod dep with a no-files kmod-999 ebuild from my overlay, so I know that with that one patch, dracut continues to work without kmod on monolithic kernels.

The not-appropriate-for-general-use, simply-kill-it, patch I use here is to modules.d/99base/module-setup.sh, and simply removes rmmod from the inst_multiple line that would otherwise install it, near the top of the install() function (line 19 in 044-r3, apparently line 18 in 033[1]).  

However, that by itself simply kills the rmmod installation, which isn't going to work for the modular kernel folks, thus explaining my not attaching it here.

Luckily, there's the dracut.modules manpage documenting the inst_multiple "creation function".  According to it, the -o option tells inst_multiple not to error out if the file is missing, and indeed, a couple lines below the first inst_multiple call is a second one (line 22 in 044-r3), this time with the -o option, that installs... kmod itself.

So a proper patch would remove rmmod from the line 19 inst_multiple call without -o, and add it to the line 22 inst_multiple -o call, where kmod itself is installed.  That will treat rmmod exactly like kmod itself, killing the error if rmmod isn't to be found, and removing the hard-dep on the kmod package.

Then it's simply a matter of simply removing the rdep in favor of another pkg_postinst() optfeature call to go along with the others already there. =:^)

With that in place I'll be able to remove /etc/portage/patches/sys-kernel/dracut/no-rmmod.patch along with my overlay's no-files kmod-999 I've had to keep merged to  fill that dracut dependency. =:^)

---
[1] Based on the patch I've been using.
Comment 1 Mike Gilbert gentoo-dev 2017-06-28 13:51:19 UTC
I don't see a good reason to make kmod optional here. Do you have one?

Also, dracut-045 will require libkmod, so that's even more patching that we would have to do.

https://git.kernel.org/pub/scm/boot/dracut/dracut.git/tree/configure?h=045#n55
Comment 2 Mike Gilbert gentoo-dev 2017-06-28 13:59:59 UTC
To put this another way, I think you need to work with upstream on this if you want to see it happen.