* dracut: fails to copy udev rules to initramfs
@ 2016-01-09 0:08 Jan Engelhardt
[not found] ` <alpine.LSU.2.20.1601090036500.20214-Og55a6x16tXH9RFtKMg/Ng@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Jan Engelhardt @ 2016-01-09 0:08 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA
dracut 044 (and prior versions) only copy a handful of .rules files to
the initramfs, the exact list of which is in
/usr/lib/dracut/modules.d/95udev-rules/module-setup.sh. Copying only
half of the files leads to a problem with regard to object naming
in certain systems.
Suppose there is a deliberately-placed file
/etc/udev/rules.d/70-net.rules with:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
ATTR{address}=="52:54:00:12:34:56", ATTR{type}=="1", KERNEL=="eth*",
NAME="ex7"
(52:.. substituted as appropriate per system)
In case of a Thinkpad system (happens to have dracut 037):
* the e1000e.ko module is not copied to the initramfs
* e1000e.ko gets loaded after switching to real root
* in the real root, 70-net.rules is available and processed.
=> ex7 name
In case of a QEMU system (with dracut 044):
* the virtio_net.ko module is copied to the initramfs
* virtio_net.ko gets loaded by initramfs udev
* no 70-net.rules inside initramfs, default net_id naming comes in.
=> ens3 name
Why is dracut copying virtio_net.ko? I have no idea, it does not tell by
default. Keeping in mind that there are also scenarios with root-on-NFS
and such, the presence of NIC modules inside initramfs has to be taken
into account, and with that, this leads me to lean in the direction that
dracut ought to copy all .rules files, in particular those from /etc.
Counterarguments?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: dracut: fails to copy udev rules to initramfs
[not found] ` <alpine.LSU.2.20.1601090036500.20214-Og55a6x16tXH9RFtKMg/Ng@public.gmane.org>
@ 2016-01-11 10:11 ` Fabian Vogt
0 siblings, 0 replies; 2+ messages in thread
From: Fabian Vogt @ 2016-01-11 10:11 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA
Jan Engelhardt wrote:
> dracut 044 (and prior versions) only copy a handful of .rules files to
> the initramfs, the exact list of which is in
> /usr/lib/dracut/modules.d/95udev-rules/module-setup.sh. Copying only
> half of the files leads to a problem with regard to object naming
> in certain systems.
>
>
> Suppose there is a deliberately-placed file
> /etc/udev/rules.d/70-net.rules with:
>
> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
> ATTR{address}=="52:54:00:12:34:56", ATTR{type}=="1", KERNEL=="eth*",
> NAME="ex7"
>
> (52:.. substituted as appropriate per system)
>
> In case of a Thinkpad system (happens to have dracut 037):
> * the e1000e.ko module is not copied to the initramfs
> * e1000e.ko gets loaded after switching to real root
> * in the real root, 70-net.rules is available and processed.
> => ex7 name
>
> In case of a QEMU system (with dracut 044):
> * the virtio_net.ko module is copied to the initramfs
> * virtio_net.ko gets loaded by initramfs udev
> * no 70-net.rules inside initramfs, default net_id naming comes in.
> => ens3 name
>
> Why is dracut copying virtio_net.ko? I have no idea, it does not tell by
> default.
Seems to be a bug, 90qemu-net should be treated
the same as 90kernel-network-modules or even merged into it.
> Keeping in mind that there are also scenarios with root-on-NFS
> and such, the presence of NIC modules inside initramfs has to be taken
> into account, and with that, this leads me to lean in the direction that
> dracut ought to copy all .rules files, in particular those from /etc.
>
> Counterarguments?
That would fix
# Fixme: would be nice if we didn't have to guess, which rules to grab....
# ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies
# of the rules we want so that we just copy those in would be best
from 95udev-rules/module-setup.sh.
I see an issue though, what if a udev rule references an external file?
I'd say that adding a parameter to dracut.conf(.d) or the addition of a symlink
dir like the #Fixme mentions is the best option.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-11 10:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-09 0:08 dracut: fails to copy udev rules to initramfs Jan Engelhardt
[not found] ` <alpine.LSU.2.20.1601090036500.20214-Og55a6x16tXH9RFtKMg/Ng@public.gmane.org>
2016-01-11 10:11 ` Fabian Vogt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox