Dracut NM module
Andrei Borzenkov
arvidjaar at gmail.com
Mon Sep 16 13:24:58 UTC 2024
On Mon, Sep 16, 2024 at 3:48 PM Thomas HUMMEL <thomas.hummel at pasteur.fr> wrote:
>
> Hello,
>
> looking at how the NetworkManager Dracut module is used (RHEL 8.8 -
> NetworkManager-1.40.16, dracut-049-223) my understanding is that it
> operates at 2 different dracut stages/hooks with 2 different binaries :
>
> 1. cmline: creates profiles with nm-initrd-generator (using some kernel
> cmdline like for instance BOOTIF=
>
> 2. initqueue/settled: activates profiles (and quits) with NetworkManager
> --configure-and-quit
>
> I was wondering why it could or should not activate profiles in 1.
At this point nothing is yet set up. Kernel modules are not loaded,
devices are not probed etc.
> If it has something to do with udevd renaming devices, how do generated
> profiles keep up with the renaming anyway ?
>
It is your responsibility to provide kernel parameters that make sense
for your environment.
> Besides, is NM dracut module mutually exclusive with legacy one and how
Normally modules that need networking are supposed to depend on the
network which will pick up the backend in order of preference (it will
prefer NetwoekManager if available). If you explicitly added a
networking backend already, the network module will respect it.
So, in normal cases only one backend will be present.
> to actually know which one is inside an already generated third party
> initialramfs (of course I know how to extract content) ?
>
Then I suppose you know that lsinitrd displays the list of modules
included in initrd.
> For instance, I've encountered an initialramfs which succeeds in having
> network configured but without any args which would make
> nm-initrd-generator create a profile, so I just assumed legacy module
> was at play but this is was just a guess.
>
> Finally, how does NM, which my undestanding is the main purpose of using
> this module in dracut, passes info from intiralramfs to real root ? I'm
Generated connection profiles are stored in /run and so should survive
switching to the real root.
> not sure d-bus is on in dracut neither if nm module writes some files to
> real root device ?
>
D-Bus is there, but it is stopped before switching to root.
More information about the Networkmanager
mailing list