All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] qemu: enable pseudo for nfs rootfs export
@ 2026-10-02 11:48 Andrej Kozemcak
  2026-10-02 11:48 ` [PATCH 2/3] runqemu: support rootfs-dbg flag in QB_FSINFO Andrej Kozemcak
  0 siblings, 1 reply; 3+ messages in thread
From: Andrej Kozemcak @ 2026-10-02 11:48 UTC (permalink / raw)
  To: openembedded-core; +Cc: Andrej Kozemcak

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.

Also export OECORE_NATIVE_SYSROOT from qemurunner so
runqemu-export-rootfs can locate pseudo without needing a second
tinfoil connection.

Signed-off-by: Andrej Kozemcak <andrej.kozemcak@siemens.com>
---
 meta/lib/oeqa/utils/qemurunner.py | 4 ++++
 scripts/runqemu-export-rootfs     | 2 ++
 2 files changed, 6 insertions(+)

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/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."


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

* [PATCH 2/3] runqemu: support rootfs-dbg flag in QB_FSINFO
  2026-10-02 11:48 [PATCH 1/3] qemu: enable pseudo for nfs rootfs export Andrej Kozemcak
@ 2026-10-02 11:48 ` Andrej Kozemcak
  2026-10-03 16:53   ` [OE-core] " Mathieu Dubois-Briand
  0 siblings, 1 reply; 3+ messages in thread
From: Andrej Kozemcak @ 2026-10-02 11:48 UTC (permalink / raw)
  To: openembedded-core; +Cc: Andrej Kozemcak

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 <andrej.kozemcak@siemens.com>
---
 scripts/runqemu | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index 2c126e7f54..ad6e03feb6 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)


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

* Re: [OE-core] [PATCH 2/3] runqemu: support rootfs-dbg flag in QB_FSINFO
  2026-10-02 11:48 ` [PATCH 2/3] runqemu: support rootfs-dbg flag in QB_FSINFO Andrej Kozemcak
@ 2026-10-03 16:53   ` Mathieu Dubois-Briand
  0 siblings, 0 replies; 3+ messages in thread
From: Mathieu Dubois-Briand @ 2026-10-03 16:53 UTC (permalink / raw)
  To: andrej.kozemcak, openembedded-core

On Fri Oct 2, 2026 at 1:48 PM CEST, Andrej Kozemcak via lists.openembedded.org wrote:
> 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 <andrej.kozemcak@siemens.com>
> ---

Hi Andrej,

It looks like one of the tests is failing:

2026-10-03 14:58:26,482 - oe-selftest - INFO - runtime_test.TestImage.test_testimage_nfs (subunit.RemotedTestCase)
2026-10-03 14:58:26,483 - oe-selftest - INFO -  ... FAIL
...
Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/oe-selftest-debian/build/layers/openembedded-core/scripts/runqemu", line 1810, in main
    config.setup_rootfs()
    ~~~~~~~~~~~~~~~~~~~^^
  File "/srv/pokybuild/yocto-worker/oe-selftest-debian/build/layers/openembedded-core/scripts/runqemu", line 1306, in setup_rootfs
    shutil.copyfile(self.rootfs, newrootfs)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-3336067/tmp/work/qemux86_64-poky-linux/oe-selftest-image/1.0/recipe-sysroot-native/usr/lib/python3.14/shutil.py", line 313, in copyfile
    with open(src, 'rb') as fsrc:
         ~~~~^^^^^^^^^^^
IsADirectoryError: [Errno 21] Is a directory: '/srv/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-3336067/tmp/deploy/images/qemux86-64/oe-selftest-image-qemux86-64.rootfs-dbg-nfsroot'

https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/4994

Can you have a look at the issue?

Thanks,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



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

end of thread, other threads:[~2026-10-03 16:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-02 11:48 [PATCH 1/3] qemu: enable pseudo for nfs rootfs export Andrej Kozemcak
2026-10-02 11:48 ` [PATCH 2/3] runqemu: support rootfs-dbg flag in QB_FSINFO Andrej Kozemcak
2026-10-03 16:53   ` [OE-core] " Mathieu Dubois-Briand

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.