From: "Jörg Sommer" <joerg.sommer@navimatix.de>
To: openembedded-core@lists.openembedded.org,
richard.purdie@linuxfoundation.org, ross.burton@arm.com,
mathieu.dubois-briand@bootlin.com, rs@ti.com
Subject: Re: [PATCH v2] bitbake.conf: Extend distro feature usrmerge to merge bin+sbin
Date: Sat, 22 Aug 2026 09:56:11 +0200 [thread overview]
Message-ID: <aolV39x9UzHwcTrZ@navimatix.de> (raw)
In-Reply-To: <ada29b3926f0497ef35618685c298cad840f45e0.1784883539.git.joerg.sommer@navimatix.de>
[-- Attachment #1: Type: text/plain, Size: 6200 bytes --]
Jörg Sommer schrieb am Fr 24. Jul, 11:00 (+0200):
> From: Randolph Sapp <rs@ti.com>
>
> The split of bin and sbin became more artificial over time, and it is no
> longer clear why programmes goes into the one or the other directory; e.g.
> forever normal users have used sendmail in /usr/sbin, and fdisk and mkfs
> learned to operate on files to create images long ago.
Gentle ping. What's the state of this?
> Because systemd drives this movement to have only /usr/bin and symlink /bin,
> /sbin and /usr/sbin to there, the usrmerge feature (started by systemd too)
> should be extended to include the binmerge. For a system with split bin/sbin
> `systemctl status` reports the system as tainted for *unmerged-bin.*
>
> Override most sbin variables to point to their bin equivalent when
> usermerge is enabled, with the exception being base_sbindir_native and
> sbindir_native. There is no guarantee the host machine is using this
> filesystem scheme.
>
> 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>
> Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
> ---
>
> I took Randolph's version and reworked it a bit. But the idea stays the same.
>
> meta/classes-recipe/populate_sdk_base.bbclass | 2 ++
> meta/conf/bitbake.conf | 8 ++++----
> meta/recipes-core/systemd/systemd_261.1.bb | 6 +++---
> 3 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/meta/classes-recipe/populate_sdk_base.bbclass b/meta/classes-recipe/populate_sdk_base.bbclass
> index b427ff2761..c63601b1da 100644
> --- a/meta/classes-recipe/populate_sdk_base.bbclass
> +++ b/meta/classes-recipe/populate_sdk_base.bbclass
> @@ -189,6 +189,8 @@ create_merged_usr_symlinks() {
> install -d $root${base_bindir} $root${base_sbindir} $root${base_libdir}
> ln -rs $root${base_bindir} $root/bin
> ln -rs $root${base_sbindir} $root/sbin
> + # if base_sbindir == base_bindir, aka binmerge
> + test -e $root/usr/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 bdf37d0da2..18aa1441e6 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', '${base_bindir}', '${root_prefix}/sbin', d)}"
> export base_libdir = "${root_prefix}/${baselib}"
> export nonarch_base_libdir = "${root_prefix}/lib"
>
> @@ -44,7 +44,7 @@ firmwaredir = "${nonarch_base_libdir}/firmware"
>
> # Architecture dependent paths
> export bindir = "${exec_prefix}/bin"
> -export sbindir = "${exec_prefix}/sbin"
> +export sbindir = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${bindir}', '${exec_prefix}/sbin', d)}"
> export libdir = "${exec_prefix}/${baselib}"
> export libexecdir = "${exec_prefix}/libexec"
> export includedir = "${exec_prefix}/include"
> @@ -66,9 +66,9 @@ bindir_cross = "/bin"
> bindir_crossscripts = "${bindir}/crossscripts"
> prefix_nativesdk = "/usr"
> bindir_nativesdk = "${prefix_nativesdk}/bin"
> -sbindir_nativesdk = "${prefix_nativesdk}/sbin"
> +sbindir_nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${bindir_nativesdk}', '${prefix_nativesdk}/sbin', d)}"
> base_bindir_nativesdk = "/bin"
> -base_sbindir_nativesdk = "/sbin"
> +base_sbindir_nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${base_bindir_nativesdk}', '/sbin', d)}"
> includedir_nativesdk = "${prefix_nativesdk}/include"
> libdir_nativesdk = "${prefix_nativesdk}/lib"
> base_libdir_nativesdk = "/lib"
> diff --git a/meta/recipes-core/systemd/systemd_261.1.bb b/meta/recipes-core/systemd/systemd_261.1.bb
> index 0a1d4870bf..97a91ff5e2 100644
> --- a/meta/recipes-core/systemd/systemd_261.1.bb
> +++ b/meta/recipes-core/systemd/systemd_261.1.bb
> @@ -195,7 +195,6 @@ def build_epoch(d):
> PACKAGECONFIG[set-time-epoch] = "${@build_epoch(d)},-Dtime-epoch=0"
> PACKAGECONFIG[timedated] = "-Dtimedated=true,-Dtimedated=false"
> PACKAGECONFIG[timesyncd] = "-Dtimesyncd=true,-Dtimesyncd=false"
> -PACKAGECONFIG[sbinmerge] = "-Dsplit-bin=false,-Dsplit-bin=true"
> PACKAGECONFIG[userdb] = "-Duserdb=true,-Duserdb=false"
> PACKAGECONFIG[utmp] = "-Dutmp=true,-Dutmp=false"
> PACKAGECONFIG[valgrind] = "-DVALGRIND=1,,valgrind"
> @@ -226,6 +225,7 @@ EXTRA_OEMESON += "-Dnobody-user=nobody \
> -Dtranslations=${@'false' if d.getVar('USE_NLS') == 'no' else 'true'} \
> ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', '-Ddefault-mdns=no -Ddefault-llmnr=no', '', d)} \
> -Ddbus=disabled \
> + -Dsplit-bin=${@'false' if '${bindir}' == '${sbindir}' else 'true'} \
> -Dtests=false \
> -Dlibc=${TCLIBC} \
> "
> @@ -342,8 +342,8 @@ 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 old udev rules
> + test -e ${D}${base_sbindir}/udevadm || ln -s ${base_bindir}/udevadm ${D}${base_sbindir}/udevadm
>
> # install default policy for presets
> # https://www.freedesktop.org/wiki/Software/systemd/Preset/#howto
> --
> 2.53.0
>
--
Navimatix GmbH T: 03641 - 327 99 0
Tatzendpromenade 2 F: 03641 - 526 306
07745 Jena www.navimatix.de
Geschäftsführer: Steffen Späthe, Jan Rommeley
Registergericht: Amtsgericht Jena, HRB 501480
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 6684 bytes --]
next prev parent reply other threads:[~2026-08-22 7:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 9:00 [PATCH v2] bitbake.conf: Extend distro feature usrmerge to merge bin+sbin Jörg Sommer
2026-07-25 7:34 ` [OE-core] " Mathieu Dubois-Briand
2026-08-22 7:56 ` Jörg Sommer [this message]
2026-08-22 12:16 ` Mathieu Dubois-Briand
2026-08-22 14:09 ` Jörg Sommer
2026-08-24 6:30 ` Mathieu Dubois-Briand
2026-08-24 9:53 ` Jörg Sommer
2026-08-24 10:02 ` Mathieu Dubois-Briand
2026-08-24 12:43 ` Jörg Sommer
2026-08-24 13:10 ` Mathieu Dubois-Briand
2026-08-24 12:48 ` [PATCH v3] " Jörg Sommer
2026-08-24 13:11 ` [OE-core] " Marko, Peter
2026-08-24 15:17 ` joerg.sommer
2026-08-24 16:18 ` Marko, Peter
2026-08-24 17:10 ` Richard Purdie
2026-08-25 7:33 ` Mathieu Dubois-Briand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aolV39x9UzHwcTrZ@navimatix.de \
--to=joerg.sommer@navimatix.de \
--cc=mathieu.dubois-briand@bootlin.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=richard.purdie@linuxfoundation.org \
--cc=ross.burton@arm.com \
--cc=rs@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.