public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 1/4] testsuite: fix sstate test with relocated build directory
@ 2026-10-29 10:20 'Clara Kowalsky' via isar-users
  2026-10-29 10:20 ` [PATCH 2/4] image: include rootfs manifests in sstate artifacts 'Clara Kowalsky' via isar-users
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: 'Clara Kowalsky' via isar-users @ 2026-10-29 10:20 UTC (permalink / raw)
  To: isar-users; +Cc: Clara Kowalsky

In rootful mode, sbuild uses schroot and creates its overlay upperdir
under TMPDIR. The test-container mounts /isar as an overlay, but
bind-mounts /isar/build to its work directory. The sstate test placed
its build outside that bind mount, so schroot could not use the
upperdir. The test failed when running:

scripts/run-tests.sh testsuite/citest.py:SstateTest.test_sstate \
  -p rootless=0 --debug

ERROR| E: 10mount: mount: /run/schroot/mount/isar-builder-...:
fsconfig() failed: overlay: filesystem on
/isar/build-sstate/tmp/schroot-overlay/isar-builder.../upper not
supported as upperdir.

This is fixed by moving the sstate build under /isar/build. Since this
relocates TOPDIR, BBLAYER paths are generated relative to the build
directory, so BitBake uses the relocated checkout.
The SignatureTest still passes successfully with this change.

Fixes: a00e0aa0afff ("testsuite: fix SignatureTest by avoiding absolute path in bblayers")
Signed-off-by: Clara Kowalsky <clara.kowalsky@siemens.com>
---
 meta-test/conf/bblayers.conf.sample | 8 ++++----
 scripts/isar-setup-builddir         | 5 +++--
 testsuite/cibase.py                 | 2 +-
 testsuite/citest.py                 | 2 +-
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/meta-test/conf/bblayers.conf.sample b/meta-test/conf/bblayers.conf.sample
index b04aba92..48928450 100644
--- a/meta-test/conf/bblayers.conf.sample
+++ b/meta-test/conf/bblayers.conf.sample
@@ -9,10 +9,10 @@ BBPATH = "${TOPDIR}"
 BBFILES ?= ""
 
 BBLAYERS ?= " \
-  ${TOPDIR}/../meta \
-  ${TOPDIR}/../meta-isar \
-  ${TOPDIR}/../meta-test \
+  ${TOPDIR}/##ISARROOT_RELATIVE##/meta \
+  ${TOPDIR}/##ISARROOT_RELATIVE##/meta-isar \
+  ${TOPDIR}/##ISARROOT_RELATIVE##/meta-test \
   "
 BBLAYERS_NON_REMOVABLE ?= " \
-  ${TOPDIR}/../meta \
+  ${TOPDIR}/##ISARROOT_RELATIVE##/meta \
   "
diff --git a/scripts/isar-setup-builddir b/scripts/isar-setup-builddir
index 3896793d..401a137c 100755
--- a/scripts/isar-setup-builddir
+++ b/scripts/isar-setup-builddir
@@ -100,9 +100,10 @@ into your configuration please add entries to conf/bblayers.conf.
 
 EOM
 
-    # Put the abosolute path to the layers in bblayers.conf so we can run
-    # bitbake without the init script after the first run
+    # Expand source-root placeholders so layers can be found independently
+    # of the build directory location.
     sed -e "s|##ISARROOT##|$ISARROOT|g" \
+        -e "s|##ISARROOT_RELATIVE##|$(realpath --relative-to="$BUILDDIR" "$ISARROOT")|g" \
         $ISARCORELAYERCONF > "$BUILDDIR/conf/bblayers.conf"
     SHOWYPDOC=yes
 fi
diff --git a/testsuite/cibase.py b/testsuite/cibase.py
index e5150b36..3f44e8ac 100755
--- a/testsuite/cibase.py
+++ b/testsuite/cibase.py
@@ -268,7 +268,7 @@ class CIBaseTest(CIBuilder):
         os.makedirs(isar_sstate)
         process.run(f"git --work-tree={isar_sstate} checkout HEAD -- .")
 
-        self.init('../build-sstate', isar_dir=isar_sstate)
+        self.init('../build/build-sstate', isar_dir=isar_sstate)
         self.configure(targets=image_target, sstate=True, sstate_dir='', **kwargs)
 
         # Cleanup sstate and tmp before test
diff --git a/testsuite/citest.py b/testsuite/citest.py
index af4cea6a..d057ffa2 100644
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -1571,7 +1571,7 @@ class SstateTest(CIBaseTest):
         image_target = 'mc:qemuamd64-bullseye:isar-image-base'
         package_target = 'mc:qemuamd64-bullseye:hello'
 
-        self.init('build-sstate')
+        self.init('build/build-sstate')
         self.perform_sstate_test(image_target, package_target)
 
 
-- 
2.55.0

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20261029102027.1974884-1-clara.kowalsky%40siemens.com.

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

* [PATCH 2/4] image: include rootfs manifests in sstate artifacts
  2026-10-29 10:20 [PATCH 1/4] testsuite: fix sstate test with relocated build directory 'Clara Kowalsky' via isar-users
@ 2026-10-29 10:20 ` 'Clara Kowalsky' via isar-users
  2026-10-29 10:20 ` [PATCH 3/4] initramfs: include manifest " 'Clara Kowalsky' via isar-users
  2026-10-29 10:20 ` [PATCH 4/4] meta-test: stage rootfs CI manifest in DEPLOYDIR 'Clara Kowalsky' via isar-users
  2 siblings, 0 replies; 4+ messages in thread
From: 'Clara Kowalsky' via isar-users @ 2026-10-29 10:20 UTC (permalink / raw)
  To: isar-users; +Cc: Clara Kowalsky

do_rootfs_install writes the manifest and dpkg_status files to
DEPLOY_DIR_IMAGE, but sstate captures DEPLOYDIR. After restoring the
sstate, the files are missing from the deploy directory.
Running:

scripts/run-tests.sh testsuite/citest.py:SstateTest.test_sstate \
  -p rootless=0 --debug

fails with:

ERROR| mc:qemuamd64-bullseye:isar-image-base: files missing from deploy
dir after rebuild with sstate cache:
{'/isar/build/build-sstate/tmp/deploy/images/qemuamd64/
isar-image-base-debian-bullseye-qemuamd64.manifest',
'/isar/build/build-sstate/tmp/deploy/images/qemuamd64/
isar-image-base-debian-bullseye-qemuamd64.dpkg_status'}

This error happens independently of commit "testsuite: fix sstate test
with relocated build directory". Fix this by defaulting both output
directories to DEPLOYDIR, so sstate captures and restores the files.

Fixes: c7a637508ac6 ("rootfs: fold do_rootfs_postprocess task into do_rootfs_install")
Signed-off-by: Clara Kowalsky <clara.kowalsky@siemens.com>
---
 meta/classes-recipe/image.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass
index d9125d05..ce19ae1c 100644
--- a/meta/classes-recipe/image.bbclass
+++ b/meta/classes-recipe/image.bbclass
@@ -106,8 +106,8 @@ ROOTFS_FEATURES += "\
     "
 ROOTFS_PACKAGES += "${IMAGE_PREINSTALL} ${@isar_multiarch_packages('IMAGE_INSTALL', d)}"
 ROOTFS_VARDEPS += "IMAGE_INSTALL"
-ROOTFS_MANIFEST_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}"
-ROOTFS_DPKGSTATUS_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}"
+ROOTFS_MANIFEST_DEPLOY_DIR ?= "${DEPLOYDIR}"
+ROOTFS_DPKGSTATUS_DEPLOY_DIR ?= "${DEPLOYDIR}"
 ROOTFS_PACKAGE_SUFFIX ?= "${PN}-${DISTRO}-${MACHINE}"
 
 CACHE_DEB_SRC = "${@bb.utils.contains('BASE_REPO_FEATURES', 'cache-deb-src', '1', '0', d)}"
-- 
2.55.0

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20261029102027.1974884-2-clara.kowalsky%40siemens.com.

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

* [PATCH 3/4] initramfs: include manifest in sstate artifacts
  2026-10-29 10:20 [PATCH 1/4] testsuite: fix sstate test with relocated build directory 'Clara Kowalsky' via isar-users
  2026-10-29 10:20 ` [PATCH 2/4] image: include rootfs manifests in sstate artifacts 'Clara Kowalsky' via isar-users
@ 2026-10-29 10:20 ` 'Clara Kowalsky' via isar-users
  2026-10-29 10:20 ` [PATCH 4/4] meta-test: stage rootfs CI manifest in DEPLOYDIR 'Clara Kowalsky' via isar-users
  2 siblings, 0 replies; 4+ messages in thread
From: 'Clara Kowalsky' via isar-users @ 2026-10-29 10:20 UTC (permalink / raw)
  To: isar-users; +Cc: Clara Kowalsky

initramfs.bbclass overrides ROOTFS_MANIFEST_DEPLOY_DIR to
DEPLOY_DIR_IMAGE, but as do_rootfs_install captures DEPLOYDIR for
sstate, the initramfs manifest is missing after cache restoration.

Fix this by staging the initramfs manifests to DEPLOYDIR too. The sstate
test is extended to build an external initramfs and verify that its
manifest is restored.

Fixes: c7a637508ac6 ("rootfs: fold do_rootfs_postprocess task into do_rootfs_install")
Signed-off-by: Clara Kowalsky <clara.kowalsky@siemens.com>
---
 meta/classes-recipe/initramfs.bbclass |  2 +-
 testsuite/citest.py                   | 12 ++++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/meta/classes-recipe/initramfs.bbclass b/meta/classes-recipe/initramfs.bbclass
index 41828487..9ae9c556 100644
--- a/meta/classes-recipe/initramfs.bbclass
+++ b/meta/classes-recipe/initramfs.bbclass
@@ -20,7 +20,7 @@ INITRAMFS_INSTALL += "${@ ("linux-image-" + d.getVar("KERNEL_NAME")) if d.getVar
 INITRAMFS_FULLNAME = "${PN}-${DISTRO}-${MACHINE}"
 
 # Bill-of-material
-ROOTFS_MANIFEST_DEPLOY_DIR = "${DEPLOY_DIR_IMAGE}"
+ROOTFS_MANIFEST_DEPLOY_DIR = "${DEPLOYDIR}"
 ROOTFS_PACKAGE_SUFFIX = "${INITRAMFS_FULLNAME}"
 SBOM_DISTRO_NAME:append = "-Initramfs"
 
diff --git a/testsuite/citest.py b/testsuite/citest.py
index d057ffa2..973321ae 100644
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -1562,17 +1562,25 @@ class SstateTest(CIBaseTest):
     :avocado: tags=sstate
     """
 
+    IMAGE_INITRD_LINES = ["IMAGE_INITRD = 'isar-initramfs'"]
+
     def test_sstate_populate(self):
         image_target = 'mc:qemuamd64-bullseye:isar-image-base'
 
-        self.perform_sstate_populate(image_target)
+        self.perform_sstate_populate(
+            image_target, lines=self.IMAGE_INITRD_LINES
+        )
 
     def test_sstate(self):
         image_target = 'mc:qemuamd64-bullseye:isar-image-base'
         package_target = 'mc:qemuamd64-bullseye:hello'
 
         self.init('build/build-sstate')
-        self.perform_sstate_test(image_target, package_target)
+        self.perform_sstate_test(
+            image_target,
+            package_target,
+            lines=self.IMAGE_INITRD_LINES,
+        )
 
 
 class SingleTest(CIBaseTest):
-- 
2.55.0

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20261029102027.1974884-3-clara.kowalsky%40siemens.com.

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

* [PATCH 4/4] meta-test: stage rootfs CI manifest in DEPLOYDIR
  2026-10-29 10:20 [PATCH 1/4] testsuite: fix sstate test with relocated build directory 'Clara Kowalsky' via isar-users
  2026-10-29 10:20 ` [PATCH 2/4] image: include rootfs manifests in sstate artifacts 'Clara Kowalsky' via isar-users
  2026-10-29 10:20 ` [PATCH 3/4] initramfs: include manifest " 'Clara Kowalsky' via isar-users
@ 2026-10-29 10:20 ` 'Clara Kowalsky' via isar-users
  2 siblings, 0 replies; 4+ messages in thread
From: 'Clara Kowalsky' via isar-users @ 2026-10-29 10:20 UTC (permalink / raw)
  To: isar-users; +Cc: Clara Kowalsky

isar-rootfs-ci sets ROOTFS_MANIFEST_DEPLOY_DIR to DEPLOY_DIR_IMAGE. If
generate-manifest would be enabled in ROOTFS_FEATURES (which is not the
case right now), do_rootfs_install would write the manifest outside
DEPLOYDIR, so it would not be captured by sstate.
Fix this already by setting the directory to DEPLOYDIR.

Signed-off-by: Clara Kowalsky <clara.kowalsky@siemens.com>
---
 meta-test/recipes-core/images/isar-rootfs-ci.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-test/recipes-core/images/isar-rootfs-ci.bb b/meta-test/recipes-core/images/isar-rootfs-ci.bb
index 35f5005c..0cc98679 100644
--- a/meta-test/recipes-core/images/isar-rootfs-ci.bb
+++ b/meta-test/recipes-core/images/isar-rootfs-ci.bb
@@ -4,7 +4,7 @@
 # Copyright (C) 2025 Siemens
 
 # Bill-of-material
-ROOTFS_MANIFEST_DEPLOY_DIR = "${DEPLOY_DIR_IMAGE}"
+ROOTFS_MANIFEST_DEPLOY_DIR = "${DEPLOYDIR}"
 
 ROOTFSDIR = "${WORKDIR}/rootfs"
 ROOTFS_FEATURES += "generate-sbom"
-- 
2.55.0

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20261029102027.1974884-4-clara.kowalsky%40siemens.com.

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

end of thread, other threads:[~2026-10-29 10:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-29 10:20 [PATCH 1/4] testsuite: fix sstate test with relocated build directory 'Clara Kowalsky' via isar-users
2026-10-29 10:20 ` [PATCH 2/4] image: include rootfs manifests in sstate artifacts 'Clara Kowalsky' via isar-users
2026-10-29 10:20 ` [PATCH 3/4] initramfs: include manifest " 'Clara Kowalsky' via isar-users
2026-10-29 10:20 ` [PATCH 4/4] meta-test: stage rootfs CI manifest in DEPLOYDIR 'Clara Kowalsky' via isar-users

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox