]> git.ipfire.org Git - thirdparty/dracut.git/commit
feat(network-manager): run as daemon with D-Bus
authorBeniamino Galvani <bgalvani@redhat.com>
Fri, 26 Mar 2021 10:31:03 +0000 (11:31 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Fri, 16 Apr 2021 14:15:00 +0000 (16:15 +0200)
commit112f03f9e225a790cbc6378c70773c6af5e7ee34
treebe415cbcd39a29fd7304c3ffd54344d44c87b43d
parent6a37c6f6302f950df608db3fd45acf9342ee3de2
feat(network-manager): run as daemon with D-Bus

This commit changes how NM is started inside the initrd. Instead of running NM
in the special --configure-and-quit=initrd mode, which sets up network and
quits, start it as a daemon.

This has multiple advantages. First, we no longer need to run NM in a special
mode that requires additional code and maintenance. NetworkManager works
exactly as in the real root.

One problem of the current configure-and-quit approach is that once NM has
quit, dynamic addresses can expire if the initrd setup takes longer than the
DHCP lease interval or than the IPv6 address lifetime. Running NM as a service
solves this problem.

Now NM runs with D-Bus support and therefore its API can be used by other
modules. This open the possibility, for example, to integrate nm-cloud-setup to
automatically configure networking based on cloud metadata.

Use the NetworkManager-wait-online.service, ordered before
dracut-initqueue.service, to delay the initqueue until NM has terminated its
configuration.
modules.d/35network-manager/initrd-no-auto-default.conf [new file with mode: 0644]
modules.d/35network-manager/module-setup.sh
modules.d/35network-manager/nm-config.sh
modules.d/35network-manager/nm-initrd.service [new file with mode: 0644]
modules.d/35network-manager/nm-lib.sh
modules.d/35network-manager/nm-wait-online-initrd.service [new file with mode: 0644]