public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [oe-core][PATCH] systemd: fix unmerged-bin tainted message
@ 2026-04-08 19:50 rs
  2026-04-08 21:58 ` Richard Purdie
  2026-04-09  4:30 ` Jörg Sommer
  0 siblings, 2 replies; 6+ messages in thread
From: rs @ 2026-04-08 19:50 UTC (permalink / raw)
  To: richard.purdie, ross.burton, mathieu.dubois-briand; +Cc: openembedded-core

From: Randolph Sapp <rs@ti.com>

Systemd prefers both /bin and /sbin to link to /usr/bin. If this is not
the case it reports that the system is tainted in systemctl status.

Add a link from /usr/sbin to /usr/bin to prevent anything from being
excluded from the merged bin directory. This mimics the current merged
bin directory structure of Arch Linux [1].

Update the systemd recipe to prevent creating a duplicate link when
sbinmerge is enabled.

This check was added to systemd back in 2024 [2].

[1] https://gitlab.archlinux.org/archlinux/packaging/packages/filesystem/-/blob/main/PKGBUILD
[2] https://github.com/systemd/systemd/commit/844863c61e7b501097da84a1e4d1e4a6aa6d9f0d

Signed-off-by: Randolph Sapp <rs@ti.com>
---

I feel like this is overloading the "usrmerge" distro feature somewhat. On the
other hand, this parameter was added for systemd support, and systemd considers
all of this to result in an unmerged-bin warning. I figure it's kind of fine.

Open to opinions here, as we could also just add a "sbinmerge" distro feature.
Then again, what would be the expected behavior when usrmerge is disabled? Would
/usr/sbin just point to /usr/bin and /sbin to /bin then?

 meta/classes-recipe/populate_sdk_base.bbclass | 5 +++--
 meta/conf/bitbake.conf                        | 2 +-
 meta/recipes-core/systemd/systemd_259.5.bb    | 8 ++++++--
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/meta/classes-recipe/populate_sdk_base.bbclass b/meta/classes-recipe/populate_sdk_base.bbclass
index b427ff2761..15f393a3bb 100644
--- a/meta/classes-recipe/populate_sdk_base.bbclass
+++ b/meta/classes-recipe/populate_sdk_base.bbclass
@@ -186,9 +186,10 @@ POPULATE_SDK_POST_HOST_COMMAND:append:task-populate-sdk = " write_host_sdk_manif
 # Prepare the root links to point to the /usr counterparts.
 create_merged_usr_symlinks() {
     root="$1"
-    install -d $root${base_bindir} $root${base_sbindir} $root${base_libdir}
+    install -d $root${base_bindir} $root${base_libdir}
     ln -rs $root${base_bindir} $root/bin
-    ln -rs $root${base_sbindir} $root/sbin
+    ln -rs $root${base_bindir} $root/sbin
+    ln -rs $root${base_bindir} $root/usr/sbin
     ln -rs $root${base_libdir} $root/${baselib}
 
     if [ "${nonarch_base_libdir}" != "${base_libdir}" ]; then
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 84450386d9..29301534d2 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -22,7 +22,7 @@ root_prefix = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefi
 
 # Base paths
 export base_bindir = "${root_prefix}/bin"
-export base_sbindir = "${root_prefix}/sbin"
+export base_sbindir = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${root_prefix}/bin', '${root_prefix}/sbin', d)}"
 export base_libdir = "${root_prefix}/${baselib}"
 export nonarch_base_libdir = "${root_prefix}/lib"
 
diff --git a/meta/recipes-core/systemd/systemd_259.5.bb b/meta/recipes-core/systemd/systemd_259.5.bb
index c3cb605b4d..d84e38d7cd 100644
--- a/meta/recipes-core/systemd/systemd_259.5.bb
+++ b/meta/recipes-core/systemd/systemd_259.5.bb
@@ -69,6 +69,7 @@ PACKAGECONFIG ??= " \
     quotacheck \
     randomseed \
     resolved \
+    sbinmerge \
     serial-getty-generator \
     set-time-epoch \
     sysusers \
@@ -339,8 +340,11 @@ do_install() {
 		install -m 0644 ${UNPACKDIR}/org.freedesktop.hostname1_no_polkit.conf ${D}${datadir}/dbus-1/system.d/
 	fi
 
-	# create link for existing udev rules
-	ln -s ${base_bindir}/udevadm ${D}${base_sbindir}/udevadm
+	# create link for existing udev rules if sbinmerge is not enabled
+	if ${@bb.utils.contains('PACKAGECONFIG', 'sbinmerge', 'false', 'true', d)}
+	then
+		ln -s ${base_bindir}/udevadm ${D}${base_sbindir}/udevadm
+	fi
 
 	# install default policy for presets
 	# https://www.freedesktop.org/wiki/Software/systemd/Preset/#howto
-- 
2.53.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-04-09 18:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-08 19:50 [oe-core][PATCH] systemd: fix unmerged-bin tainted message rs
2026-04-08 21:58 ` Richard Purdie
2026-04-09  4:30 ` Jörg Sommer
2026-04-09  7:49   ` Peter Kjellerstedt
2026-04-09 18:18     ` Randolph Sapp
     [not found]     ` <18A4C3228BFBCFA6.777565@lists.openembedded.org>
2026-04-09 18:43       ` Randolph Sapp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox