From patchwork Mon Apr 6 22:10:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AdrianF X-Patchwork-Id: 85371 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 C6736FB5179 for ; Mon, 6 Apr 2026 22:12:03 +0000 (UTC) Received: from mta-65-225.siemens.flowmailer.net (mta-65-225.siemens.flowmailer.net [185.136.65.225]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.66608.1775513516591672510 for ; Mon, 06 Apr 2026 15:11:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=adrian.freihofer@siemens.com header.s=fm2 header.b=k0WJHsz6; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.225, mailfrom: fm-1329275-20260406221153db7d90206a0002073d-c2i17x@rts-flowmailer.siemens.com) Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 20260406221153db7d90206a0002073d for ; Tue, 07 Apr 2026 00:11:53 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=adrian.freihofer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=sxTaJ8WdaPLxaV4Ps/RE+WiZsrELO/6TTVIVshJZSI0=; b=k0WJHsz67NQk6RcUlJQlk8AcBlZJMvgEgggDhBtTR0WkMD9UJwEgq3Cq30morVz0mNj95G QTOkeIYi9+g1Rkgb0Y9RcWPA/wI2IgysqMvfbOiWcV50HiuOiMRvU/nfBK/fJ95+ELG1LMaK vT+GkeEs2lWvwUfR58Xeljv5EqYFIoIf5ViWAZHYJl4AweOE3Vw6JNshM4dYnX/aSw/mqtT0 GafMN7Yhl7SlPPtDk70N5lwTIEj2RzJlAkcHY2Mtqy+wjjODNaCNGCmkD8aHKARDMys1zVSt vlFZHYw6yC78tSe3pcDHqXIXK9UORKbazJuLcp6gGX7rIJEtOq6i4aRw==; From: AdrianF To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 1/6] devtool/deploy: warn when deploying a recipe with dynamic UID/GID Date: Tue, 7 Apr 2026 00:10:28 +0200 Message-ID: <20260406221133.2769152-2-adrian.freihofer@siemens.com> In-Reply-To: <20260406221133.2769152-1-adrian.freihofer@siemens.com> References: <20260406221133.2769152-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1329275:519-21489:flowmailer 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, 06 Apr 2026 22:12:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/234687 From: Adrian Freihofer When a recipe inherits useradd.bbclass but does not use useradd-staticids, pseudo assigns arbitrary UID/GID values during the build. Package preinst scripts normally handle this by running useradd/groupadd on the target and then chowning the installed files to the correct IDs. devtool deploy-target skips those preinst scripts, so any deployed files that have non-root ownership will land on the target with the wrong ownership, silently. Add a warning to deploy() that fires when USERADD_PACKAGES is set and 'useradd-staticids' is absent from USERADDEXTENSION. The warning names the affected users and groups to make it actionable. Signed-off-by: Adrian Freihofer --- scripts/lib/devtool/deploy.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/scripts/lib/devtool/deploy.py b/scripts/lib/devtool/deploy.py index 270e9104b2..7866cfbaae 100644 --- a/scripts/lib/devtool/deploy.py +++ b/scripts/lib/devtool/deploy.py @@ -157,6 +157,38 @@ def deploy(args, config, basepath, workspace): max_process = oe.utils.get_bb_number_threads(rd) fakerootcmd = rd.getVar('FAKEROOTCMD') fakerootenv = rd.getVar('FAKEROOTENV') + + # Warn if the recipe creates users/groups without static IDs. + # Without useradd-staticids, pseudo assigns arbitrary UIDs/GIDs during + # the build. The target preinst scripts would normally re-create them + # with correct IDs and chown the files, but devtool deploy-target skips + # those scripts, so deployed files will have the wrong ownership. + useradd_packages = rd.getVar('USERADD_PACKAGES') or '' + if useradd_packages: + useraddextension = (rd.getVar('USERADDEXTENSION') or '').split() + if 'useradd-staticids' not in useraddextension: + users = set() + groups = set() + for pkg in useradd_packages.split(): + for param in (rd.getVar('USERADD_PARAM:%s' % pkg) or '').split(';'): + param = param.strip().split() + if param: + users.add(param[-1]) + for param in (rd.getVar('GROUPADD_PARAM:%s' % pkg) or '').split(';'): + param = param.strip().split() + if param: + groups.add(param[-1]) + if users or groups: + items = [] + if users: + items.append('users: %s' % ', '.join(sorted(users))) + if groups: + items.append('groups: %s' % ', '.join(sorted(groups))) + logger.warning('Recipe %s creates %s without static UID/GID ' + 'assignments (USERADDEXTENSION does not include ' + '"useradd-staticids"). Deployed files may have ' + 'incorrect ownership on the target.' + % (args.recipename, ' and '.join(items))) finally: tinfoil.shutdown() From patchwork Mon Apr 6 22:10:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AdrianF X-Patchwork-Id: 85370 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 B95CEFB5177 for ; Mon, 6 Apr 2026 22:12:03 +0000 (UTC) Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net [185.136.65.227]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.66610.1775513516591743621 for ; Mon, 06 Apr 2026 15:11:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=adrian.freihofer@siemens.com header.s=fm2 header.b=UsmgMS6W; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.227, mailfrom: fm-1329275-202604062211537d2e2f321200020765-sfsqp3@rts-flowmailer.siemens.com) Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 202604062211537d2e2f321200020765 for ; Tue, 07 Apr 2026 00:11:54 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=adrian.freihofer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=PA/gKoxstrdCkK4pkvM2pRAulHSwohCk8obtB87bgZ4=; b=UsmgMS6WrkbvgnN/BfHDQEWEsWZQkdseIgozXpFMsiI+95i22hIkLi/O1+F7q6Dqb+TtPj YF+BcUB5DkcGWeNWHPjaVmz24ovyEPu+UBgSZeVVgoeDsOViJFjBWN1bL2fI+C92JX7SEF7d qXtlbpjlL6TwsEmBlpr6TG/KJ1Kanj5zN7tpQ8/qwg4o5nGiMlIUlpvGQXHwj+ovvG1gYlJ6 wIPwKo7akR2bhjTDky4wzyOVB4cxHIbPOqwykYb1TPjdjWX4BJXNqrgxj1XXHGQzgLO7rcHN BJyYKGlniIw5FRO0echBWh5Uw+lKZPTcePxDeHdzGLOUa5X7fLpj/Hmg==; From: AdrianF To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 2/6] oe-selftest: devtool: use stat for reading user/group names in ide-sdk tests Date: Tue, 7 Apr 2026 00:10:29 +0200 Message-ID: <20260406221133.2769152-3-adrian.freihofer@siemens.com> In-Reply-To: <20260406221133.2769152-1-adrian.freihofer@siemens.com> References: <20260406221133.2769152-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1329275:519-21489:flowmailer 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, 06 Apr 2026 22:12:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/234693 From: Adrian Freihofer On some systems, ls truncates long user and group names, which causes the ownership check to fail. For example: AssertionError: Regex didn't match: '^-.+ cmake-example cmake-example .+ /etc/cmake\\-example\\.conf$' not found in '-rw-r--r-- 1 cmake-ex cmake-ex 83 Mar 9 2018 /etc/cmake-example.conf' Use "stat -c '%U %G'" instead, which always returns the full user and group names regardless of terminal width or system configuration. Signed-off-by: Adrian Freihofer # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # Date: Mon Mar 2 23:32:13 2026 +0100 # # interactive rebase in progress; onto c1fb515f2a # Last commands done (3 commands done): # pick 08cf9a6fc0 # Revert "devtool: ide-sdk deploy-target without bitbake" # reword 2ab466cf23 # oe-selftest: devtool: use stat for reading user names in ide-sdk tests # Next commands to do (3 remaining commands): # reword 81562bd21a # oe-selftest/cpp-example: fix conf file ownership with static UIDs/GIDs # reword 1f6fd56a04 # oe-selftest: devtool: GDB breakpoint after std::vector is constructed # You are currently editing a commit while rebasing branch 'adrianf/ide-sdk-improvements' on 'c1fb515f2a'. # # Changes to be committed: # modified: meta/lib/oeqa/selftest/cases/devtool.py # # ------------------------ >8 ------------------------ # Do not modify or remove the line above. # Everything below it will be ignored. diff --git c/meta/lib/oeqa/selftest/cases/devtool.py i/meta/lib/oeqa/selftest/cases/devtool.py index 5f25c4803b..9d8ffcc786 100644 --- c/meta/lib/oeqa/selftest/cases/devtool.py +++ i/meta/lib/oeqa/selftest/cases/devtool.py @@ -2934,11 +2934,14 @@ class DevtoolIdeSdkTests(DevtoolBase): def _verify_conf_file(self, qemu, conf_file, owner, group): """Helper to verify a configuration file is owned by the proper user and group""" - ls_cmd = "ls -l %s" % conf_file - status, output = qemu.run(ls_cmd) - self.assertEqual(status, 0, msg="Failed to ls %s: %s" % (conf_file, output)) - self.assertRegex(output, rf"^-.+ {owner} {group} .+ {re.escape(conf_file)}$", - msg="%s not owned by %s:%s: %s" % (conf_file, owner, group, output)) + stat_cmd = "stat -c '%%U %%G' %s" % conf_file + status, output = qemu.run(stat_cmd) + self.assertEqual(status, 0, msg="Failed to stat %s: %s" % (conf_file, output)) + actual_owner, actual_group = output.strip().split() + self.assertEqual(actual_owner, owner, + msg="%s not owned by user %s: got %s" % (conf_file, owner, actual_owner)) + self.assertEqual(actual_group, group, + msg="%s not owned by group %s: got %s" % (conf_file, group, actual_group)) @OETestTag("runqemu") def test_devtool_ide_sdk_none_qemu(self): Signed-off-by: Adrian Freihofer --- meta/lib/oeqa/selftest/cases/devtool.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 5f25c4803b..9d8ffcc786 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -2934,11 +2934,14 @@ class DevtoolIdeSdkTests(DevtoolBase): def _verify_conf_file(self, qemu, conf_file, owner, group): """Helper to verify a configuration file is owned by the proper user and group""" - ls_cmd = "ls -l %s" % conf_file - status, output = qemu.run(ls_cmd) - self.assertEqual(status, 0, msg="Failed to ls %s: %s" % (conf_file, output)) - self.assertRegex(output, rf"^-.+ {owner} {group} .+ {re.escape(conf_file)}$", - msg="%s not owned by %s:%s: %s" % (conf_file, owner, group, output)) + stat_cmd = "stat -c '%%U %%G' %s" % conf_file + status, output = qemu.run(stat_cmd) + self.assertEqual(status, 0, msg="Failed to stat %s: %s" % (conf_file, output)) + actual_owner, actual_group = output.strip().split() + self.assertEqual(actual_owner, owner, + msg="%s not owned by user %s: got %s" % (conf_file, owner, actual_owner)) + self.assertEqual(actual_group, group, + msg="%s not owned by group %s: got %s" % (conf_file, group, actual_group)) @OETestTag("runqemu") def test_devtool_ide_sdk_none_qemu(self): From patchwork Mon Apr 6 22:10:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AdrianF X-Patchwork-Id: 85369 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 6A995FB5175 for ; Mon, 6 Apr 2026 22:12:03 +0000 (UTC) Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net [185.136.64.228]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.66607.1775513516591621009 for ; Mon, 06 Apr 2026 15:11:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=adrian.freihofer@siemens.com header.s=fm2 header.b=cbeifGR5; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.228, mailfrom: fm-1329275-20260406221153cda5a852a100020760-glqycr@rts-flowmailer.siemens.com) Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 20260406221153cda5a852a100020760 for ; Tue, 07 Apr 2026 00:11:54 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=adrian.freihofer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=IL6pWSrSkB7eUOwiByHTaIEidz0YIwg8zyFUkkzrP/o=; b=cbeifGR5gcb1ZZB//kiu5/O0wH4TUsEU/xbpG9ZPMBUZuYqKb6KyEmUOdWxosH8GW4u/cs 0WER/z6qfr2zAb7VB78YCjUMmKShVLnkq0J6sAapnSltnHBvrvvjjnHaae+QPU98lgGuIyzR j6WA7+ck5t/+gNpdU5fYJjgwlJc7WqV9VqIgPFKNcL3qI5EafDVMPqx8LTVHkU8tHZTWWTu7 vmQV8tuwv7Z9+1GUJ/0Gs6SqXp/AyOynU+nVsdo30f79A+8mefcv/ctDKzjlTXYuj+1S+yfk VktPI/7J89AWs96B8L00uiJxnamB6l6ViCaA/FZeHvg0OkXoUtQsuWQg==; From: AdrianF To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 3/6] oe-selftest: devtool: GDB breakpoint after std::vector is constructed Date: Tue, 7 Apr 2026 00:10:30 +0200 Message-ID: <20260406221133.2769152-4-adrian.freihofer@siemens.com> In-Reply-To: <20260406221133.2769152-1-adrian.freihofer@siemens.com> References: <20260406221133.2769152-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1329275:519-21489:flowmailer 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, 06 Apr 2026 22:12:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/234690 From: Adrian Freihofer Change the GDB breakpoint from line 55 to 56 in cpp-example.cpp so that the std::vector constructor has already executed when GDB stops. This ensures that inspecting the vector with GDB works as intended also with older GDB versions (e.g. on scarthgap). Signed-off-by: Adrian Freihofer --- meta/lib/oeqa/selftest/cases/devtool.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 9d8ffcc786..297dda7457 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -2772,7 +2772,9 @@ class DevtoolIdeSdkTests(DevtoolBase): # check if resolving std::vector works with python scripts gdb_batch_cmd += " -ex 'list cpp-example.cpp:55,55'" - gdb_batch_cmd += " -ex 'break cpp-example.cpp:55'" + # Break on line 56 (the std::cout after the declaration) so the vector + # constructor on line 55 has already run when GDB stops. + gdb_batch_cmd += " -ex 'break cpp-example.cpp:56'" gdb_batch_cmd += " -ex 'continue'" gdb_batch_cmd += " -ex 'print numbers'" gdb_batch_cmd += " -ex 'continue'" From patchwork Mon Apr 6 22:10:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AdrianF X-Patchwork-Id: 85368 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 ACA81FB5171 for ; Mon, 6 Apr 2026 22:12:02 +0000 (UTC) Received: from mta-65-225.siemens.flowmailer.net (mta-65-225.siemens.flowmailer.net [185.136.65.225]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.66611.1775513516592113909 for ; Mon, 06 Apr 2026 15:11:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=adrian.freihofer@siemens.com header.s=fm2 header.b=DzwJLZCi; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.225, mailfrom: fm-1329275-20260406221153fcd484037500020783-xvt2ph@rts-flowmailer.siemens.com) Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 20260406221153fcd484037500020783 for ; Tue, 07 Apr 2026 00:11:54 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=adrian.freihofer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=/K626ca1deFDCnmAmQkaFpTob7xtoG62ZwsM+fBUSRE=; b=DzwJLZCi5fBpSxUPAsboxhrFLZvIIMM7SlpWxkCf3qbOc9AJQQFYFT9210VhLax7wZi/9o LUkI2ywhTfe/Kf9EcEc5+d8byaFauYmIJrKvgK82iovF+ug+ctdd+cL77E5TC+1OuqvuJrS0 BXt/4EXi6goL/RtRP9M0wihM9tpkDSY2blVoD7E26VAFwl+xj5YJmBnjy/HbYTeASI+zXrLw v1CDEssHXS69BWe3tSXtu/cUyEDJ3YCHK9xbnfS89BliCfLcYIhoziYL/lWLmZQl7S6G/7Ub pp6IihQdWZ1ifTDen4PXMkbmQeYFlhz0SmDbkYyeCD402KQPAWMttUuw==; From: AdrianF To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 4/6] oe-selftest: devtool: use assertRegex to match test output for meson Date: Tue, 7 Apr 2026 00:10:31 +0200 Message-ID: <20260406221133.2769152-5-adrian.freihofer@siemens.com> In-Reply-To: <20260406221133.2769152-1-adrian.freihofer@siemens.com> References: <20260406221133.2769152-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1329275:519-21489:flowmailer 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, 06 Apr 2026 22:12:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/234688 From: Adrian Freihofer Replace strict string matching with assertRegex to allow for flexible whitespace in the "Fail: 0" output from meson tests. This improves test robustness against formatting changes. This issue was discovered with scarthgap. Signed-off-by: Adrian Freihofer --- meta/lib/oeqa/selftest/cases/devtool.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 297dda7457..dc83d406fd 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -2911,7 +2911,7 @@ class DevtoolIdeSdkTests(DevtoolBase): result = runCmd('%s test -C %s' % (meson_exe, build_dir), cwd=tempdir, output_log=self._cmd_logger) self.assertEqual(result.status, 0) - self.assertIn("Fail: 0", result.output) + self.assertRegex(result.output, r"Fail:\s+0") # Verify re-building and testing works again result = runCmd('%s compile -C %s --clean' % (meson_exe, build_dir), @@ -2922,7 +2922,7 @@ class DevtoolIdeSdkTests(DevtoolBase): result = runCmd('%s test -C %s' % (meson_exe, build_dir), cwd=tempdir, output_log=self._cmd_logger) self.assertEqual(result.status, 0) - self.assertIn("Fail: 0", result.output) + self.assertRegex(result.output, r"Fail:\s+0") return compile_cmd From patchwork Mon Apr 6 22:10:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AdrianF X-Patchwork-Id: 85372 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 DE6F3FB5178 for ; Mon, 6 Apr 2026 22:12:03 +0000 (UTC) Received: from mta-65-226.siemens.flowmailer.net (mta-65-226.siemens.flowmailer.net [185.136.65.226]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.66609.1775513516591705560 for ; Mon, 06 Apr 2026 15:11:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=adrian.freihofer@siemens.com header.s=fm2 header.b=iVlhCMFt; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.226, mailfrom: fm-1329275-20260406221154903e580c0000020737-nqogqb@rts-flowmailer.siemens.com) Received: by mta-65-226.siemens.flowmailer.net with ESMTPSA id 20260406221154903e580c0000020737 for ; Tue, 07 Apr 2026 00:11:54 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=adrian.freihofer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=lT1nLeeL9m5+f0E7DiaPoJrvOqsnNQm73P4cBQ/4EUA=; b=iVlhCMFt5XcvHrqndS+K3E7Baqk9r/3+eYpZHPWtX6VQsEBn0AwtbHRwS5wRbRofqQCpLq +5r6vqGrapwqiQy764RVIhnG6yst76b9ZUSf8d+P9IF5e03Fr2gcePQAbJcWBlvhjApzTV6+ K0vKAU79Ux8yMHlFlq3FmFO4fr87IcL1QyVVu2qaM/gda/wYl/IOIMHmJ8jC/Zro8k19s8tS AxmlQUs1LAaMxkr5lhYjNz7mX21q/MoBXU6qsTk7Qj/Qrpalo6GP8/R+r+YvJf2h5uGaTfFh lKewA+VMwW72l2tGbJIk8JoxevRlowYgPQxJB/SXC2qqD3DTISgbAfJQ==; From: AdrianF To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 5/6] oe-selftest/cpp-example: fix conf file ownership with static UIDs/GIDs Date: Tue, 7 Apr 2026 00:10:32 +0200 Message-ID: <20260406221133.2769152-6-adrian.freihofer@siemens.com> In-Reply-To: <20260406221133.2769152-1-adrian.freihofer@siemens.com> References: <20260406221133.2769152-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1329275:519-21489:flowmailer 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, 06 Apr 2026 22:12:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/234689 From: Adrian Freihofer test_devtool_ide_sdk_none_qemu builds an image containing both cmake-example and meson-example, starts a QEMU instance, then uses devtool ide-sdk + devtool deploy-target to rebuild and redeploy each recipe in turn. The test verifies that /etc/.conf is owned by the matching user both before and after each deploy cycle. The test was failing with: /etc/meson-example.conf not owned by user meson-example: got cmake-example Root cause: both recipes call install -m 0644 -o ${BPN} -g ${BPN} ... ${D}${sysconfdir}/${BPN}.conf During do_install, pseudo resolves ${BPN} to a UID by looking up /etc/passwd in the recipe's own isolated RECIPE_SYSROOT. Since the sysroots are independent, both cmake-example and meson-example each see themselves as the first --system user and get the same UID (e.g. 100). Both ${D} trees therefore contain files with UID 100. In the final rootfs cmake-example is allocated UID 100 and meson-example UID 101. Files packaged for meson-example still carry UID 100, so stat reports them as owned by cmake-example. A pkg_postinst chown would fix the rootfs, but devtool deploy-target is a plain tar pipe over SSH with no package-manager involvement - it never runs pkg_postinst. Whatever UID is embedded in ${D} is what lands on the target. Not sure how this could be fixed with dynamic UIDs. A clean solution is to make every recipe sysroot and the final image agree on the same UIDs from the start, i.e. static IDs. Fix: - Enable USERADDEXTENSION = "useradd-staticids" in _write_bb_config so the test builds with static IDs for the duration of the test. - Add cmake-example (UID/GID 533) and meson-example (UID/GID 534) to meta-selftest/files/static-passwd and static-group. - Expand the comment in cpp-example.inc's do_install to document the static-ID requirement so future readers understand why the -o/-g flags work correctly only under useradd-staticids. - Fix a copy-paste error in the in-test comment (said "meson-example.conf ... cmake-example user" for the cmake block). Signed-off-by: Adrian Freihofer --- meta-selftest/files/static-group | 2 ++ meta-selftest/files/static-passwd | 2 ++ meta-selftest/recipes-test/cpp/cpp-example.inc | 6 +++++- meta/lib/oeqa/selftest/cases/devtool.py | 14 ++++++++++++-- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/meta-selftest/files/static-group b/meta-selftest/files/static-group index 4cc37ddea2..6a9ece20a8 100644 --- a/meta-selftest/files/static-group +++ b/meta-selftest/files/static-group @@ -29,4 +29,6 @@ xuser:x:530: seat:x:531: audio:x:532: empower:x:533: +cmake-example:x:534: +meson-example:x:535: nogroup:x:65534: diff --git a/meta-selftest/files/static-passwd b/meta-selftest/files/static-passwd index cc6c5acd5c..98017c8153 100644 --- a/meta-selftest/files/static-passwd +++ b/meta-selftest/files/static-passwd @@ -19,3 +19,5 @@ _apt:x:523:523::/:/bin/nologin weston:x:525:525::/:/bin/nologin ptest:x:529:529::/:/bin/nologin xuser:x:530:530::/:/bin/nologin +cmake-example:x:534:534::/var/lib/cmake-example:/bin/false +meson-example:x:535:535::/var/lib/meson-example:/bin/false diff --git a/meta-selftest/recipes-test/cpp/cpp-example.inc b/meta-selftest/recipes-test/cpp/cpp-example.inc index 2653f45e90..0671824d1c 100644 --- a/meta-selftest/recipes-test/cpp/cpp-example.inc +++ b/meta-selftest/recipes-test/cpp/cpp-example.inc @@ -41,7 +41,11 @@ USERADD_PARAM:${PN} = "--system --home /var/lib/${BPN} --no-create-home --shell EX_BINARY_NAME ?= "${BPN}" do_install:append() { - # Install configuration file owned by unprivileged user + # Install configuration file owned by the recipe's unprivileged user. + # Note: this requires static UIDs/GIDs (USERADDEXTENSION = "useradd-staticids") + # so that the UID embedded by pseudo during do_install matches the UID assigned + # in the final image. devtool deploy-target is a raw file copy and does not run + # pkg_postinst, so the UID in ${D} must already be correct. install -d ${D}${sysconfdir} install -m 0644 -g ${BPN} -o ${BPN} ${S}/cpp-example.conf ${D}${sysconfdir}/${BPN}.conf sed -i -e 's|@BINARY_NAME@|${BPN}|g' ${D}${sysconfdir}/${BPN}.conf diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index dc83d406fd..bccbae912f 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -2597,7 +2597,17 @@ class DevtoolIdeSdkTests(DevtoolBase): 'IMAGE_GEN_DEBUGFS = "1"', 'IMAGE_INSTALL:append = " gdbserver %s"' % ' '.join( [r + '-ptest' for r in recipe_names]), - 'DISTRO_FEATURES:append = " ptest"' + 'DISTRO_FEATURES:append = " ptest"', + # Static UIDs/GIDs are required so that files installed via + # "install -o ${BPN}" in do_install embed the same UID that gets + # assigned in the final image. Without this, each recipe's isolated + # sysroot allocates UIDs independently (both start at the first free + # system UID), so files end up with colliding UIDs in the image. + # devtool deploy-target is a raw file copy and does not run + # pkg_postinst, so ownership must be correct already in ${D}. + 'USERADDEXTENSION = "useradd-staticids"', + 'USERADD_UID_TABLES += "files/static-passwd"', + 'USERADD_GID_TABLES += "files/static-group"', ] self.write_config("\n".join(conf_lines)) @@ -2985,7 +2995,7 @@ class DevtoolIdeSdkTests(DevtoolBase): self.assertEqual(self._workspace_scripts_dir( recipe_name), self._sources_scripts_dir(tempdir)) - # Verify /etc/meson-example.conf is still owned by the cmake-example user + # Verify /etc/cmake-example.conf is still owned by the cmake-example user # after the install and deploy scripts updated the file self._verify_conf_file(qemu, conf_file, example_exe, example_exe) From patchwork Mon Apr 6 22:10:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AdrianF X-Patchwork-Id: 85367 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 9E157FB516F for ; Mon, 6 Apr 2026 22:12:02 +0000 (UTC) Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net [185.136.65.227]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.66612.1775513516592253172 for ; Mon, 06 Apr 2026 15:11:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=adrian.freihofer@siemens.com header.s=fm2 header.b=UaepC9tP; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.227, mailfrom: fm-1329275-20260406221154082db4213a0002073c-6__3m_@rts-flowmailer.siemens.com) Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 20260406221154082db4213a0002073c for ; Tue, 07 Apr 2026 00:11:54 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=adrian.freihofer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=MEqyzXeEN/RVE6RVpBJ+VJEtqbkv6Iaw6xGtaYq4BeY=; b=UaepC9tPjRhSGnIem5LWKL4+RkVydTWZ+arIbfZlj8yaY8ssHGqALPXU8t0ZDWUndP0ziA w7PEi/EbzaTe8OK/L+w/H9pqRgUkgBHTAZJ7ByXhJp9kkY38yVdpAo7LUQcsgQqXe3Z4mY6J QkTS/56vMmW151Mj5l74wE6l4nkuU3SOKEVQ0DN9AlWi/hOu/CkumODUFljT7fuExYqADHyN AGnHSuSaVJGKBkMGH4q45T2e5AN4bKa0tq0YJD8x6OLXdVLMOLhZ1/zJGNjDwup3iLG1dj91 qHQ8cDupIDBl6YErnX6x6y4+0wWTesCOA5c1jk3g//uSkK/hB5HA4j5w==; From: AdrianF To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 6/6] devtool: ide-sdk: use TOOLCHAIN not TCOVERRIDE Date: Tue, 7 Apr 2026 00:10:33 +0200 Message-ID: <20260406221133.2769152-7-adrian.freihofer@siemens.com> In-Reply-To: <20260406221133.2769152-1-adrian.freihofer@siemens.com> References: <20260406221133.2769152-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1329275:519-21489:flowmailer 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, 06 Apr 2026 22:12:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/234692 From: Adrian Freihofer Looks like TOOLCHAIN is the correct variable to determine the toolchain used by a recipe, not TCOVERRIDE. Signed-off-by: Adrian Freihofer --- scripts/lib/devtool/ide_sdk.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/lib/devtool/ide_sdk.py b/scripts/lib/devtool/ide_sdk.py index 9bccd76f0c..07f5552758 100755 --- a/scripts/lib/devtool/ide_sdk.py +++ b/scripts/lib/devtool/ide_sdk.py @@ -416,7 +416,7 @@ class RecipeModified: self.staging_incdir = None self.strip_cmd = None self.target_arch = None - self.tcoverride = None + self.toolchain = None self.topdir = None self.workdir = None # Service management @@ -502,7 +502,7 @@ class RecipeModified: recipe_d.getVar('STAGING_INCDIR')) self.strip_cmd = recipe_d.getVar('STRIP') self.target_arch = recipe_d.getVar('TARGET_ARCH') - self.tcoverride = recipe_d.getVar('TCOVERRIDE') + self.toolchain = recipe_d.getVar('TOOLCHAIN') self.topdir = recipe_d.getVar('TOPDIR') self.workdir = os.path.realpath(recipe_d.getVar('WORKDIR')) @@ -673,7 +673,7 @@ class RecipeModified: @property def gdb_pretty_print_scripts(self): if self._gdb_pretty_print_scripts is None: - if self.tcoverride == "toolchain-gcc": + if self.toolchain == "gcc": gcc_python_helpers_pattern = os.path.join(self.recipe_sysroot, "usr", "share", "gcc-*", "python") gcc_python_helpers_dirs = glob.glob(gcc_python_helpers_pattern) if gcc_python_helpers_dirs: