From patchwork Mon Aug 24 12:48:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "joerg.sommer@navimatix.de" X-Patchwork-Id: 96159 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0B1FC5DF94 for ; Mon, 24 Aug 2026 12:48:34 +0000 (UTC) Received: from AM0PR83CU005.outbound.protection.outlook.com (AM0PR83CU005.outbound.protection.outlook.com [52.101.69.112]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.15703.1787575711088794152 for ; Mon, 24 Aug 2026 05:48:31 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@navimatix.de header.s=selector1 header.b=x0dsresl; spf=pass (domain: navimatix.de, ip: 52.101.69.112, mailfrom: joerg.sommer@navimatix.de) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vc/yYiwe8/pznO8N08Vb02mhifAFzFKcYH+bJoRmDQNqcCsdy6YLK+mPLkjNFXVUXz4unwYpc97sZJlyQv+M0jt3Z76l0mTtHeYJNLFjWqJi4mD8TnPyUieNvTDRRGhhcijtOB47wgoGUopaSOvPdMpPd6W9Rr0jdN4ABsCB0PgEP7GZ5XB/BcQEvek42qEOWl34+g8BspYHypCZHIhrLH5EBg868HitqOY+9gPnHmgJCmAPlUqZl2Hn9lh8c+t9p2dQ3F+WiQyL+VDvzJlkT7AkrH2H17OpyKkoMwZjDFJK/V+8fq4oH9KLC10BH/Q+z/4SMCpyOEwD80azoVRLwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ebxZjeKG++InFPYMBnUrLB6mFKpn5fR3E0ALmGbFnns=; b=PtuAbhkRv390th55DsULP8ey+hnoZZTxXyLnv2Z2UMM5iIFKMzevob1xtNSTd0xmMg7AxIJlyyn834dBZ7qy5uFecHr8UmRi/HQQR3UD5DHVrXItCASomLxy3eehXrc6Y4HWJ6eGglAUvfWLudqej3tzxwTEUdY9uynrUUdArwuJGB178FULZrt0QHQgexFo95Y5Ehxxxwn9oRZVfovySaj+qNl6kYZUMhpcbuqvPZsv7bO9duc9t5SL7Le+/ulQ7s5qWQt3tC+SWgbBIPUhms+S8umJt3+o2GKlc0cPZsNIMqtHcJWhThbSHig8uiyT5B9LptEu23VRzJ5GWJ8SvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=navimatix.de; dmarc=pass action=none header.from=navimatix.de; dkim=pass header.d=navimatix.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=navimatix.de; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ebxZjeKG++InFPYMBnUrLB6mFKpn5fR3E0ALmGbFnns=; b=x0dsreslkXMy5bGnWDFnSfa3OsEuue9TawFFoCUqJxMnJtCDzKX3MqY/rVtrg6eSe+RM09ENnwfejpsALKv+85dGRfAq7A10tS3fqv59KvP08b3CNHmCGuMexDx6XzqVYzz01Ti5WqHBHz+xzeKqM4FNV757eXctleKUaLw6jtg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=navimatix.de; Received: from GV2PR01MB11835.eurprd01.prod.exchangelabs.com (2603:10a6:150:2cb::8) by AM8PR01MB7569.eurprd01.prod.exchangelabs.com (2603:10a6:20b:241::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.339.12; Mon, 24 Aug 2026 12:48:25 +0000 Received: from GV2PR01MB11835.eurprd01.prod.exchangelabs.com ([fe80::d5c3:2dea:3d98:25fd]) by GV2PR01MB11835.eurprd01.prod.exchangelabs.com ([fe80::d5c3:2dea:3d98:25fd%6]) with mapi id 15.21.0339.012; Mon, 24 Aug 2026 12:48:25 +0000 Date: Mon, 24 Aug 2026 14:48:23 +0200 From: =?utf-8?b?SsO2cmc=?= Sommer To: openembedded-core@lists.openembedded.org, mathieu.dubois-briand@bootlin.com, rs@ti.com, joerg.sommer@navimatix.de CC: mathieu.dubois-briand@bootlin.com, Randolph Sapp , =?utf-8?b?SsO2cmc=?= Sommer Subject: [PATCH v3] bitbake.conf: Extend distro feature usrmerge to merge bin+sbin Message-ID: <5fff22004037096d27276023cf29c473c8c8ce85.1787575546.git.joerg.sommer@navimatix.de> X-Mailer: git-send-email 2.53.0 References: Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: BE1P281CA0173.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:66::18) To GV2PR01MB11835.eurprd01.prod.exchangelabs.com (2603:10a6:150:2cb::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV2PR01MB11835:EE_|AM8PR01MB7569:EE_ X-MS-Office365-Filtering-Correlation-Id: 4df0abff-9f39-4f09-5915-08df01ddfca5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|376014|366016|1800799024|10067099003|56012099006|3023799007|18002099003|22082099003; X-Microsoft-Antispam-Message-Info: iLNs7Tqm+65AIoGQcCJq8xHt4X/zF8JFIGOG9xirh0RQ2YTWC3b3VIlKHwn8n1/lgAoKD8eqhvz0w3rTD1Fc9vu/KZ40VpH3w3QDaDaXDOFXZFUAkngTuFoDeUgO3wqmYHGRhjxeqVdhkBoJzyD3B7y1F2YOrsn+29dv3hXt64XizPAQ3KkNeIXXUm1CT2oZJtmo3DgHcsQtAT9WAuzMLZQgxYSXiKR/I1Pgw8K682TkwQ5pdDKYvq223g8My3dc5YQW1TFXktHO3QbvCRgPowbst5yjKRxghSwkTkce6ssX3s+Ia5CL8HvRtSnlV+iBNgoeJnc63kc9+Xi0b8Xh8em2nCAV6tojtvVgzGJmLcDlaWtDYgXfJNVLyPkHfnj5mX2yqQyHYiUby3cmY0sPsgArBfmdl3zyP7qAPspFfT5Ee2bF0WF4tyWyLg/UqCbscxLUzEh9rWBk6hChAgYwv1Sv4mIQRCazimmsazxPd1cfCqKUxDtL4qeQLnX7k4VfJRcRXczfI7AjgXYyCRack9P+PptMXtLluU/xOC5pMktHz8tmgUA+3zOSyPri47kSj/v7gFAmGOQqemPhfz4/uwvq9mXbVRWnFimFA5/Pb20= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV2PR01MB11835.eurprd01.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(366016)(1800799024)(10067099003)(56012099006)(3023799007)(18002099003)(22082099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: u4Wkx5Nk3LCmhjqdCUEdKjpb68MboHBgfG/jvKg+2BviZeBRAjk0Z4ZtvjnutfUM3RkTArBgYN39pTtfxu+vkwLf9fy+XTmQ4BWvzX+hg2mwzwu6uAB2yP4hBmUU2aHjwDVKg18w0FiwZe8HmqHB//INLdoolGgkqQd5xmH4Q7UVBR5+wzwgZoaOrhr5WYwZ65Tra/gOaY55ahGTOjUvquBR9Axn4qUUAN3ewBuWL5DwnKXIS24+oKmZd2R2NyhQ21PJBpZ1atEioturuMuSOdThL3vyh+j8JprB5ytmKs32j2jT6xwcZ3tJ2y+2cstYIUQXj15AuEpaJOiBymp/Rj9sSxNy1DCxkioYEQxgJspfSWAxJY8jhnho2lVVzuA00A2rQ6YZ6Tls84hw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lR/CqeEwCAJeHhCMMh4dEicj1e2PMhEUKojhIy1eT+37r6nOposWnbopf/VB+aI1DX0v5wSe8Dg+acyf/JxAijGXdAaWbtYOOHIXQjvaWWYFzrOJ65LWuThmZLgUFkxZE/fxmv1HdtOFtxHZMCZSIu7DQLBev7gyRrr+gKtZbxkPjYDuGG9DJ1GJ2VWkirHLn5TSA6RbckNxLgCV+ukQr9RYqWW14Q0ErdI21b5j4Sx0bUdZkWadCpAuZhoWZRJjtpx4NCWkvlLU/ycQ6E1gDloqx0TsHtQw= X-OriginatorOrg: navimatix.de X-MS-Exchange-CrossTenant-Network-Message-Id: 4df0abff-9f39-4f09-5915-08df01ddfca5 X-MS-Exchange-CrossTenant-AuthSource: GV2PR01MB11835.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2026 12:48:25.2788 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: c87b4f54-b992-4813-8f3f-4a876324197f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pMjJO9mpjRxfhQFJc/xc+UFg7kr0SgqnrT6Ad1ElknxUrlcn0bMhCGLe2ENnatbpzOTGSqaMBd71nad9A9co6M4wlqNKyZAk/q9hLHWBGMU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR01MB7569 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 24 Aug 2026 12:48:34 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/244095 From: Randolph Sapp 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. 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 Signed-off-by: Jörg Sommer --- Changes in v3: * rebase on systemd 261.2 Changes in v2: * I took Randolph's version and reworked it a bit. But the idea stays the same. Reference to v1: * https://lists.openembedded.org/g/openembedded-core/message/234858 meta/classes-recipe/populate_sdk_base.bbclass | 2 ++ meta/conf/bitbake.conf | 8 ++++---- meta/recipes-core/systemd/systemd_261.2.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 f32e9add01..f9367d0d17 100644 --- a/meta/classes-recipe/populate_sdk_base.bbclass +++ b/meta/classes-recipe/populate_sdk_base.bbclass @@ -188,6 +188,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 41e98ce629..a6833f98de 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.2.bb b/meta/recipes-core/systemd/systemd_261.2.bb index 8237b040a5..4475fb2514 100644 --- a/meta/recipes-core/systemd/systemd_261.2.bb +++ b/meta/recipes-core/systemd/systemd_261.2.bb @@ -196,7 +196,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" @@ -227,6 +226,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} \ " @@ -343,8 +343,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