Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Trevor Woerner <twoerner@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v4 01/10] wic-tools: move bootloader firmware staging into the wic oe-selftest
Date: Fri, 24 Jul 2026 05:01:37 -0400	[thread overview]
Message-ID: <20260724090146.19924-2-twoerner@gmail.com> (raw)
In-Reply-To: <20260724090146.19924-1-twoerner@gmail.com>

wic-tools is a meta-recipe whose DEPENDS assemble a native sysroot of the
host tools wic runs. Over time it also accumulated target bootloader
firmware (syslinux, grub-efi, systemd-boot), which is a different kind of
thing: wic copies those artifacts into the images it builds, reading
grub-efi and systemd-boot from DEPLOY_DIR_IMAGE and syslinux from the
sysroot. They were listed in wic-tools only so that building wic-tools
would force the firmware to be built and deployed before the wic
oe-selftest ran.

That coupling makes wic-tools carry target recipes for the sole benefit
of the test suite. Move the firmware out of wic-tools and have the wic
oe-selftest build it directly in its setup, gated to the host
architectures where each loader is available, matching the arch
decorators already on the individual tests. wic-tools keeps
syslinux-native, which is the isohybrid host tool wic invokes rather
than firmware.

No image or SDK builds relied on wic-tools pulling in the firmware; only
the oe-selftest did, so this narrows wic-tools to its original purpose of
staging wic's host tools.

AI-Generated: codex/claude-opus 4.8 (xhigh)
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
changes in v4:
- new in v4
- update test_build_artifacts and test_rootfs_artifacts to build
  syslinux into the image and take the bootimg dir from there, since
  wic-tools no longer stages target syslinux
---
 meta/lib/oeqa/selftest/cases/wic.py | 44 ++++++++++++++++++++++++-----
 meta/recipes-core/meta/wic-tools.bb | 11 +++++---
 2 files changed, 44 insertions(+), 11 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index 4e94f4d39abd..c4a1c7241bbc 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -72,12 +72,30 @@ class WicTestCase(OESelftestTestCase):
             if self.td['USE_NLS'] != 'yes':
                 self.skipTest('wic-tools needs USE_NLS=yes')
 
-            bitbake('wic-tools core-image-minimal core-image-minimal-mtdutils')
+            targets = 'wic-tools core-image-minimal core-image-minimal-mtdutils'
+            # wic copies target bootloader firmware into the images it builds:
+            # grub-efi and systemd-boot from DEPLOY_DIR_IMAGE and syslinux from
+            # the sysroot. Deploy/stage whatever is available on this host arch
+            # so the bootimg_efi / isoimage / pcbios plugins can find it. This
+            # used to be pulled in via wic-tools' DEPENDS, but firmware is a
+            # target artifact rather than a wic host tool, so it is built here.
+            targets += ' ' + ' '.join(self._firmware_recipes())
+            bitbake(targets)
             WicTestCase.image_is_ready = True
 
         os.environ['PATH'] = self._get_wic_path()
         rmtree(self.resultdir, ignore_errors=True)
 
+    def _firmware_recipes(self):
+        """Target bootloader firmware wic may copy into images, per host arch."""
+        arch = self.td['HOST_ARCH']
+        recipes = []
+        if arch in ('i586', 'i686', 'x86_64', 'x86-64'):
+            recipes += ['syslinux', 'grub-efi', 'systemd-boot']
+        elif arch == 'aarch64':
+            recipes += ['grub-efi', 'systemd-boot']
+        return recipes
+
     def tearDownLocal(self):
         """Remove resultdir as it may contain images."""
         if self._old_path is None:
@@ -391,9 +409,15 @@ class Wic(WicTestCase):
     @skipIfNotArch(['i586', 'i686', 'x86_64'])
     def test_build_artifacts(self):
         """Test wic create directdisk providing all artifacts."""
-        bb_vars = get_bb_vars(['STAGING_DATADIR', 'RECIPE_SYSROOT_NATIVE'],
-                              'wic-tools')
-        bb_vars.update(get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_ROOTFS'],
+        # syslinux (the target bootloader data the bootimg_pcbios plugin
+        # copies from --bootimg-dir) is not staged by wic-tools; build it
+        # into the image and take the bootimg dir from there.
+        config = 'DEPENDS:pn-core-image-minimal += "syslinux"\n'
+        self.append_config(config)
+        bitbake('core-image-minimal')
+        self.remove_config(config)
+        bb_vars = get_bb_vars(['RECIPE_SYSROOT_NATIVE'], 'wic-tools')
+        bb_vars.update(get_bb_vars(['STAGING_DATADIR', 'DEPLOY_DIR_IMAGE', 'IMAGE_ROOTFS'],
                                    'core-image-minimal'))
         bbvars = {key.lower(): value for key, value in bb_vars.items()}
         bbvars['resultdir'] = self.resultdir
@@ -494,9 +518,15 @@ class Wic(WicTestCase):
     @skipIfNotArch(['i586', 'i686', 'x86_64'])
     def test_rootfs_artifacts(self):
         """Test usage of rootfs plugin with rootfs paths"""
-        bb_vars = get_bb_vars(['STAGING_DATADIR', 'RECIPE_SYSROOT_NATIVE'],
-                              'wic-tools')
-        bb_vars.update(get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_ROOTFS'],
+        # syslinux (the target bootloader data the bootimg_pcbios plugin
+        # copies from --bootimg-dir) is not staged by wic-tools; build it
+        # into the image and take the bootimg dir from there.
+        config = 'DEPENDS:pn-core-image-minimal += "syslinux"\n'
+        self.append_config(config)
+        bitbake('core-image-minimal')
+        self.remove_config(config)
+        bb_vars = get_bb_vars(['RECIPE_SYSROOT_NATIVE'], 'wic-tools')
+        bb_vars.update(get_bb_vars(['STAGING_DATADIR', 'DEPLOY_DIR_IMAGE', 'IMAGE_ROOTFS'],
                                    'core-image-minimal'))
         bbvars = {key.lower(): value for key, value in bb_vars.items()}
         bbvars['wks'] = "directdisk-multi-rootfs"
diff --git a/meta/recipes-core/meta/wic-tools.bb b/meta/recipes-core/meta/wic-tools.bb
index 823dbe6db643..c1da1739777e 100644
--- a/meta/recipes-core/meta/wic-tools.bb
+++ b/meta/recipes-core/meta/wic-tools.bb
@@ -10,10 +10,13 @@ DEPENDS = "\
            e2fsprogs-native util-linux-native tar-native erofs-utils-native \
            virtual/cross-binutils \
            "
-DEPENDS:append:x86 = " syslinux-native syslinux grub-efi systemd-boot"
-DEPENDS:append:x86-64 = " syslinux-native syslinux grub-efi systemd-boot"
-DEPENDS:append:x86-x32 = " syslinux-native syslinux grub-efi"
-DEPENDS:append:aarch64 = " grub-efi systemd-boot"
+# syslinux-native provides the isohybrid host tool that wic runs; it is only
+# available on x86. The target bootloader firmware (syslinux, grub-efi,
+# systemd-boot) that wic copies into an image is deployed by the wic selftest
+# instead, so it is not staged here.
+DEPENDS:append:x86 = " syslinux-native"
+DEPENDS:append:x86-64 = " syslinux-native"
+DEPENDS:append:x86-x32 = " syslinux-native"
 
 INHIBIT_DEFAULT_DEPS = "1"
 
-- 
2.50.0.173.g8b6f19ccfc3a



  reply	other threads:[~2026-07-24  9:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24  9:01 [PATCH v4 00/10] wic: ship its tools, and add an SDK_FEATURES lever Trevor Woerner
2026-07-24  9:01 ` Trevor Woerner [this message]
2026-07-24  9:01 ` [PATCH v4 02/10] wic: add runtime dependencies on the tools it invokes Trevor Woerner
2026-07-24  9:01 ` [PATCH v4 03/10] oeqa/selftest/wic: drop dead COREBASE/scripts wic lookup Trevor Woerner
2026-07-24  9:01 ` [PATCH v4 04/10] oeqa/selftest/wic: drop redundant per-test PATH overrides Trevor Woerner
2026-07-24  9:01 ` [PATCH v4 05/10] nativesdk-packagegroup-sdk-host: add an SDK_FEATURES lever Trevor Woerner
2026-07-24  9:01 ` [PATCH v4 06/10] nativesdk-packagegroup-sdk-host: add wic to SDK_FEATURES Trevor Woerner
2026-07-24  9:01 ` [PATCH v4 07/10] nativesdk-packagegroup-sdk-host: add an sbom SDK feature Trevor Woerner
2026-07-24  9:01 ` [PATCH v4 08/10] nativesdk-packagegroup-sdk-host: add an lldb " Trevor Woerner
2026-07-24  9:01 ` [PATCH v4 09/10] nativesdk-packagegroup-sdk-host: gate qemu behind SDK_FEATURES Trevor Woerner
2026-07-24  9:21   ` Patchtest results for " patchtest
2026-07-24  9:01 ` [PATCH v4 10/10] packagegroup-cross-canadian: gate gdb " Trevor Woerner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260724090146.19924-2-twoerner@gmail.com \
    --to=twoerner@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox