From patchwork Tue Oct 6 09:06:52 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrej Kozemcak X-Patchwork-Id: 100034 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 95808CA5FED for ; Tue, 6 Oct 2026 09:07:08 +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.41211.1791277623840091861 for ; Tue, 06 Oct 2026 02:07:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=andrej.kozemcak@siemens.com header.s=fm1 header.b=Lz/6g3Ke; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.227, mailfrom: fm-1334352-20261006090700662e405645000207a3-anrhur@rts-flowmailer.siemens.com) Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 20261006090700662e405645000207a3 for ; Tue, 06 Oct 2026 11:07:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=andrej.kozemcak@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc; bh=mRSz5ylX5CGPTOFyK+qVYVOACV4jSCND9fnhgNogows=; b=Lz/6g3KezJAFlANmhqj85U8U1mSXJYxo/5e8P8ULDthWubnrNcgOaN0MjJjuzeoqaFrIur cd1JSqhpfMGdmGjKvuWUBzeIWOh+YkQ2esofYasg3mAhMtEvSHjxY3lFBxPuhogMt6kXbeOF /Ui6DMFHZSQdMJOfROmtoEtWIot2c6iJGvfgNcZ/K2hEhQWKfPDkbqNIPP1BHQMH4J42cOjx m3OwwL4wKeHZFpPW4DnxP42CTi027ufCdOyEl2Gd5LgB882tbOeHFalGKjowHKHaqNads5ha ES/ho1XygPGdyjf3XKHpw3M6f1hELksDRX8tadrH2si+Sznd5q5Z5Hfg==; From: Andrej Kozemcak To: openembedded-core@lists.openembedded.org Cc: Andrej Kozemcak Subject: [PATCH v2 1/3] qemu: enable pseudo for nfs rootfs export Date: Tue, 6 Oct 2026 11:06:52 +0200 Message-ID: <20261006090654.3445576-1-andrej.kozemcak@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1334352: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 ; Tue, 06 Oct 2026 09:07:08 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/247279 Testimage.bbclass can now boot from nfs, but pseudo is globally disabled by default in the environment. This corrupts file access rights when qemu boots from nfs, causing failures. Explicitly enable pseudo in runqemu-export-rootfs since it is required here. Explicitly enable pseudo during rootfs extraction so an inherited PSEUDO_DISABLED=1 does not lose archive ownership before NFS export. Also export OECORE_NATIVE_SYSROOT from qemurunner so runqemu-export-rootfs can locate pseudo without needing a second tinfoil connection. Skip the snapshot tmpfs copy for NFS rootfs directories, which cannot be copied as disk-image files. Signed-off-by: Andrej Kozemcak --- meta/lib/oeqa/utils/qemurunner.py | 4 ++++ scripts/lib/pseudo_rootfs_utils.py | 1 + scripts/runqemu | 2 +- scripts/runqemu-export-rootfs | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index 5979b52650..1a83c01ea8 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -166,6 +166,10 @@ class QemuRunner: if self.tmpfsdir: env["RUNQEMU_TMPFS_DIR"] = self.tmpfsdir + if self.native_sysroot: + # Needed by runqemu-export-rootfs (avoid a second tinfoil connection) + env["OECORE_NATIVE_SYSROOT"] = self.native_sysroot + if not launch_cmd: launch_cmd = 'runqemu %s' % ('snapshot' if discard_writes else '') if self.use_kvm: diff --git a/scripts/lib/pseudo_rootfs_utils.py b/scripts/lib/pseudo_rootfs_utils.py index 12431e2080..e539a69f82 100644 --- a/scripts/lib/pseudo_rootfs_utils.py +++ b/scripts/lib/pseudo_rootfs_utils.py @@ -97,6 +97,7 @@ def extract_sdk_rootfs(rootfs_tarball, rootfs_dir, pseudo_cmd, environment): environment = dict(environment) environment['PSEUDO_LOCALSTATEDIR'] = state_dir environment['PSEUDO_INCLUDE_PATHS'] = rootfs_dir + environment['PSEUDO_DISABLED'] = '0' command = list(pseudo_cmd) + ['tar', '-C', rootfs_dir] + tar_options + [rootfs_tarball] print('Extracting rootfs tarball using pseudo...') diff --git a/scripts/runqemu b/scripts/runqemu index 2c126e7f54..74a00e5481 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -1289,7 +1289,7 @@ to your build configuration. rootfs_format = self.fstype if self.fstype in ('vmdk', 'vhd', 'vhdx', 'qcow2', 'vdi') else 'raw' tmpfsdir = os.environ.get("RUNQEMU_TMPFS_DIR", None) - if self.snapshot and tmpfsdir: + if self.snapshot and tmpfsdir and self.fstype != 'nfs': newrootfs = os.path.join(tmpfsdir, os.path.basename(self.rootfs)) + "." + str(os.getpid()) logger.info("Copying rootfs to %s" % newrootfs) copy_start = time.time() diff --git a/scripts/runqemu-export-rootfs b/scripts/runqemu-export-rootfs index 150513bc50..ff19a0ccc9 100755 --- a/scripts/runqemu-export-rootfs +++ b/scripts/runqemu-export-rootfs @@ -58,6 +58,8 @@ PSEUDO_LOCALSTATEDIR="$NFS_EXPORT_DIR/../$(basename $NFS_EXPORT_DIR).pseudo_stat export PSEUDO_LOCALSTATEDIR PSEUDO_INCLUDE_PATHS="$NFS_EXPORT_DIR" export PSEUDO_INCLUDE_PATHS +# Enable pseudo +export PSEUDO_DISABLED=0 if [ ! -d "$PSEUDO_LOCALSTATEDIR" ]; then echo "Error: $PSEUDO_LOCALSTATEDIR does not exist." From patchwork Tue Oct 6 09:06:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrej Kozemcak X-Patchwork-Id: 100035 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 84BE6CA5FF0 for ; Tue, 6 Oct 2026 09:07:08 +0000 (UTC) Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net [185.136.64.227]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.41210.1791277623839341362 for ; Tue, 06 Oct 2026 02:07:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=andrej.kozemcak@siemens.com header.s=fm1 header.b=LkbNyDsm; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.227, mailfrom: fm-1334352-202610060907000fbe3957d100020727-rfadcg@rts-flowmailer.siemens.com) Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 202610060907000fbe3957d100020727 for ; Tue, 06 Oct 2026 11:07:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=andrej.kozemcak@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=C17dsuiYb4wBd2PCuSH7FJTcaVlsFUQ8LNsfmr0IEbg=; b=LkbNyDsmhNiHQ/fWL6KrtEM3r3x54r2aS49uxMZFEDsStV5tUojibRvc/CrWFFLgtaj77d 8TEVItnu50wQY5mmb2FghuFlcxjkzctjDNDhw9PiyWfebTOiycQC5EtkmENygtXx/xIXuToo T/rDt1y5898qtfKQafCIC3Iwdbu9i7JwZwZVtDcHQ3TvXj/P3yrXjjfS45p2iMm1zQYqOfqw +LbWRETNNwbosnCtjm1ZMdzmBY1XouMl0fxMmndeNo6HEa36BqA0rbe1zHt26eFzRz1I8rcr iPWQJK+hOQiPDSyPS8cpFZC1ojcmO10QLeSlIyeuzJKcd0XmNs8cxF4A==; From: Andrej Kozemcak To: openembedded-core@lists.openembedded.org Cc: Andrej Kozemcak Subject: [PATCH v2 2/3] runqemu: support rootfs-dbg flag in QB_FSINFO Date: Tue, 6 Oct 2026 11:06:53 +0200 Message-ID: <20261006090654.3445576-2-andrej.kozemcak@siemens.com> In-Reply-To: <20261006090654.3445576-1-andrej.kozemcak@siemens.com> References: <20261006090654.3445576-1-andrej.kozemcak@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1334352: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 ; Tue, 06 Oct 2026 09:07:08 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/247278 Add parsing for a new 'rootfs-dbg' flag on tar-based filesystem types in QB_FSINFO. When set, runqemu appends '-dbg' to the IMAGE_LINK_NAME used to locate the rootfs tarball for NFS extraction, allowing use of the debug rootfs variant. QB_FSINFO: additional filesystem metadata, as a space-separated list of "fstype:flag" entries, e.g., "wic:no-kernel-in-fs tar:rootfs-dbg" Supported flags include "wic:no-kernel-in-fs" or "wic:kernel-in-fs" to select whether a WIC image contains the kernel in the filesystem, and "tar:rootfs-dbg" to tell runqemu to use the debug rootfs image. Signed-off-by: Andrej Kozemcak --- scripts/runqemu | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/runqemu b/scripts/runqemu index 74a00e5481..2c7549b2ea 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -197,6 +197,7 @@ class BaseConfig(object): self.portlocks = {} self.bitbake_e = '' self.snapshot = False + self.rootfs_dbg = False self.wictypes = ('wic.zst', 'wic', 'wic.vmdk', 'wic.qcow2', 'wic.vdi', "wic.vhd", "wic.vhdx") self.tartypes = ('tar.zst', 'tar.bz2', 'tar.gz', 'tar.xz', 'tar') self.fstypes = ('ext2', 'ext3', 'ext4', 'ext2.zst', 'ext3.zst', 'ext4.zst', @@ -686,7 +687,7 @@ to your build configuration. else: raise RunQemuError("FSTYPE is NULL!") - # parse QB_FSINFO into dict, e.g. { 'wic': ['no-kernel-in-fs', 'a-flag'], 'ext4': ['another-flag']} + # parse QB_FSINFO into dict, e.g. { 'wic': ['no-kernel-in-fs', 'a-flag'], 'tar': ['rootfs-dbg']} wic_fs = False qb_fsinfo = self.get('QB_FSINFO') if qb_fsinfo: @@ -703,6 +704,12 @@ to your build configuration. else: logger.warning('Unknown flag "%s:%s" in QB_FSINFO', fstype, fsflag) continue + elif fstype in ('tar',) + self.tartypes: + if fsflag == 'rootfs-dbg': + self.rootfs_dbg = True + else: + logger.warning('Unknown flag "%s:%s" in QB_FSINFO', fstype, fsflag) + continue else: logger.warning('QB_FSINFO is not supported for image type "%s"', fstype) continue @@ -1079,7 +1086,10 @@ to your build configuration. # Extract .tar* if no nfs dir if not (self.rootfs and os.path.isdir(self.rootfs)): - src_prefix = '%s/%s' % (self.get('DEPLOY_DIR_IMAGE'), self.get('IMAGE_LINK_NAME')) + image_link_name = self.get('IMAGE_LINK_NAME') + if self.rootfs_dbg: + image_link_name += '-dbg' + src_prefix = '%s/%s' % (self.get('DEPLOY_DIR_IMAGE'), image_link_name) dest = "%s-nfsroot" % src_prefix if os.path.exists('%s.pseudo_state' % dest): logger.info('Use %s as NFS_DIR' % dest) From patchwork Tue Oct 6 09:06:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrej Kozemcak X-Patchwork-Id: 100036 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 ABDF5CA5FFF for ; Tue, 6 Oct 2026 09:07:08 +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.msgproc02-g2.41261.1791277623839353075 for ; Tue, 06 Oct 2026 02:07:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=andrej.kozemcak@siemens.com header.s=fm1 header.b=VBjjFLRS; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.225, mailfrom: fm-1334352-20261006090701a895a2305b000207c2-hvjdcj@rts-flowmailer.siemens.com) Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 20261006090701a895a2305b000207c2 for ; Tue, 06 Oct 2026 11:07:01 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=andrej.kozemcak@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=Kcwe8sG8wN+OHLPcnCqYt8NCp9r2mull4SZEAf+GO7Y=; b=VBjjFLRSDrM0RTECKHfZ5kfiDRr2hVbUrLMBKf4SRhxLy3uKIXl0XE+aTFi6VIKn/TT3Hz Xic36lWNdmfR+JdkBwbUO6MaoaSMIf5zGEkbaVs5xqHuMZeEoPf1XukGQ4y198cmFp8WR2x7 lAAgUJ6diq90B8NDWecP7mx+hQ3yTdnT9IVk37cfarroC6LE2NdVVxAKM2nMlrMPqQ5Jsg/d HT0/tSu4zDVsWajaYJvB+4oNopQtlUU/gKLNo7ZOZ2QBaFHbIrQRq5MHjcz0Jy5P+UnRvzGW OFaIz5dcBby1LNYJUK7tGoTeAK1BdE7XDUJPXak4ep+nFOkFQfj4tITA==; From: Andrej Kozemcak To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer , Andrej Kozemcak Subject: [PATCH v2 3/3] selftest/runtime_test: add testimage.bbclass NFS rootfs-dbg test Date: Tue, 6 Oct 2026 11:06:54 +0200 Message-ID: <20261006090654.3445576-3-andrej.kozemcak@siemens.com> In-Reply-To: <20261006090654.3445576-1-andrej.kozemcak@siemens.com> References: <20261006090654.3445576-1-andrej.kozemcak@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1334352: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 ; Tue, 06 Oct 2026 09:07:08 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/247277 From: Adrian Freihofer Add a test case for testimage.bbclass with qemu booted from a full rootfs-dbg image mounted via NFS, plus a slirp variant, sharing a common _test_testimage_nfs(slirp) implementation. Both also install cmake-example-ptest and ptest-runner with the ptest DISTRO_FEATURE enabled, so the ptest suite runs over NFS too. test_testimage_slirp is switched to oe-selftest-image, which already provides an SSH server. Signed-off-by: Adrian Freihofer Signed-off-by: Andrej Kozemcak --- meta/lib/oeqa/selftest/cases/runtime_test.py | 51 ++++++++++++++++++-- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py index a3c3126036..b82c7c7294 100644 --- a/meta/lib/oeqa/selftest/cases/runtime_test.py +++ b/meta/lib/oeqa/selftest/cases/runtime_test.py @@ -137,14 +137,59 @@ class TestImage(OESelftestTestCase): features = ''' IMAGE_CLASSES:append = " testimage" -IMAGE_FEATURES:append = " ssh-server-dropbear" IMAGE_ROOTFS_EXTRA_SPACE:append = "${@bb.utils.contains("IMAGE_CLASSES", "testimage", " + 5120", "", d)}" TEST_RUNQEMUPARAMS += " slirp" ''' self.write_config(features) - bitbake('core-image-minimal') - bitbake('-c testimage core-image-minimal') + bitbake('oe-selftest-image') + bitbake('-c testimage oe-selftest-image') + + def _test_testimage_nfs(self, slirp=False): + """ + Check testimage functionality with an NFS rootfs-dbg image + (image-combined-dbg), the same rootfs devtool ide-sdk --nfs=rootfs-dbg + boots. runqemu recognizes the rootfs tarball and extracts it itself + for NFS boot, the same way test_qemu_can_boot_nfs_and_shutdown + (runqemu.py) does. Also installs cmake-example-ptest and runs the + ptest suite on top of it. + """ + + # IMAGE_LINK_NAME/DEPLOY_DIR_IMAGE don't depend on the features below, + # so the rootfs-dbg tarball path can be derived before building it. + bb_vars = get_bb_vars(('DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'), 'oe-selftest-image') + rootfs_tar = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], '%s-dbg.tar.zst' % bb_vars['IMAGE_LINK_NAME']) + + features = ''' +IMAGE_CLASSES:append = " testimage image-combined-dbg" +IMAGE_GEN_DEBUGFS = "1" +IMAGE_FSTYPES_DEBUGFS:append = " tar.zst" +DISTRO_FEATURES:append = " ptest" +IMAGE_INSTALL:append = " ptest-runner cmake-example-ptest" +QB_DEFAULT_FSTYPE = "tar.zst" +QB_FSINFO = "tar.zst:rootfs-dbg" +''' + if slirp: + features += 'TEST_RUNQEMUPARAMS += " slirp"\n' + self.write_config(features) + + bitbake('oe-selftest-image') + self.assertExists(rootfs_tar) + + bitbake('-c testimage oe-selftest-image') + + def test_testimage_nfs(self): + """ + Summary: Check testimage functionality with an NFS rootfs-dbg image. + """ + self._test_testimage_nfs(slirp=False) + + def test_testimage_slirp_nfs(self): + """ + Summary: Check testimage functionality with qemu slirp networking and + an NFS rootfs-dbg image. + """ + self._test_testimage_nfs(slirp=True) def test_testimage_dnf(self): """