Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 447088 - sys-kernel/dracut-024: drop udevdir variable from dracut.conf.d/gentoo.conf (was sys-fs/udev-196: should suggest to reemerge dracut if it is installed)
Summary: sys-kernel/dracut-024: drop udevdir variable from dracut.conf.d/gentoo.conf (...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Amadeusz Żołnowski (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-12-13 10:49 UTC by Alexander Tsoy
Modified: 2013-02-16 13:36 UTC (History)
1 user (show)

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


Attachments
dracut-024-r2.ebuild.patch (dracut-024-r2.ebuild.patch,626 bytes, patch)
2012-12-13 12:52 UTC, Alexander Tsoy
Details | Diff
dracut-024-fallback-udevdir.patch (dracut-024-fallback-udevdir.patch,542 bytes, patch)
2012-12-14 10:17 UTC, Alexander Tsoy
Details | Diff
024-0002-dracut-functions.sh-support-for-altern.patch (024-0002-dracut-functions.sh-support-for-altern.patch,1.03 KB, patch)
2013-01-05 21:01 UTC, Alexander Tsoy
Details | Diff
024-0002-dracut-functions.sh-support-for-altern.patch (024-0002-dracut-functions.sh-support-for-altern.patch,830 bytes, patch)
2013-01-06 08:44 UTC, Alexander Tsoy
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Tsoy 2012-12-13 10:49:18 UTC
I upgraded udev from 171-r9 to 196-r1. Then I regenerate initramfs using dracut and my system became unbootable - lvm volumes not activated. This was caused by udevdir option in /etc/dracut.conf.d/gentoo.conf.

It was:
$ grep ^udevdir /etc/dracut.conf.d/gentoo.conf
udevdir="/lib/udev"

and after reemerge of dracut it become:
$ grep ^udevdir /etc/dracut.conf.d/gentoo.conf
udevdir="/usr/lib/udev"


Diff between lsinitrd outputs before and after reemerge of dracut:

-14:01 dev/console 
-14:01 dev/kmsg 
-14:01 dev/null 
+14:09 dev/console 
+14:09 dev/kmsg 
+14:09 dev/null 
 bin  
 bin/cat  
 bin/chroot  
@@ -240,8 +240,6 @@
 lib64/modules/3.6.8-hardened/modules.symbols.bin  
 lib64/systemd  
 lib64/systemd/systemd-udevd -> /usr/lib/systemd/systemd-udevd
-lib64/udev  
-lib64/udev/rules.d  
 lib -> lib64
 proc  
 root  
@@ -298,6 +296,19 @@
 usr/lib64/libudev.so -> libudev.so.1.2.0
 usr/lib64/systemd  
 usr/lib64/systemd/systemd-udevd  
+usr/lib64/udev  
+usr/lib64/udev/ata_id  
+usr/lib64/udev/cdrom_id  
+usr/lib64/udev/rules.d  
+usr/lib64/udev/rules.d/10-dm.rules  
+usr/lib64/udev/rules.d/11-dm-lvm.rules  
+usr/lib64/udev/rules.d/13-dm-disk.rules  
+usr/lib64/udev/rules.d/50-udev-default.rules  
+usr/lib64/udev/rules.d/60-persistent-storage.rules  
+usr/lib64/udev/rules.d/80-drivers.rules  
+usr/lib64/udev/rules.d/95-dm-notify.rules  
+usr/lib64/udev/rules.d/95-udev-late.rules  
+usr/lib64/udev/scsi_id  
 usr/lib -> lib64
 usr/sbin  
 var


Reproducible: Always
Comment 1 Alexander Tsoy 2012-12-13 12:51:32 UTC
Or maybe this should be better fixed on dracut side. Dracut script (at least version 024) contains this:

[[ -d $udevdir ]] \
    || udevdir=$(pkg-config udev --variable=udevdir 2>/dev/null)
if ! [[ -d "$udevdir" ]]; then
    [[ -d /lib/udev ]] && udevdir=/lib/udev
    [[ -d /usr/lib/udev ]] && udevdir=/usr/lib/udev
fi

So removing udevdir from config should solve this problem.
Comment 2 Alexander Tsoy 2012-12-13 12:52:02 UTC
Created attachment 332206 [details, diff]
dracut-024-r2.ebuild.patch
Comment 3 Amadeusz Żołnowski (RETIRED) gentoo-dev 2012-12-13 18:33:28 UTC
Yes, probably I should make optional dependency on pkg-config which has been removed because other people didn't like that dependency.
Comment 4 Alexander Tsoy 2012-12-14 09:23:03 UTC
Hmm.. But this will not solve all the problems. For example stable mdadm-3.1.4 installs udev rules in /lib/udev/rules.d (this was fixed in 3.2.x). So dracut anyway can't pick up 64-md-raid.rules file when generating initramfs.

udev contains the compatibility patch wich adds /lib/udev/rules.d dir to the list of dirs where it looks for rules. So maybe this approach should be applied to dracut?
Comment 5 Alexander Tsoy 2012-12-14 10:17:53 UTC
Created attachment 332282 [details, diff]
dracut-024-fallback-udevdir.patch

I have not tested this patch. I have simply upgraded mdadm. :)
Comment 6 Amadeusz Żołnowski (RETIRED) gentoo-dev 2012-12-16 19:55:00 UTC
Please check if dracut-024-r3 solves issue for you.
Comment 7 Alexander Tsoy 2012-12-29 20:26:03 UTC
mdraid module still fails if 64-md-raid.rules is installed in /lib/udev/rules.d. It expects that the rule exist in {udevdir}/rules.d" dir, but inst_rules() preserves paths when installing rules.

Part of dracut log:

I: *** Including module: mdraid ***
sed: can't read /var/tmp/initramfs.m5NR2G/usr/lib/udev/rules.d/64-md-raid.rules: No such file or directory

$ sudo lsinitrd /boot/initramfs-3.7.1-hardened.img | grep 64-md-raid.rules                           
-rw-r--r--   1 root     root         1973 Dec 29 23:40 lib64/udev/rules.d/64-md-raid.rules


This is a sed command mentioned in dracut log. 

user@host /usr/lib64/dracut/modules.d/90mdraid $ grep sed ./module-setup.sh
     sed -i -r -e '/RUN\+?="[[:alpha:]/]*mdadm[[:blank:]]+(--incremental|-I)[[:blank:]]+(\$env\{DEVNAME\}|\$tempnode)"/d' "${initdir}${udevdir}/rules.d/64-md-raid.rules"
Comment 8 Alexander Tsoy 2013-01-05 21:01:15 UTC
Created attachment 334578 [details, diff]
024-0002-dracut-functions.sh-support-for-altern.patch

Modified version of the patch. Installs rules from alternative dirs to $udevdir/rules.d. Amadeusz, what do you think about this patch? It works for me.
Comment 9 Alexander Tsoy 2013-01-05 21:30:39 UTC
(In reply to comment #8)
> Created attachment 334578 [details, diff] [details, diff]
> 024-0002-dracut-functions.sh-support-for-altern.patch

Maybe using arrays is an overkill here. :)
Comment 10 Alexander Tsoy 2013-01-06 08:44:15 UTC
Created attachment 334628 [details, diff]
024-0002-dracut-functions.sh-support-for-altern.patch
Comment 11 Amadeusz Żołnowski (RETIRED) gentoo-dev 2013-01-07 18:40:48 UTC
Thank you! I have committed dracut-024-r4. I was going to to that yesterday, but thanks to CVS being so stupid and so slow I have run out of time.

Could you test it once again, please? (It includes additional patch.)
Comment 12 Alexander Tsoy 2013-01-08 07:44:49 UTC
024-r4 works fine. Thanks.

Please remove 024-r3 from the tree. It fails to merge because patches are missing.
Comment 13 Nikoli 2013-01-08 10:45:59 UTC
Are you sure about pkgconfig in RDEPEND? When using binhost only one system has tools for building and pkgconfig is one of them. I'd prefer to not have pkgconfig installed after running 'emerge --depclean --with-bdeps=n'.

Seriously, how often is udevdir changed? Rebuilding dracut one time after upgrading udev is fine.
Comment 14 Alexander Tsoy 2013-01-08 18:25:12 UTC
See comments 4 and 5 in bug 442384. It seems udev will switch back to /lib/udev/rules.d soon. Users who use stable packages will not need to rebuild dracut. So I agree, we can remove pkgconfig from RDEPEND again. %)
Comment 15 Alexander Tsoy 2013-01-10 15:27:18 UTC
udev-197 is in the tree. It moves rules.d back to /lib/udev/rules.d.