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?
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.
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
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.
Please reopen if patch is provided.
(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 }
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 )
ChangeLog for dracut-026 has: - enable initramfs building without kernel modules (fixed regression)
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. [...]
I've tested. Emerged, made initramfs image and rebooted normally. Thank you
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.
upstream fixed it after 034 release with http://git.kernel.org/cgit/boot/dracut/dracut.git/patch/?id=05214a0bedc084a41c35a128609745ad04a0c6cf
Fix included in dracut-034.