[Buildroot] [git commit branch/2026.05.x] package/network-manager: drop initrd-related services when unneeded

Titouan Christophe via buildroot <[email protected]>
Newsgroups net.busybox.buildroot
Message-ID <[email protected]>
commit: https://gitlab.com/buildroot.org/buildroot/-/commit/fde8ba3df7cd3af9d55d1a9fcfeb9a3b0adb39a4
branch: https://gitlab.com/buildroot.org/buildroot/-/tree/2026.05.x

Since NetworkManager 1.54, packaged since commit 24827ae398db
(package/network-manager: bump to 1.56.0), new services related to
running in an initrd are now installed, which prevents proper startup,
with systemd reporting that two units declare the same BusName.

When systemd is configured without initrd support, drop the
NetworkManager initrd-related services.

Fixes: 24827ae398db

Signed-off-by: Yann E. MORIN <[email protected]>
Cc: Fiona Klute <[email protected]>
Cc: Marcus Hoffmann <[email protected]>
Acked-by: TIAN Yuanhao <[email protected]>
Signed-off-by: Fiona Klute <[email protected]>
(cherry picked from commit 32bdc4710a483c3ea7b0d5a805b2a857f9a11872)
Signed-off-by: Titouan Christophe <[email protected]>
---
 package/network-manager/network-manager.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/network-manager/network-manager.mk b/package/network-manager/network-manager.mk
index 301c1ad43e..bf4f29c3cc 100644
--- a/package/network-manager/network-manager.mk
+++ b/package/network-manager/network-manager.mk
@@ -151,6 +151,12 @@ NETWORK_MANAGER_CONF_OPTS += \
 	-Dconfig_logging_backend_default=journal \
 	-Dsession_tracking=systemd \
 	-Dsuspend_resume=systemd
+ifneq ($(BR2_PACKAGE_SYSTEMD_INITRD),y)
+define NETWORK_MANAGER_CLEAN_INITRD
+	rm -f $(TARGET_DIR)/usr/lib/systemd/system/NetworkManager-*initrd.service
+endef
+NETWORK_MANAGER_POST_INSTALL_TARGET_HOOKS += NETWORK_MANAGER_CLEAN_INITRD
+endif
 else
 NETWORK_MANAGER_CONF_OPTS += \
 	-Dsystemd_journal=false \
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.