diff mbox series

[meta-oe] networkmanager: Do not ship initrd specific services into rootfs

Message ID 20260408091740.460406-1-zhixiong.chi@windriver.com
State New
Headers show
Series [meta-oe] networkmanager: Do not ship initrd specific services into rootfs | expand

Commit Message

Zhixiong Chi April 8, 2026, 9:17 a.m. UTC
Those systemd services were added in 1.54 upstream
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2089

According the comments we can see they are meant for the inird
other than using for rootfs. They will conflict with the main
services and can lead to potentially confusing error messages.
So remove them for now to avoid the following issue.

>$systemd-analyze --man=false verify \
> /lib/systemd/system/NetworkManager-wait-online-initrd.service
  Failed to put bus name to hashmap: File exists
  NetworkManager-initrd.service: Two services allocated for the \
  same bus name org.freedesktop.NetworkManager, refusing operation.

Test:
PASS: bitbake core-image-minimal
PASS: runqemu qemux86-64
PASS: systemd-analyze --man=false verify \
      /lib/systemd/system/NetworkManager.service

Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
---
 .../networkmanager/networkmanager_1.56.0.bb                  | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.56.0.bb b/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.56.0.bb
index f9fc9f3966..b04ad90738 100644
--- a/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.56.0.bb
+++ b/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.56.0.bb
@@ -311,4 +311,9 @@  do_install:append() {
     if ${@bb.utils.contains('PACKAGECONFIG','dhcpcd','true','false',d)}; then
         install -Dm 0644 ${UNPACKDIR}/enable-dhcpcd.conf ${D}${nonarch_libdir}/NetworkManager/conf.d/enable-dhcpcd.conf
     fi
+
+    # Don't ship initrd specific services into rootfs to avoid the conflict with the main services
+    rm -f ${D}${systemd_system_unitdir}/NetworkManager-config-initrd.service
+    rm -f ${D}${systemd_system_unitdir}/NetworkManager-initrd.service
+    rm -f ${D}${systemd_system_unitdir}/NetworkManager-wait-online-initrd.service
 }