Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 424645 - sys-kernel/dracut: drop CONFIG_MODULES kernel option dependency.
Summary: sys-kernel/dracut: drop CONFIG_MODULES kernel option dependency.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Amadeusz Żołnowski (RETIRED)
URL:
Whiteboard:
Keywords: NeedPatch
Depends on:
Blocks:
 
Reported: 2012-07-03 20:43 UTC by cyberbat
Modified: 2013-10-08 18:17 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 cyberbat 2012-07-03 20:43:50 UTC
I have /usr separate partition on lvm and hardened-sources without CONFIG_MODULES on server. When I emerge dracut it writes that it need CONFIG_MODULES.

I don't clearly understand why I need modules if have lvm in my kernel and only want initramfs to make separate /usr working. genkernel for example doesn't need modules. May be make dracut also doesn't?
Comment 1 Amadeusz Żołnowski (RETIRED) gentoo-dev 2012-07-14 12:51:22 UTC
It is possible, but it is a lot of work to review the dracut code and make kernel modules support optional.  Just enable CONFIG_MODULES, please.
Comment 2 cyberbat 2012-10-09 13:01:34 UTC
Nightfear at hardened adviced me just to touch /lib/modules/<kernel-version>/modules.dep to fake CONFIG_MODULES to dracut. And it works. Dracut has successfully create initramfs and everything work.

May be it is not so difficult? I'm not alone person who don't want to turn on CONFIG_MODULES on servers at all.

Thanks you
Comment 3 Amadeusz Żołnowski (RETIRED) gentoo-dev 2012-12-16 19:24:29 UTC
That way seems to be quite easy, but it's a hack which I doubt it would be accepted by upstream. If you provide elegant solution which has a chances to be applied by upstream, I'll be happy to apply it.
Comment 4 Amadeusz Żołnowski (RETIRED) gentoo-dev 2013-02-16 13:24:03 UTC
Please reopen if patch is provided.
Comment 5 cyberbat 2013-03-06 20:05:55 UTC
(In reply to comment #3)
> That way seems to be quite easy, but it's a hack which I doubt it would be
> accepted by upstream. If you provide elegant solution which has a chances to
> be applied by upstream, I'll be happy to apply it.

I'm not skilled in bash or any coding, but just something like this:

--- /usr/bin/dracut     2013-01-08 03:45:29.000000000 +0400
+++ dracut.my   2013-03-06 23:58:38.666425300 +0400
@@ -688,7 +688,7 @@
 
 abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile"
 
-[[ -f $srcmods/modules.dep ]] || {
+[[ -d $srcmods && -f $srcmods/modules.dep ]] || {
     dfatal "$srcmods/modules.dep is missing. Did you run depmod?"
     exit 1
 }
Comment 6 cyberbat 2013-03-06 20:13:14 UTC
Sorry, one file missed:

--- /usr/lib/dracut/dracut-functions    2013-01-08 03:45:29.000000000 +0400
+++ dracut-functions.my 2013-03-07 00:11:59.203150713 +0400
@@ -1467,14 +1467,17 @@
 )
 
 find_kernel_modules_by_path () (
-    local _OLDIFS
-        _OLDIFS=$IFS
-        IFS=:
-        while read a rest; do
-            [[ $a = kernel*/$1/* ]] || continue
-            echo $srcmods/$a
-        done < $srcmods/modules.dep
-        IFS=$_OLDIFS
+       if [[ -d $srcmods ]]
+       then
+           local _OLDIFS
+               _OLDIFS=$IFS
+               IFS=:
+               while read a rest; do
+                   [[ $a = kernel*/$1/* ]] || continue
+                   echo $srcmods/$a
+               done < $srcmods/modules.dep
+               IFS=$_OLDIFS
+       fi
     return 0
 )
Comment 7 Nikoli 2013-03-12 14:02:02 UTC
ChangeLog for dracut-026 has:
- enable initramfs building without kernel modules (fixed regression)
Comment 8 Amadeusz Żołnowski (RETIRED) gentoo-dev 2013-04-02 13:55:40 UTC
Fixed in 026-r2 and 027.  Older ebuilds are going to be removed if everything is going to be fine with 027.  cyberbat, could you test it?


*dracut-026-r2 (02 Apr 2013)

  02 Apr 2013; Amadeusz Żołnowski <aidecoe@gentoo.org>
  +files/026-0000-fix-version-print.patch, +dracut-026-r2.ebuild:
  Backporting changes wrt virtual/udev, CONFIG_MODULES and systemd from
  dracut-027.ebuild.

*dracut-027 (02 Apr 2013)

  02 Apr 2013; Amadeusz Żołnowski <aidecoe@gentoo.org>
  +files/027-0001-dracut-functions.sh-support-for-altern.patch,
  +files/027-0002-gentoo.conf-let-udevdir-be-handled-by-.patch,
  +dracut-027.ebuild:
  Version bump.

  Dracut 027 depends on virtual/udev now and no longer needs CONFIG_MODULES in
  kernel.

[...]
Comment 9 cyberbat 2013-04-02 20:52:35 UTC
I've tested. Emerged, made initramfs image and rebooted normally. Thank you
Comment 10 Robert Förster 2013-09-20 11:13:07 UTC
looks like it regressed again with =sys-kernel/dracut-033 -> Kernel version 3.11.1-gentoo has no modules in /lib/modules/3.11.1-gentoo

reverting aacdba2bdb3efddd7b3b9cdb149204d86f5020b0 "fixes" it (not completely, but it happens to work.)
also 36b2e5e2c27f9e72e9aa40e580b6d9e60799ceae and 3c4315fa1368f1ee12dfa8abb5dd7c3556da79f8 seem to be relevant.
Comment 11 Robert Förster 2013-10-08 16:13:50 UTC
upstream fixed it after 034 release with http://git.kernel.org/cgit/boot/dracut/dracut.git/patch/?id=05214a0bedc084a41c35a128609745ad04a0c6cf
Comment 12 Amadeusz Żołnowski (RETIRED) gentoo-dev 2013-10-08 18:17:28 UTC
Fix included in dracut-034.