openembedded-core.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/6] wic: ship the tools it invokes
@ 2026-07-31 15:28 Trevor Woerner
  2026-07-31 15:28 ` [PATCH v5 1/6] wic-tools: drop the target bootloader firmware Trevor Woerner
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Trevor Woerner @ 2026-07-31 15:28 UTC (permalink / raw)
  To: openembedded-core

wic shells out to a range of host tools but does not declare them, so
wherever it is installed as a package it works only by chance depending
on what the host has installed. The do_image_wic task does not have that
problem: image_types_wic.bbclass makes the image recipe depend on the
-native recipe of each tool, so they are all in the image's own native
sysroot by the time wic runs. Nothing outside that task gets the same
treatment.

Patch 1 narrows wic-tools to staging wic's host tools: the target
bootloader firmware (syslinux, grub-efi, systemd-boot) it depended on
for the wic oe-selftest is now built by that oe-selftest instead. Which
firmware is needed depends on the plugins a .wks uses, so it belongs to
whoever supplies the .wks, not to wic-tools. Images already work that
way through WKS_FILE_DEPENDS in image_types_wic.bbclass, and now the
oe-selftest does too.

Patch 2 gives that tool list a single home. It was written out three
times -- in wic-tools, in image_types_wic.bbclass and (as of patch 3)
in the wic recipe -- and the copies had already drifted.

Patch 3 makes wic declare the host tools it runs as RDEPENDS, so they
are installed alongside it in every variant that packages it.

Patches 4 and 5 are follow-on cleanups of the wic oe-selftest: drop a
dead in-tree wic lookup, and drop the redundant per-test PATH overrides
that duplicated what the test setup already establishes.

Patch 6 fixes a dependency that has been on the wrong axis since 2019:
an image depends on syslinux-native when the build host is x86, but it
is the target that decides whether a .wks needs it, so an x86 image
built on a non-x86 host ends up with the bootloader but not the
installer. That is bug 16383, which carries the full history:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=16383

Should wic-tools be renamed? Nothing but the wic oe-selftest has used it
since 2017, when do_image_wic stopped depending on it, and it already
sits in meta/recipes-core/meta/ alongside meta-environment,
meta-ide-support and meta-toolchain without following their naming.
meta-wic-support would fit better, but it is a user-visible rename, so I
would rather hear objections before doing it.

changes in v5:
- the SDK_FEATURES half of the v4 series (patches 5 to 10) is not here.
  Reworking it to resolve features at the class level, as review asked,
  turned it into a larger piece of work than the wic changes it was
  travelling with, so it is being finished and sent as its own series.
- new patch 2: one shared list of the tools wic runs, replacing the
  three copies that had drifted apart. Images gain tar-native and
  util-linux-native, which only wic-tools staged before.
- new patch 6: gate syslinux-native on the target rather than the build
  host [YOCTO #13276]
- wic RDEPENDS patch: drop the bootloader (grub, syslinux) RDEPENDS
  entirely; wic declares only the host tools it runs. The bootloader
  firmware wic copies into an image is the responsibility of whatever
  drives wic (the oe-selftest, and image_types_wic.bbclass via
  WKS_FILE_DEPENDS), not of the wic package. This also removes the
  arch-gating that the v4 grub/syslinux RDEPENDS required.
- drastically trimmed the commit messages and in-tree comments
  throughout the series

changes in v4:
- new patch 1: move the target bootloader firmware out of wic-tools and
  stage it from the wic oe-selftest instead, so wic-tools carries only
  the host tools wic runs
- new selftest cleanups (drop the dead COREBASE/scripts wic lookup and
  the redundant per-test PATH overrides)

changes in v3:
- list the tools on all variants rather than only the nativesdk variant

changes in v2:
- dropped the wic-tools.inc refactor; folded the tool list into the wic
  recipe
- reworked the buildtools-extended-tarball change into a plain removal

Trevor Woerner (6):
  wic-tools: drop the target bootloader firmware
  wic: add a shared helper tool list
  wic: add runtime dependencies on the tools it invokes
  oeqa/selftest/wic: drop dead COREBASE/scripts wic lookup
  oeqa/selftest/wic: drop redundant per-test PATH overrides
  wic: gate syslinux-native on the target, not the build host

 meta/classes-recipe/image_types_wic.bbclass |   8 +-
 meta/conf/wic-helper-tools.inc              |  22 +
 meta/lib/oeqa/selftest/cases/wic.py         | 842 +++++++++-----------
 meta/recipes-core/meta/wic-tools.bb         |  12 +-
 meta/recipes-support/wic/wic_0.3.1.bb       |   3 +
 5 files changed, 425 insertions(+), 462 deletions(-)
 create mode 100644 meta/conf/wic-helper-tools.inc

-- 
2.50.0.173.g8b6f19ccfc3a



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

* [PATCH v5 1/6] wic-tools: drop the target bootloader firmware
  2026-07-31 15:28 [PATCH v5 0/6] wic: ship the tools it invokes Trevor Woerner
@ 2026-07-31 15:28 ` Trevor Woerner
  2026-07-31 15:28 ` [PATCH v5 2/6] wic: add a shared helper tool list Trevor Woerner
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Trevor Woerner @ 2026-07-31 15:28 UTC (permalink / raw)
  To: openembedded-core

wic-tools should stage only wic's host tools, but its arch-specific
appends also depended on target bootloader firmware (syslinux, grub-efi,
systemd-boot) solely for the wic oe-selftest. Which firmware is needed
depends on the plugins a .wks uses, so that firmware is the
responsibility of whoever supplies the .wks, not of wic-tools. Have the
oe-selftest bitbake those recipes itself instead.

Images already work that way through WKS_FILE_DEPENDS in
image_types_wic.bbclass, and the oe-selftest now does the equivalent,
adding syslinux to core-image-minimal's DEPENDS where the tests expect
it in the recipe sysroot.

AI-Generated: codex/claude-opus 5 (xhigh)
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
changes in v5:
- trimmed the commit message and in-tree comments

changes in v4:
- new in v4
---
 meta/lib/oeqa/selftest/cases/wic.py | 33 +++++++++++++++++++++++------
 meta/recipes-core/meta/wic-tools.bb |  7 +++---
 2 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index 4e94f4d39abd..f9b893fc8581 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -72,12 +72,23 @@ 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'
+            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):
+        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 +402,13 @@ 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'],
+        # wic expects syslinux in core-image-minimal's recipe sysroot.
+        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 +509,13 @@ 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'],
+        # wic expects syslinux in core-image-minimal's recipe sysroot.
+        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..c6e3d1b419dc 100644
--- a/meta/recipes-core/meta/wic-tools.bb
+++ b/meta/recipes-core/meta/wic-tools.bb
@@ -10,10 +10,9 @@ 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"
+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



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

* [PATCH v5 2/6] wic: add a shared helper tool list
  2026-07-31 15:28 [PATCH v5 0/6] wic: ship the tools it invokes Trevor Woerner
  2026-07-31 15:28 ` [PATCH v5 1/6] wic-tools: drop the target bootloader firmware Trevor Woerner
@ 2026-07-31 15:28 ` Trevor Woerner
  2026-07-31 15:28 ` [PATCH v5 3/6] wic: add runtime dependencies on the tools it invokes Trevor Woerner
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Trevor Woerner @ 2026-07-31 15:28 UTC (permalink / raw)
  To: openembedded-core

The tools wic shells out to are listed in both wic-tools and
image_types_wic.bbclass, and the copies have drifted. Add
conf/wic-helper-tools.inc as the single source of truth.

Only wic-tools staged tar-native and util-linux-native before; images
now get them too.

AI-Generated: codex/claude-opus 5 (xhigh)
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
changes in v5:
- new in v5
---
 meta/classes-recipe/image_types_wic.bbclass |  5 +++--
 meta/conf/wic-helper-tools.inc              | 16 ++++++++++++++++
 meta/recipes-core/meta/wic-tools.bb         |  7 +++----
 3 files changed, 22 insertions(+), 6 deletions(-)
 create mode 100644 meta/conf/wic-helper-tools.inc

diff --git a/meta/classes-recipe/image_types_wic.bbclass b/meta/classes-recipe/image_types_wic.bbclass
index ea8c1c94ca2f..3f25b7912b26 100644
--- a/meta/classes-recipe/image_types_wic.bbclass
+++ b/meta/classes-recipe/image_types_wic.bbclass
@@ -112,14 +112,15 @@ do_image_wic[cleandirs] = "${WORKDIR}/build-wic"
 USING_WIC = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic ' + ' '.join('wic.%s' % c for c in '${CONVERSIONTYPES}'.split()), '1', '', d)}"
 WKS_FILE_CHECKSUM = "${@wks_checksums(d.getVar('WKS_FILES').split(), d.getVar('WKS_SEARCH_PATH')) if '${USING_WIC}' else ''}"
 do_image_wic[file-checksums] += "${WKS_FILE_CHECKSUM}"
-do_image_wic[depends] += "${@' '.join('%s-native:do_populate_sysroot' % r for r in ('wic', 'parted', 'gptfdisk', 'dosfstools', 'mtools'))}"
+
+require conf/wic-helper-tools.inc
+do_image_wic[depends] += "${@' '.join('%s:do_populate_sysroot' % r for r in ('wic-native ' + d.getVar('WIC_HELPER_TOOLS_DEPENDS')).split())}"
 
 # We ensure all artfacts are deployed (e.g virtual/bootloader)
 do_image_wic[recrdeptask] += "do_deploy"
 do_image_wic[deptask] += "do_image_complete"
 
 WKS_FILE_DEPENDS_DEFAULT = '${@bb.utils.contains_any("BUILD_ARCH", [ 'x86_64', 'i686' ], "syslinux-native", "",d)}'
-WKS_FILE_DEPENDS_DEFAULT += "wic-native bmaptool-native cdrtools-native btrfs-tools-native squashfs-tools-native e2fsprogs-native erofs-utils-native"
 # Unified kernel images need objcopy
 WKS_FILE_DEPENDS_DEFAULT += "virtual/cross-binutils"
 WKS_FILE_DEPENDS_BOOTLOADERS = ""
diff --git a/meta/conf/wic-helper-tools.inc b/meta/conf/wic-helper-tools.inc
new file mode 100644
index 000000000000..f3b2b698e2df
--- /dev/null
+++ b/meta/conf/wic-helper-tools.inc
@@ -0,0 +1,16 @@
+WIC_HELPER_TOOLS ?= "\
+    parted \
+    gptfdisk \
+    dosfstools \
+    mtools \
+    bmaptool \
+    btrfs-tools \
+    squashfs-tools \
+    e2fsprogs \
+    util-linux \
+    tar \
+    erofs-utils \
+"
+
+WIC_HELPER_TOOLS_NATIVE_ONLY ?= "cdrtools"
+WIC_HELPER_TOOLS_DEPENDS = "${@' '.join('%s-native' % t for t in (d.getVar('WIC_HELPER_TOOLS') + ' ' + d.getVar('WIC_HELPER_TOOLS_NATIVE_ONLY')).split())}"
diff --git a/meta/recipes-core/meta/wic-tools.bb b/meta/recipes-core/meta/wic-tools.bb
index c6e3d1b419dc..c3c39cec011d 100644
--- a/meta/recipes-core/meta/wic-tools.bb
+++ b/meta/recipes-core/meta/wic-tools.bb
@@ -2,12 +2,11 @@ SUMMARY = "A meta recipe to build native tools used by wic."
 
 LICENSE = "MIT"
 
+require conf/wic-helper-tools.inc
 DEPENDS = "\
            wic-native \
-           parted-native gptfdisk-native dosfstools-native \
-           mtools-native bmaptool-native grub-native cdrtools-native \
-           btrfs-tools-native squashfs-tools-native pseudo-native \
-           e2fsprogs-native util-linux-native tar-native erofs-utils-native \
+           ${WIC_HELPER_TOOLS_DEPENDS} \
+           grub-native pseudo-native \
            virtual/cross-binutils \
            "
 DEPENDS:append:x86 = " syslinux-native"
-- 
2.50.0.173.g8b6f19ccfc3a



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

* [PATCH v5 3/6] wic: add runtime dependencies on the tools it invokes
  2026-07-31 15:28 [PATCH v5 0/6] wic: ship the tools it invokes Trevor Woerner
  2026-07-31 15:28 ` [PATCH v5 1/6] wic-tools: drop the target bootloader firmware Trevor Woerner
  2026-07-31 15:28 ` [PATCH v5 2/6] wic: add a shared helper tool list Trevor Woerner
@ 2026-07-31 15:28 ` Trevor Woerner
  2026-07-31 15:28 ` [PATCH v5 4/6] oeqa/selftest/wic: drop dead COREBASE/scripts wic lookup Trevor Woerner
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Trevor Woerner @ 2026-07-31 15:28 UTC (permalink / raw)
  To: openembedded-core

wic shells out to a range of host tools (parted, mkfs.*, mcopy, sfdisk,
and more) but, since the recipe was created, has declared none of them,
so an installed wic works only by chance depending on what the host
provides. Declare them as RDEPENDS so they are installed with wic.

AI-Generated: codex/claude-opus 4.8 (xhigh)
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
changes in v5:
- take the tool list from the shared conf/wic-helper-tools.inc
- drop the bootloader (grub, syslinux) RDEPENDS entirely; declare only
  the host tools wic runs
- trimmed the commit message; dropped the in-recipe comments

changes in v4:
- gate grub to x86 and aarch64; move syslinux into the same arch-gated
  appends
- also depend on syslinux-isolinux for isolinux.bin

changes in v3:
- list the tools on all variants rather than only the nativesdk variant

changes in v2:
- merge the tool list into the wic recipe as RDEPENDS; drop the separate
  .inc
---
 meta/conf/wic-helper-tools.inc        | 3 +++
 meta/recipes-support/wic/wic_0.3.1.bb | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/meta/conf/wic-helper-tools.inc b/meta/conf/wic-helper-tools.inc
index f3b2b698e2df..66f2f1b2bddc 100644
--- a/meta/conf/wic-helper-tools.inc
+++ b/meta/conf/wic-helper-tools.inc
@@ -14,3 +14,6 @@ WIC_HELPER_TOOLS ?= "\
 
 WIC_HELPER_TOOLS_NATIVE_ONLY ?= "cdrtools"
 WIC_HELPER_TOOLS_DEPENDS = "${@' '.join('%s-native' % t for t in (d.getVar('WIC_HELPER_TOOLS') + ' ' + d.getVar('WIC_HELPER_TOOLS_NATIVE_ONLY')).split())}"
+
+WIC_HELPER_TOOLS_PACKAGE_ONLY ?= "e2fsprogs-resize2fs"
+WIC_HELPER_TOOLS_RDEPENDS = "${WIC_HELPER_TOOLS} ${WIC_HELPER_TOOLS_PACKAGE_ONLY}"
diff --git a/meta/recipes-support/wic/wic_0.3.1.bb b/meta/recipes-support/wic/wic_0.3.1.bb
index d9b4cc05c4bd..d8b8c6905d87 100644
--- a/meta/recipes-support/wic/wic_0.3.1.bb
+++ b/meta/recipes-support/wic/wic_0.3.1.bb
@@ -10,11 +10,14 @@ CVE_PRODUCT = "yoctoproject:wic"
 
 inherit python_hatchling
 
+require conf/wic-helper-tools.inc
+
 RDEPENDS:${PN} += " \
     python3-core \
     python3-json \
     python3-logging \
     python3-misc \
+    ${WIC_HELPER_TOOLS_RDEPENDS} \
     "
 
 BBCLASSEXTEND = "native nativesdk"
-- 
2.50.0.173.g8b6f19ccfc3a



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

* [PATCH v5 4/6] oeqa/selftest/wic: drop dead COREBASE/scripts wic lookup
  2026-07-31 15:28 [PATCH v5 0/6] wic: ship the tools it invokes Trevor Woerner
                   ` (2 preceding siblings ...)
  2026-07-31 15:28 ` [PATCH v5 3/6] wic: add runtime dependencies on the tools it invokes Trevor Woerner
@ 2026-07-31 15:28 ` Trevor Woerner
  2026-07-31 15:28 ` [PATCH v5 5/6] oeqa/selftest/wic: drop redundant per-test PATH overrides Trevor Woerner
  2026-07-31 15:28 ` [PATCH v5 6/6] wic: gate syslinux-native on the target, not the build host Trevor Woerner
  5 siblings, 0 replies; 7+ messages in thread
From: Trevor Woerner @ 2026-07-31 15:28 UTC (permalink / raw)
  To: openembedded-core

wic moved to a standalone repository and is no longer shipped in
scripts/, so that search path can never match. Look for wic only in the
wic-tools native sysroot.

AI-Generated: codex/claude-opus 4.8 (xhigh)
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
changes in v5:
- trimmed the commit message

changes in v4:
- new in v4
---
 meta/lib/oeqa/selftest/cases/wic.py | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index f9b893fc8581..8a39a4ddc603 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -100,18 +100,11 @@ class WicTestCase(OESelftestTestCase):
 
     def _get_wic_path(self):
         if WicTestCase.wic_bindir is None:
-            search_paths = [
-                os.path.join(self.td['COREBASE'], 'scripts'),
-                os.path.join(get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools'), 'usr', 'bin'),
-            ]
-
-            for bindir in search_paths:
-                if os.path.exists(os.path.join(bindir, 'wic')):
-                    WicTestCase.wic_bindir = bindir
-                    break
-
-            if WicTestCase.wic_bindir is None:
-                self.fail("Unable to find the wic binary in %s" % ', '.join(search_paths))
+            bindir = os.path.join(get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools'),
+                                  'usr', 'bin')
+            if not os.path.exists(os.path.join(bindir, 'wic')):
+                self.fail("Unable to find the wic binary in %s" % bindir)
+            WicTestCase.wic_bindir = bindir
 
         path_entries = []
         for path_group in (
-- 
2.50.0.173.g8b6f19ccfc3a



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

* [PATCH v5 5/6] oeqa/selftest/wic: drop redundant per-test PATH overrides
  2026-07-31 15:28 [PATCH v5 0/6] wic: ship the tools it invokes Trevor Woerner
                   ` (3 preceding siblings ...)
  2026-07-31 15:28 ` [PATCH v5 4/6] oeqa/selftest/wic: drop dead COREBASE/scripts wic lookup Trevor Woerner
@ 2026-07-31 15:28 ` Trevor Woerner
  2026-07-31 15:28 ` [PATCH v5 6/6] wic: gate syslinux-native on the target, not the build host Trevor Woerner
  5 siblings, 0 replies; 7+ messages in thread
From: Trevor Woerner @ 2026-07-31 15:28 UTC (permalink / raw)
  To: openembedded-core

setUpLocal() already puts wic and its tools on PATH for every test, so
the per-test "os.environ['PATH'] = get_bb_var('PATH', 'wic-tools')"
overrides and their try/finally wrappers add nothing. Drop them; the
resulting dedent makes the diff large, so review with git show -w.

AI-Generated: codex/claude-opus 4.8 (xhigh)
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
changes in v5:
- trimmed the commit message

changes in v4:
- new in v4
---
 meta/lib/oeqa/selftest/cases/wic.py | 792 +++++++++++++---------------
 1 file changed, 362 insertions(+), 430 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index 8a39a4ddc603..5b90c64cfd6b 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -525,104 +525,97 @@ class Wic(WicTestCase):
     def test_exclude_path(self):
         """Test --exclude-path wks option."""
 
-        oldpath = os.environ['PATH']
-        os.environ['PATH'] = get_bb_var("PATH", "wic-tools")
-
-        try:
-            wks_file = 'temp.wks'
-            with open(wks_file, 'w') as wks:
-                rootfs_dir = get_bb_var('IMAGE_ROOTFS', 'core-image-minimal')
-                wks.write("""
+        wks_file = 'temp.wks'
+        with open(wks_file, 'w') as wks:
+            rootfs_dir = get_bb_var('IMAGE_ROOTFS', 'core-image-minimal')
+            wks.write("""
 part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path usr
 part /usr --source rootfs --ondisk mmcblk0 --fstype=ext4 --rootfs-dir %s/usr
 part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --rootfs-dir %s/usr
 part /mnt --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/whoami --rootfs-dir %s/usr"""
-                          % (rootfs_dir, rootfs_dir, rootfs_dir))
-            runCmd("wic create %s -e core-image-minimal -o %s" \
-                                       % (wks_file, self.resultdir))
-
-            os.remove(wks_file)
-            wicout = glob(os.path.join(self.resultdir, "%s-*direct" % 'temp'))
-            self.assertEqual(1, len(wicout))
+                      % (rootfs_dir, rootfs_dir, rootfs_dir))
+        runCmd("wic create %s -e core-image-minimal -o %s" \
+                                   % (wks_file, self.resultdir))
 
-            wicimg = wicout[0]
-
-            # verify partition size with wic
-            res = runCmd("parted -m %s unit b p" % wicimg, stderr=subprocess.PIPE)
-
-            # parse parted output which looks like this:
-            # BYT;\n
-            # /var/tmp/wic/build/tmpfwvjjkf_-201611101222-hda.direct:200MiB:file:512:512:msdos::;\n
-            # 1:0.00MiB:200MiB:200MiB:ext4::;\n
-            partlns = res.output.splitlines()[2:]
+        os.remove(wks_file)
+        wicout = glob(os.path.join(self.resultdir, "%s-*direct" % 'temp'))
+        self.assertEqual(1, len(wicout))
 
-            self.assertEqual(4, len(partlns))
+        wicimg = wicout[0]
 
-            for part in [1, 2, 3, 4]:
-                part_file = os.path.join(self.resultdir, "selftest_img.part%d" % part)
-                partln = partlns[part-1].split(":")
-                self.assertEqual(7, len(partln))
-                start = int(partln[1].rstrip("B")) / 512
-                length = int(partln[3].rstrip("B")) / 512
-                runCmd("dd if=%s of=%s skip=%d count=%d" %
-                                           (wicimg, part_file, start, length))
-
-            # Test partition 1, should contain the normal root directories, except
-            # /usr.
-            res = runCmd("debugfs -R 'ls -p' %s" % \
-                             os.path.join(self.resultdir, "selftest_img.part1"), stderr=subprocess.PIPE)
-            files = extract_files(res.output)
-            self.assertIn("etc", files)
-            self.assertNotIn("usr", files)
-
-            # Partition 2, should contain common directories for /usr, not root
-            # directories.
-            res = runCmd("debugfs -R 'ls -p' %s" % \
-                             os.path.join(self.resultdir, "selftest_img.part2"), stderr=subprocess.PIPE)
-            files = extract_files(res.output)
-            self.assertNotIn("etc", files)
-            self.assertNotIn("usr", files)
-            self.assertIn("share", files)
-
-            # Partition 3, should contain the same as partition 2, including the bin
-            # directory, but not the files inside it.
-            res = runCmd("debugfs -R 'ls -p' %s" % \
-                             os.path.join(self.resultdir, "selftest_img.part3"), stderr=subprocess.PIPE)
-            files = extract_files(res.output)
-            self.assertNotIn("etc", files)
-            self.assertNotIn("usr", files)
-            self.assertIn("share", files)
-            self.assertIn("bin", files)
-            res = runCmd("debugfs -R 'ls -p bin' %s" % \
-                             os.path.join(self.resultdir, "selftest_img.part3"), stderr=subprocess.PIPE)
-            files = extract_files(res.output)
-            self.assertIn(".", files)
-            self.assertIn("..", files)
-            self.assertEqual(2, len(files))
-
-            # Partition 4, should contain the same as partition 2, including the bin
-            # directory, but not whoami (a symlink to busybox.nosuid) inside it.
-            res = runCmd("debugfs -R 'ls -p' %s" % \
-                             os.path.join(self.resultdir, "selftest_img.part4"), stderr=subprocess.PIPE)
-            files = extract_files(res.output)
-            self.assertNotIn("etc", files)
-            self.assertNotIn("usr", files)
-            self.assertIn("share", files)
-            self.assertIn("bin", files)
-            res = runCmd("debugfs -R 'ls -p bin' %s" % \
-                             os.path.join(self.resultdir, "selftest_img.part4"), stderr=subprocess.PIPE)
-            files = extract_files(res.output)
-            self.assertIn(".", files)
-            self.assertIn("..", files)
-            self.assertIn("who", files)
-            self.assertNotIn("whoami", files)
-
-            for part in [1, 2, 3, 4]:
-                part_file = os.path.join(self.resultdir, "selftest_img.part%d" % part)
-                os.remove(part_file)
+        # verify partition size with wic
+        res = runCmd("parted -m %s unit b p" % wicimg, stderr=subprocess.PIPE)
 
-        finally:
-            os.environ['PATH'] = oldpath
+        # parse parted output which looks like this:
+        # BYT;\n
+        # /var/tmp/wic/build/tmpfwvjjkf_-201611101222-hda.direct:200MiB:file:512:512:msdos::;\n
+        # 1:0.00MiB:200MiB:200MiB:ext4::;\n
+        partlns = res.output.splitlines()[2:]
+
+        self.assertEqual(4, len(partlns))
+
+        for part in [1, 2, 3, 4]:
+            part_file = os.path.join(self.resultdir, "selftest_img.part%d" % part)
+            partln = partlns[part-1].split(":")
+            self.assertEqual(7, len(partln))
+            start = int(partln[1].rstrip("B")) / 512
+            length = int(partln[3].rstrip("B")) / 512
+            runCmd("dd if=%s of=%s skip=%d count=%d" %
+                                       (wicimg, part_file, start, length))
+
+        # Test partition 1, should contain the normal root directories, except
+        # /usr.
+        res = runCmd("debugfs -R 'ls -p' %s" % \
+                         os.path.join(self.resultdir, "selftest_img.part1"), stderr=subprocess.PIPE)
+        files = extract_files(res.output)
+        self.assertIn("etc", files)
+        self.assertNotIn("usr", files)
+
+        # Partition 2, should contain common directories for /usr, not root
+        # directories.
+        res = runCmd("debugfs -R 'ls -p' %s" % \
+                         os.path.join(self.resultdir, "selftest_img.part2"), stderr=subprocess.PIPE)
+        files = extract_files(res.output)
+        self.assertNotIn("etc", files)
+        self.assertNotIn("usr", files)
+        self.assertIn("share", files)
+
+        # Partition 3, should contain the same as partition 2, including the bin
+        # directory, but not the files inside it.
+        res = runCmd("debugfs -R 'ls -p' %s" % \
+                         os.path.join(self.resultdir, "selftest_img.part3"), stderr=subprocess.PIPE)
+        files = extract_files(res.output)
+        self.assertNotIn("etc", files)
+        self.assertNotIn("usr", files)
+        self.assertIn("share", files)
+        self.assertIn("bin", files)
+        res = runCmd("debugfs -R 'ls -p bin' %s" % \
+                         os.path.join(self.resultdir, "selftest_img.part3"), stderr=subprocess.PIPE)
+        files = extract_files(res.output)
+        self.assertIn(".", files)
+        self.assertIn("..", files)
+        self.assertEqual(2, len(files))
+
+        # Partition 4, should contain the same as partition 2, including the bin
+        # directory, but not whoami (a symlink to busybox.nosuid) inside it.
+        res = runCmd("debugfs -R 'ls -p' %s" % \
+                         os.path.join(self.resultdir, "selftest_img.part4"), stderr=subprocess.PIPE)
+        files = extract_files(res.output)
+        self.assertNotIn("etc", files)
+        self.assertNotIn("usr", files)
+        self.assertIn("share", files)
+        self.assertIn("bin", files)
+        res = runCmd("debugfs -R 'ls -p bin' %s" % \
+                         os.path.join(self.resultdir, "selftest_img.part4"), stderr=subprocess.PIPE)
+        files = extract_files(res.output)
+        self.assertIn(".", files)
+        self.assertIn("..", files)
+        self.assertIn("who", files)
+        self.assertNotIn("whoami", files)
+
+        for part in [1, 2, 3, 4]:
+            part_file = os.path.join(self.resultdir, "selftest_img.part%d" % part)
+            os.remove(part_file)
 
     def test_exclude_path_with_extra_space(self):
         """Test having --exclude-path with IMAGE_ROOTFS_EXTRA_SPACE. [Yocto #15555]"""
@@ -661,75 +654,61 @@ part /mnt --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/whoa
     def test_include_path(self):
         """Test --include-path wks option."""
 
-        oldpath = os.environ['PATH']
-        os.environ['PATH'] = get_bb_var("PATH", "wic-tools")
-
-        try:
-            include_path = os.path.join(self.resultdir, 'test-include')
-            os.makedirs(include_path)
-            with open(os.path.join(include_path, 'test-file'), 'w') as t:
-                t.write("test\n")
-            wks_file = os.path.join(include_path, 'temp.wks')
-            with open(wks_file, 'w') as wks:
-                rootfs_dir = get_bb_var('IMAGE_ROOTFS', 'core-image-minimal')
-                wks.write("""
+        include_path = os.path.join(self.resultdir, 'test-include')
+        os.makedirs(include_path)
+        with open(os.path.join(include_path, 'test-file'), 'w') as t:
+            t.write("test\n")
+        wks_file = os.path.join(include_path, 'temp.wks')
+        with open(wks_file, 'w') as wks:
+            rootfs_dir = get_bb_var('IMAGE_ROOTFS', 'core-image-minimal')
+            wks.write("""
 part /part1 --source rootfs --ondisk mmcblk0 --fstype=ext4
 part /part2 --source rootfs --ondisk mmcblk0 --fstype=ext4 --include-path %s"""
-                          % (include_path))
-            runCmd("wic create %s -e core-image-minimal -o %s" \
-                                       % (wks_file, self.resultdir))
-
-            part1 = glob(os.path.join(self.resultdir, 'temp-*.direct.p1'))[0]
-            part2 = glob(os.path.join(self.resultdir, 'temp-*.direct.p2'))[0]
+                      % (include_path))
+        runCmd("wic create %s -e core-image-minimal -o %s" \
+                                   % (wks_file, self.resultdir))
 
-            # Test partition 1, should not contain 'test-file'
-            res = runCmd("debugfs -R 'ls -p' %s" % (part1), stderr=subprocess.PIPE)
-            files = extract_files(res.output)
-            self.assertNotIn('test-file', files)
-            self.assertEqual(True, files_own_by_root(res.output))
+        part1 = glob(os.path.join(self.resultdir, 'temp-*.direct.p1'))[0]
+        part2 = glob(os.path.join(self.resultdir, 'temp-*.direct.p2'))[0]
 
-            # Test partition 2, should contain 'test-file'
-            res = runCmd("debugfs -R 'ls -p' %s" % (part2), stderr=subprocess.PIPE)
-            files = extract_files(res.output)
-            self.assertIn('test-file', files)
-            self.assertEqual(True, files_own_by_root(res.output))
+        # Test partition 1, should not contain 'test-file'
+        res = runCmd("debugfs -R 'ls -p' %s" % (part1), stderr=subprocess.PIPE)
+        files = extract_files(res.output)
+        self.assertNotIn('test-file', files)
+        self.assertEqual(True, files_own_by_root(res.output))
 
-        finally:
-            os.environ['PATH'] = oldpath
+        # Test partition 2, should contain 'test-file'
+        res = runCmd("debugfs -R 'ls -p' %s" % (part2), stderr=subprocess.PIPE)
+        files = extract_files(res.output)
+        self.assertIn('test-file', files)
+        self.assertEqual(True, files_own_by_root(res.output))
 
     def test_include_path_embeded(self):
         """Test --include-path wks option."""
 
-        oldpath = os.environ['PATH']
-        os.environ['PATH'] = get_bb_var("PATH", "wic-tools")
-
-        try:
-            include_path = os.path.join(self.resultdir, 'test-include')
-            os.makedirs(include_path)
-            with open(os.path.join(include_path, 'test-file'), 'w') as t:
-                t.write("test\n")
-            wks_file = os.path.join(include_path, 'temp.wks')
-            with open(wks_file, 'w') as wks:
-                wks.write("""
+        include_path = os.path.join(self.resultdir, 'test-include')
+        os.makedirs(include_path)
+        with open(os.path.join(include_path, 'test-file'), 'w') as t:
+            t.write("test\n")
+        wks_file = os.path.join(include_path, 'temp.wks')
+        with open(wks_file, 'w') as wks:
+            wks.write("""
 part / --source rootfs  --fstype=ext4 --include-path %s --include-path core-image-minimal-mtdutils export/"""
-                          % (include_path))
-            runCmd("wic create %s -e core-image-minimal -o %s" \
-                                       % (wks_file, self.resultdir))
-
-            part1 = glob(os.path.join(self.resultdir, 'temp-*.direct.p1'))[0]
+                      % (include_path))
+        runCmd("wic create %s -e core-image-minimal -o %s" \
+                                   % (wks_file, self.resultdir))
 
-            res = runCmd("debugfs -R 'ls -p' %s" % (part1), stderr=subprocess.PIPE)
-            files = extract_files(res.output)
-            self.assertIn('test-file', files)
-            self.assertEqual(True, files_own_by_root(res.output))
+        part1 = glob(os.path.join(self.resultdir, 'temp-*.direct.p1'))[0]
 
-            res = runCmd("debugfs -R 'ls -p /export/etc/' %s" % (part1), stderr=subprocess.PIPE)
-            files = extract_files(res.output)
-            self.assertIn('passwd', files)
-            self.assertEqual(True, files_own_by_root(res.output))
+        res = runCmd("debugfs -R 'ls -p' %s" % (part1), stderr=subprocess.PIPE)
+        files = extract_files(res.output)
+        self.assertIn('test-file', files)
+        self.assertEqual(True, files_own_by_root(res.output))
 
-        finally:
-            os.environ['PATH'] = oldpath
+        res = runCmd("debugfs -R 'ls -p /export/etc/' %s" % (part1), stderr=subprocess.PIPE)
+        files = extract_files(res.output)
+        self.assertIn('passwd', files)
+        self.assertEqual(True, files_own_by_root(res.output))
 
     def test_include_path_errors(self):
         """Test --include-path wks option error handling."""
@@ -780,9 +759,6 @@ part / --source rootfs  --fstype=ext4 --include-path %s --include-path core-imag
         # prepare wicenv and rootfs
         bitbake('core-image-minimal core-image-minimal-mtdutils -c do_rootfs_wicenv')
 
-        oldpath = os.environ['PATH']
-        os.environ['PATH'] = get_bb_var("PATH", "wic-tools")
-
         t_normal = """
 part / --source rootfs --fstype=ext4
 """
@@ -799,61 +775,50 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc
 """
         tests = [t_normal, t_exclude, t_multi, t_change]
 
-        try:
-            for test in tests:
-                include_path = os.path.join(self.resultdir, 'test-include')
-                os.makedirs(include_path)
-                wks_file = os.path.join(include_path, 'temp.wks')
-                with open(wks_file, 'w') as wks:
-                    wks.write(test)
-                runCmd("wic create %s -e core-image-minimal -o %s" \
-                                       % (wks_file, self.resultdir))
-
-                for part in glob(os.path.join(self.resultdir, 'temp-*.direct.p*')):
-                    res = runCmd("debugfs -R 'ls -p' %s" % (part), stderr=subprocess.PIPE)
-                    self.assertEqual(True, files_own_by_root(res.output))
+        for test in tests:
+            include_path = os.path.join(self.resultdir, 'test-include')
+            os.makedirs(include_path)
+            wks_file = os.path.join(include_path, 'temp.wks')
+            with open(wks_file, 'w') as wks:
+                wks.write(test)
+            runCmd("wic create %s -e core-image-minimal -o %s" \
+                                   % (wks_file, self.resultdir))
 
-                config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "%s"\n' % wks_file
-                self.append_config(config)
-                bitbake('core-image-minimal')
-                tmpdir = os.path.join(get_bb_var('WORKDIR', 'core-image-minimal'),'build-wic')
+            for part in glob(os.path.join(self.resultdir, 'temp-*.direct.p*')):
+                res = runCmd("debugfs -R 'ls -p' %s" % (part), stderr=subprocess.PIPE)
+                self.assertEqual(True, files_own_by_root(res.output))
 
-                # check each partition for permission
-                for part in glob(os.path.join(tmpdir, 'temp-*.direct.p*')):
-                    res = runCmd("debugfs -R 'ls -p' %s" % (part), stderr=subprocess.PIPE)
-                    self.assertTrue(files_own_by_root(res.output)
-                        ,msg='Files permission incorrect using wks set "%s"' % test)
+            config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "%s"\n' % wks_file
+            self.append_config(config)
+            bitbake('core-image-minimal')
+            tmpdir = os.path.join(get_bb_var('WORKDIR', 'core-image-minimal'),'build-wic')
 
-                # clean config and result directory for next cases
-                self.remove_config(config)
-                rmtree(self.resultdir, ignore_errors=True)
+            # check each partition for permission
+            for part in glob(os.path.join(tmpdir, 'temp-*.direct.p*')):
+                res = runCmd("debugfs -R 'ls -p' %s" % (part), stderr=subprocess.PIPE)
+                self.assertTrue(files_own_by_root(res.output)
+                    ,msg='Files permission incorrect using wks set "%s"' % test)
 
-        finally:
-            os.environ['PATH'] = oldpath
+            # clean config and result directory for next cases
+            self.remove_config(config)
+            rmtree(self.resultdir, ignore_errors=True)
 
     def test_change_directory(self):
         """Test --change-directory wks option."""
 
-        oldpath = os.environ['PATH']
-        os.environ['PATH'] = get_bb_var("PATH", "wic-tools")
-
-        try:
-            include_path = os.path.join(self.resultdir, 'test-include')
-            os.makedirs(include_path)
-            wks_file = os.path.join(include_path, 'temp.wks')
-            with open(wks_file, 'w') as wks:
-                wks.write("part /etc --source rootfs --fstype=ext4 --change-directory=etc")
-            runCmd("wic create %s -e core-image-minimal -o %s" \
-                                       % (wks_file, self.resultdir))
-
-            part1 = glob(os.path.join(self.resultdir, 'temp-*.direct.p1'))[0]
+        include_path = os.path.join(self.resultdir, 'test-include')
+        os.makedirs(include_path)
+        wks_file = os.path.join(include_path, 'temp.wks')
+        with open(wks_file, 'w') as wks:
+            wks.write("part /etc --source rootfs --fstype=ext4 --change-directory=etc")
+        runCmd("wic create %s -e core-image-minimal -o %s" \
+                                   % (wks_file, self.resultdir))
 
-            res = runCmd("debugfs -R 'ls -p' %s" % (part1), stderr=subprocess.PIPE)
-            files = extract_files(res.output)
-            self.assertIn('passwd', files)
+        part1 = glob(os.path.join(self.resultdir, 'temp-*.direct.p1'))[0]
 
-        finally:
-            os.environ['PATH'] = oldpath
+        res = runCmd("debugfs -R 'ls -p' %s" % (part1), stderr=subprocess.PIPE)
+        files = extract_files(res.output)
+        self.assertIn('passwd', files)
 
     def test_change_directory_errors(self):
         """Test --change-directory wks option error handling."""
@@ -876,41 +841,34 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc
     def test_no_fstab_update(self):
         """Test --no-fstab-update wks option."""
 
-        oldpath = os.environ['PATH']
-        os.environ['PATH'] = get_bb_var("PATH", "wic-tools")
-
         # Get stock fstab from base-files recipe
         bitbake('base-files -c do_install')
         bf_fstab = os.path.join(get_bb_var('D', 'base-files'), 'etc', 'fstab')
         self.assertEqual(True, os.path.exists(bf_fstab))
         bf_fstab_md5sum = runCmd('md5sum %s ' % bf_fstab).output.split(" ")[0]
 
-        try:
-            no_fstab_update_path = os.path.join(self.resultdir, 'test-no-fstab-update')
-            os.makedirs(no_fstab_update_path)
-            wks_file = os.path.join(no_fstab_update_path, 'temp.wks')
-            with open(wks_file, 'w') as wks:
-                wks.writelines(['part / --source rootfs --fstype=ext4 --label rootfs\n',
-                                'part /mnt/p2 --source rootfs --rootfs-dir=core-image-minimal ',
-                                '--fstype=ext4 --label p2 --no-fstab-update\n'])
-            runCmd("wic create %s -e core-image-minimal -o %s" \
-                                       % (wks_file, self.resultdir))
-
-            part_fstab_md5sum = []
-            for i in range(1, 3):
-                part = glob(os.path.join(self.resultdir, 'temp-*.direct.p') + str(i))[0]
-                part_fstab = runCmd("debugfs -R 'cat etc/fstab' %s" % (part), stderr=subprocess.PIPE)
-                part_fstab_md5sum.append(hashlib.md5((part_fstab.output + "\n\n").encode('utf-8')).hexdigest())
+        no_fstab_update_path = os.path.join(self.resultdir, 'test-no-fstab-update')
+        os.makedirs(no_fstab_update_path)
+        wks_file = os.path.join(no_fstab_update_path, 'temp.wks')
+        with open(wks_file, 'w') as wks:
+            wks.writelines(['part / --source rootfs --fstype=ext4 --label rootfs\n',
+                            'part /mnt/p2 --source rootfs --rootfs-dir=core-image-minimal ',
+                            '--fstype=ext4 --label p2 --no-fstab-update\n'])
+        runCmd("wic create %s -e core-image-minimal -o %s" \
+                                   % (wks_file, self.resultdir))
 
-            # '/etc/fstab' in partition 2 should contain the same stock fstab file
-            # as the one installed by the base-file recipe.
-            self.assertEqual(bf_fstab_md5sum, part_fstab_md5sum[1])
+        part_fstab_md5sum = []
+        for i in range(1, 3):
+            part = glob(os.path.join(self.resultdir, 'temp-*.direct.p') + str(i))[0]
+            part_fstab = runCmd("debugfs -R 'cat etc/fstab' %s" % (part), stderr=subprocess.PIPE)
+            part_fstab_md5sum.append(hashlib.md5((part_fstab.output + "\n\n").encode('utf-8')).hexdigest())
 
-            # '/etc/fstab' in partition 1 should contain an updated fstab file.
-            self.assertNotEqual(bf_fstab_md5sum, part_fstab_md5sum[0])
+        # '/etc/fstab' in partition 2 should contain the same stock fstab file
+        # as the one installed by the base-file recipe.
+        self.assertEqual(bf_fstab_md5sum, part_fstab_md5sum[1])
 
-        finally:
-            os.environ['PATH'] = oldpath
+        # '/etc/fstab' in partition 1 should contain an updated fstab file.
+        self.assertNotEqual(bf_fstab_md5sum, part_fstab_md5sum[0])
 
     def test_no_fstab_update_errors(self):
         """Test --no-fstab-update wks option error handling."""
@@ -984,153 +942,139 @@ bootloader --ptable gpt""")
     def test_wic_sector_size_env(self):
         """Test generation image sector size via environment (obsolete)"""
  
-        oldpath = os.environ['PATH']
-        os.environ['PATH'] = get_bb_var("PATH", "wic-tools")
+        # Add WIC_SECTOR_SIZE into config
+        config = 'WIC_SECTOR_SIZE = "4096"\n'\
+                 'WICVARS:append = " WIC_SECTOR_SIZE"\n'
+        self.append_config(config)
+        bitbake('core-image-minimal')
 
-        try:
-            # Add WIC_SECTOR_SIZE into config
-            config = 'WIC_SECTOR_SIZE = "4096"\n'\
-                     'WICVARS:append = " WIC_SECTOR_SIZE"\n'
-            self.append_config(config)
-            bitbake('core-image-minimal')
+        # Check WIC_SECTOR_SIZE apply to bitbake variable
+        wic_sector_size_str = get_bb_var('WIC_SECTOR_SIZE', 'core-image-minimal')
+        wic_sector_size = int(wic_sector_size_str)
+        self.assertEqual(4096, wic_sector_size)
 
-            # Check WIC_SECTOR_SIZE apply to bitbake variable
-            wic_sector_size_str = get_bb_var('WIC_SECTOR_SIZE', 'core-image-minimal')
-            wic_sector_size = int(wic_sector_size_str)
-            self.assertEqual(4096, wic_sector_size)
-
-            self.logger.info("Test wic_sector_size: %d \n" % wic_sector_size)
-
-            with NamedTemporaryFile("w", suffix=".wks") as wks:
-                wks.writelines(
-                    ['bootloader --ptable gpt\n',
-                     'part --fstype vfat --fstype vfat --label emptyfat --size 1M --mkfs-extraopts "-S 4096"\n',
-                     'part --fstype ext4 --source rootfs --label rofs-a --mkfs-extraopts "-b 4096"\n',
-                     'part --fstype ext4 --source rootfs --use-uuid --mkfs-extraopts "-b 4096"\n'])
-                wks.flush()
-                cmd = "wic create %s -e core-image-minimal -o %s" % (wks.name, self.resultdir)
-                runCmd(cmd)
-                wksname = os.path.splitext(os.path.basename(wks.name))[0]
-                images = glob(os.path.join(self.resultdir, "%s-*direct" % wksname))
-                self.assertEqual(1, len(images))
+        self.logger.info("Test wic_sector_size: %d \n" % wic_sector_size)
 
-            sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
-            # list partitions
-            result = runCmd("wic ls %s -n %s" % (images[0], sysroot))
-            print(result.output)
-            # Deprecated message + 4 lines of output: header + 3 partitions
-            self.assertEqual(5, len(result.output.split('\n')))
+        with NamedTemporaryFile("w", suffix=".wks") as wks:
+            wks.writelines(
+                ['bootloader --ptable gpt\n',
+                 'part --fstype vfat --fstype vfat --label emptyfat --size 1M --mkfs-extraopts "-S 4096"\n',
+                 'part --fstype ext4 --source rootfs --label rofs-a --mkfs-extraopts "-b 4096"\n',
+                 'part --fstype ext4 --source rootfs --use-uuid --mkfs-extraopts "-b 4096"\n'])
+            wks.flush()
+            cmd = "wic create %s -e core-image-minimal -o %s" % (wks.name, self.resultdir)
+            runCmd(cmd)
+            wksname = os.path.splitext(os.path.basename(wks.name))[0]
+            images = glob(os.path.join(self.resultdir, "%s-*direct" % wksname))
+            self.assertEqual(1, len(images))
 
-            # verify partition size with wic
-            res = runCmd("export PARTED_SECTOR_SIZE=%d; parted -m %s unit b p" % (wic_sector_size, images[0]),
-                         stderr=subprocess.PIPE)
+        sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
+        # list partitions
+        result = runCmd("wic ls %s -n %s" % (images[0], sysroot))
+        print(result.output)
+        # Deprecated message + 4 lines of output: header + 3 partitions
+        self.assertEqual(5, len(result.output.split('\n')))
 
-            print(res.output)
-            # parse parted output which looks like this:
-            # BYT;\n
-            # /var/tmp/wic/build/tmpgjzzefdd-202410281021-sda.direct:78569472B:file:4096:4096:gpt::;\n
-            # 1:139264B:1187839B:1048576B::emptyfat:msftdata;
-            # 2:1187840B:149270527B:148082688B:ext4:rofs-a:;
-            # 3:149270528B:297353215B:148082688B:ext4:primary:;
-            disk_info = res.output.splitlines()[1]
-            # Check sector sizes
-            sector_size_logical = int(disk_info.split(":")[3])
-            sector_size_physical = int(disk_info.split(":")[4])
-            self.assertEqual(wic_sector_size, sector_size_logical, "Logical sector size is not %d." % wic_sector_size)
-            self.assertEqual(wic_sector_size, sector_size_physical, "Physical sector size is not %d." % wic_sector_size)
-
-            # It is a known issue with parsed that a 4K FAT partition does
-            # not have a recognized filesystem type of *fat.
-            part_info = res.output.splitlines()[2]
-            partname = part_info.split(":")[5]
-            parttype = part_info.split(":")[6]
-            self.assertEqual('emptyfat', partname)
-            self.assertEqual('msftdata;', parttype)
-
-            part_info = res.output.splitlines()[3]
-            parttype = part_info.split(":")[4]
-            partname = part_info.split(":")[5]
-            self.assertEqual('ext4', parttype)
-            self.assertEqual('rofs-a', partname)
-
-            part_info = res.output.splitlines()[4]
-            parttype = part_info.split(":")[4]
-            partname = part_info.split(":")[5]
-            self.assertEqual('ext4', parttype)
-            self.assertEqual('primary', partname)
+        # verify partition size with wic
+        res = runCmd("export PARTED_SECTOR_SIZE=%d; parted -m %s unit b p" % (wic_sector_size, images[0]),
+                     stderr=subprocess.PIPE)
 
-        finally:
-            os.environ['PATH'] = oldpath
+        print(res.output)
+        # parse parted output which looks like this:
+        # BYT;\n
+        # /var/tmp/wic/build/tmpgjzzefdd-202410281021-sda.direct:78569472B:file:4096:4096:gpt::;\n
+        # 1:139264B:1187839B:1048576B::emptyfat:msftdata;
+        # 2:1187840B:149270527B:148082688B:ext4:rofs-a:;
+        # 3:149270528B:297353215B:148082688B:ext4:primary:;
+        disk_info = res.output.splitlines()[1]
+        # Check sector sizes
+        sector_size_logical = int(disk_info.split(":")[3])
+        sector_size_physical = int(disk_info.split(":")[4])
+        self.assertEqual(wic_sector_size, sector_size_logical, "Logical sector size is not %d." % wic_sector_size)
+        self.assertEqual(wic_sector_size, sector_size_physical, "Physical sector size is not %d." % wic_sector_size)
+
+        # It is a known issue with parsed that a 4K FAT partition does
+        # not have a recognized filesystem type of *fat.
+        part_info = res.output.splitlines()[2]
+        partname = part_info.split(":")[5]
+        parttype = part_info.split(":")[6]
+        self.assertEqual('emptyfat', partname)
+        self.assertEqual('msftdata;', parttype)
+
+        part_info = res.output.splitlines()[3]
+        parttype = part_info.split(":")[4]
+        partname = part_info.split(":")[5]
+        self.assertEqual('ext4', parttype)
+        self.assertEqual('rofs-a', partname)
+
+        part_info = res.output.splitlines()[4]
+        parttype = part_info.split(":")[4]
+        partname = part_info.split(":")[5]
+        self.assertEqual('ext4', parttype)
+        self.assertEqual('primary', partname)
 
     def test_wic_sector_size_cli(self):
         """Test sector size handling via CLI option."""
 
-        oldpath = os.environ['PATH']
-        os.environ['PATH'] = get_bb_var("PATH", "wic-tools")
-
-        try:
-            bitbake('core-image-minimal')
-
-            with NamedTemporaryFile("w", suffix=".wks") as wks:
-                wks.writelines(
-                    ['bootloader --ptable gpt\n',
-                     'part --fstype vfat --fstype vfat --label emptyfat --size 1M\n',
-                     'part --fstype ext4 --source rootfs --label rofs-a\n',
-                     'part --fstype ext4 --source rootfs --use-uuid\n'])
-                wks.flush()
-                cmd = "wic create %s -e core-image-minimal -o %s --sector-size 4096" % (wks.name, self.resultdir)
-                runCmd(cmd)
-                wksname = os.path.splitext(os.path.basename(wks.name))[0]
-                images = glob(os.path.join(self.resultdir, "%s-*direct" % wksname))
-                self.assertEqual(1, len(images))
+        bitbake('core-image-minimal')
 
-            sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
-            # list partitions
-            result = runCmd("wic ls %s -n %s --sector-size 4096" % (images[0], sysroot))
-            print(result.output)
-            # 4 lines of output: header + 3 partitions
-            self.assertEqual(4, len(result.output.split('\n')))
+        with NamedTemporaryFile("w", suffix=".wks") as wks:
+            wks.writelines(
+                ['bootloader --ptable gpt\n',
+                 'part --fstype vfat --fstype vfat --label emptyfat --size 1M\n',
+                 'part --fstype ext4 --source rootfs --label rofs-a\n',
+                 'part --fstype ext4 --source rootfs --use-uuid\n'])
+            wks.flush()
+            cmd = "wic create %s -e core-image-minimal -o %s --sector-size 4096" % (wks.name, self.resultdir)
+            runCmd(cmd)
+            wksname = os.path.splitext(os.path.basename(wks.name))[0]
+            images = glob(os.path.join(self.resultdir, "%s-*direct" % wksname))
+            self.assertEqual(1, len(images))
 
-            # verify partition size with parted output
-            res = runCmd("export PARTED_SECTOR_SIZE=%d; parted -m %s unit b p" % (4096, images[0]),
-                         stderr=subprocess.PIPE)
+        sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
+        # list partitions
+        result = runCmd("wic ls %s -n %s --sector-size 4096" % (images[0], sysroot))
+        print(result.output)
+        # 4 lines of output: header + 3 partitions
+        self.assertEqual(4, len(result.output.split('\n')))
 
-            print(res.output)
-            # parse parted output which looks like this:
-            # BYT;\n
-            # /var/tmp/wic/build/tmpgjzzefdd-202410281021-sda.direct:78569472B:file:4096:4096:gpt::;\n
-            # 1:139264B:1187839B:1048576B::emptyfat:msftdata;
-            # 2:1187840B:149270527B:148082688B:ext4:rofs-a:;
-            # 3:149270528B:297353215B:148082688B:ext4:primary:;
-            disk_info = res.output.splitlines()[1]
-            # Check sector sizes
-            sector_size_logical = int(disk_info.split(":")[3])
-            sector_size_physical = int(disk_info.split(":")[4])
-            self.assertEqual(4096, sector_size_logical, "Logical sector size is not 4096.")
-            self.assertEqual(4096, sector_size_physical, "Physical sector size is not 4096.")
-
-            # It is a known issue with parsed that a 4K FAT partition does
-            # not have a recognized filesystem type of *fat.
-            part_info = res.output.splitlines()[2]
-            partname = part_info.split(":")[5]
-            parttype = part_info.split(":")[6]
-            self.assertEqual('emptyfat', partname)
-            self.assertEqual('msftdata;', parttype)
-
-            part_info = res.output.splitlines()[3]
-            parttype = part_info.split(":")[4]
-            partname = part_info.split(":")[5]
-            self.assertEqual('ext4', parttype)
-            self.assertEqual('rofs-a', partname)
-
-            part_info = res.output.splitlines()[4]
-            parttype = part_info.split(":")[4]
-            partname = part_info.split(":")[5]
-            self.assertEqual('ext4', parttype)
-            self.assertEqual('primary', partname)
+        # verify partition size with parted output
+        res = runCmd("export PARTED_SECTOR_SIZE=%d; parted -m %s unit b p" % (4096, images[0]),
+                     stderr=subprocess.PIPE)
 
-        finally:
-            os.environ['PATH'] = oldpath
+        print(res.output)
+        # parse parted output which looks like this:
+        # BYT;\n
+        # /var/tmp/wic/build/tmpgjzzefdd-202410281021-sda.direct:78569472B:file:4096:4096:gpt::;\n
+        # 1:139264B:1187839B:1048576B::emptyfat:msftdata;
+        # 2:1187840B:149270527B:148082688B:ext4:rofs-a:;
+        # 3:149270528B:297353215B:148082688B:ext4:primary:;
+        disk_info = res.output.splitlines()[1]
+        # Check sector sizes
+        sector_size_logical = int(disk_info.split(":")[3])
+        sector_size_physical = int(disk_info.split(":")[4])
+        self.assertEqual(4096, sector_size_logical, "Logical sector size is not 4096.")
+        self.assertEqual(4096, sector_size_physical, "Physical sector size is not 4096.")
+
+        # It is a known issue with parsed that a 4K FAT partition does
+        # not have a recognized filesystem type of *fat.
+        part_info = res.output.splitlines()[2]
+        partname = part_info.split(":")[5]
+        parttype = part_info.split(":")[6]
+        self.assertEqual('emptyfat', partname)
+        self.assertEqual('msftdata;', parttype)
+
+        part_info = res.output.splitlines()[3]
+        parttype = part_info.split(":")[4]
+        partname = part_info.split(":")[5]
+        self.assertEqual('ext4', parttype)
+        self.assertEqual('rofs-a', partname)
+
+        part_info = res.output.splitlines()[4]
+        parttype = part_info.split(":")[4]
+        partname = part_info.split(":")[5]
+        self.assertEqual('ext4', parttype)
+        self.assertEqual('primary', partname)
 
 class Wic2(WicTestCase):
 
@@ -1472,47 +1416,41 @@ run_wic_cmd() {
     def test_extra_partition_space(self):
         native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "wic-tools")
 
-        oldpath = os.environ['PATH']
-        os.environ['PATH'] = get_bb_var("PATH", "wic-tools")
+        with NamedTemporaryFile("w", suffix=".wks") as tempf:
+            tempf.write("bootloader --ptable gpt\n" \
+                        "part                 --ondisk hda --size 10M        --extra-partition-space 10M --fstype=ext4\n" \
+                        "part                 --ondisk hda --fixed-size 20M  --extra-partition-space 10M --fstype=ext4\n" \
+                        "part --source rootfs --ondisk hda                   --extra-partition-space 10M --fstype=ext4\n" \
+                        "part --source rootfs --ondisk hda --fixed-size 200M --extra-partition-space 10M --fstype=ext4\n")
+            tempf.flush()
+
+            _, wicimg = self._get_wic(tempf.name)
 
-        try:
-            with NamedTemporaryFile("w", suffix=".wks") as tempf:
-                tempf.write("bootloader --ptable gpt\n" \
-                            "part                 --ondisk hda --size 10M        --extra-partition-space 10M --fstype=ext4\n" \
-                            "part                 --ondisk hda --fixed-size 20M  --extra-partition-space 10M --fstype=ext4\n" \
-                            "part --source rootfs --ondisk hda                   --extra-partition-space 10M --fstype=ext4\n" \
-                            "part --source rootfs --ondisk hda --fixed-size 200M --extra-partition-space 10M --fstype=ext4\n")
-                tempf.flush()
-
-                _, wicimg = self._get_wic(tempf.name)
-
-                res = runCmd("parted -m %s unit b p" % wicimg,
-                                native_sysroot=native_sysroot, stderr=subprocess.PIPE)
-
-                # parse parted output which looks like this:
-                # BYT;\n
-                # /var/tmp/wic/build/tmpfwvjjkf_-201611101222-hda.direct:200MiB:file:512:512:msdos::;\n
-                # 1:0.00MiB:200MiB:200MiB:ext4::;\n
-                partlns = res.output.splitlines()[2:]
-
-                self.assertEqual(4, len(partlns))
-
-                # Test for each partitions that the extra part space exists
-                for part in range(0, len(partlns)):
-                    part_file = os.path.join(self.resultdir, "selftest_img.part%d" % (part + 1))
-                    partln = partlns[part].split(":")
-                    self.assertEqual(7, len(partln))
-                    self.assertRegex(partln[3], r'^[0-9]+B$')
-                    part_size = int(partln[3].rstrip("B"))
-                    start = int(partln[1].rstrip("B")) / 512
-                    length = part_size / 512
-                    runCmd("dd if=%s of=%s skip=%d count=%d" %
-                                                (wicimg, part_file, start, length))
-                    res = runCmd("dumpe2fs %s -h | grep \"^Block count\"" % part_file)
-                    fs_size = int(res.output.split(":")[1].strip()) * 1024
-                    self.assertLessEqual(fs_size + 10485760, part_size, "part file: %s" % part_file)
-        finally:
-            os.environ['PATH'] = oldpath
+            res = runCmd("parted -m %s unit b p" % wicimg,
+                            native_sysroot=native_sysroot, stderr=subprocess.PIPE)
+
+            # parse parted output which looks like this:
+            # BYT;\n
+            # /var/tmp/wic/build/tmpfwvjjkf_-201611101222-hda.direct:200MiB:file:512:512:msdos::;\n
+            # 1:0.00MiB:200MiB:200MiB:ext4::;\n
+            partlns = res.output.splitlines()[2:]
+
+            self.assertEqual(4, len(partlns))
+
+            # Test for each partitions that the extra part space exists
+            for part in range(0, len(partlns)):
+                part_file = os.path.join(self.resultdir, "selftest_img.part%d" % (part + 1))
+                partln = partlns[part].split(":")
+                self.assertEqual(7, len(partln))
+                self.assertRegex(partln[3], r'^[0-9]+B$')
+                part_size = int(partln[3].rstrip("B"))
+                start = int(partln[1].rstrip("B")) / 512
+                length = part_size / 512
+                runCmd("dd if=%s of=%s skip=%d count=%d" %
+                                            (wicimg, part_file, start, length))
+                res = runCmd("dumpe2fs %s -h | grep \"^Block count\"" % part_file)
+                fs_size = int(res.output.split(":")[1].strip()) * 1024
+                self.assertLessEqual(fs_size + 10485760, part_size, "part file: %s" % part_file)
 
     # TODO this test could also work on aarch64
     @skipIfNotArch(['i586', 'i686', 'x86_64'])
@@ -1825,45 +1763,39 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot"
             testfile.write("test %s" % testfilename)
             testfile.close()
 
-        oldpath = os.environ['PATH']
-        os.environ['PATH'] = get_bb_var("PATH", "wic-tools")
+        with NamedTemporaryFile("w", suffix=".wks") as wks:
+            wks.writelines([
+                'part / --source extra_partition --ondisk sda --sourceparams "name=foo" --align 4 --size 5M\n',
+                'part / --source extra_partition --ondisk sda --label foo --align 4 --size 5M\n',
+                'part / --source extra_partition --ondisk sda --fstype=vfat --uuid e7d0824e-cda3-4bed-9f54-9ef5312d105d --align 4 --size 5M\n',
+                'part / --source extra_partition --ondisk sda --fstype=ext4 --label bar --align 4 --size 5M\n',
+                'bootloader --ptable gpt\n',
+            ])
+            wks.flush()
+            _, wicimg = self._get_wic(wks.name)
 
-        try:
-            with NamedTemporaryFile("w", suffix=".wks") as wks:
-                wks.writelines([
-                    'part / --source extra_partition --ondisk sda --sourceparams "name=foo" --align 4 --size 5M\n',
-                    'part / --source extra_partition --ondisk sda --label foo --align 4 --size 5M\n',
-                    'part / --source extra_partition --ondisk sda --fstype=vfat --uuid e7d0824e-cda3-4bed-9f54-9ef5312d105d --align 4 --size 5M\n',
-                    'part / --source extra_partition --ondisk sda --fstype=ext4 --label bar --align 4 --size 5M\n',
-                    'bootloader --ptable gpt\n',
-                ])
-                wks.flush()
-                _, wicimg = self._get_wic(wks.name)
-
-            result = runCmd("wic ls %s -n %s" % (wicimg, sysroot))
-            partls = result.output.split('\n')[1:]
-
-            # Assert the number of partitions is correct
-            self.assertEqual(4, len(partls), msg="Expect 4 partitions, not %s" % result.output)
-
-            # Fstype column from 'wic ls' should be fstype as given in the part command
-            for part_id, part_fs in enumerate(["fat16", "fat16", "fat16", "ext4"]):
-                self.assertIn(part_fs, partls[part_id])
-
-            # For each partition, assert expected files exist
-            for part, part_glob in enumerate([
-                ["bar.conf"],
-                ["foo.conf"],
-                ["foobar.conf", "foobar2.conf", "bar3.conf", "bar4.conf"],
-                ["bar.conf", "bar2.conf"],
-            ]):
-                for part_file in part_glob:
-                    result = runCmd("wic ls %s:%d/%s -n %s" % (wicimg, part + 1, part_file, sysroot))
-                    self.assertEqual(0, result.status, msg="File '%s' not found in the partition #%d" % (part_file, part))
+        result = runCmd("wic ls %s -n %s" % (wicimg, sysroot))
+        partls = result.output.split('\n')[1:]
 
-            self.remove_config(config)
-        finally:
-            os.environ['PATH'] = oldpath
+        # Assert the number of partitions is correct
+        self.assertEqual(4, len(partls), msg="Expect 4 partitions, not %s" % result.output)
+
+        # Fstype column from 'wic ls' should be fstype as given in the part command
+        for part_id, part_fs in enumerate(["fat16", "fat16", "fat16", "ext4"]):
+            self.assertIn(part_fs, partls[part_id])
+
+        # For each partition, assert expected files exist
+        for part, part_glob in enumerate([
+            ["bar.conf"],
+            ["foo.conf"],
+            ["foobar.conf", "foobar2.conf", "bar3.conf", "bar4.conf"],
+            ["bar.conf", "bar2.conf"],
+        ]):
+            for part_file in part_glob:
+                result = runCmd("wic ls %s:%d/%s -n %s" % (wicimg, part + 1, part_file, sysroot))
+                self.assertEqual(0, result.status, msg="File '%s' not found in the partition #%d" % (part_file, part))
+
+        self.remove_config(config)
 
     def test_fs_types(self):
         """Test filesystem types for empty and not empty partitions"""
-- 
2.50.0.173.g8b6f19ccfc3a



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

* [PATCH v5 6/6] wic: gate syslinux-native on the target, not the build host
  2026-07-31 15:28 [PATCH v5 0/6] wic: ship the tools it invokes Trevor Woerner
                   ` (4 preceding siblings ...)
  2026-07-31 15:28 ` [PATCH v5 5/6] oeqa/selftest/wic: drop redundant per-test PATH overrides Trevor Woerner
@ 2026-07-31 15:28 ` Trevor Woerner
  5 siblings, 0 replies; 7+ messages in thread
From: Trevor Woerner @ 2026-07-31 15:28 UTC (permalink / raw)
  To: openembedded-core

Whether wic needs the syslinux installer is decided by the .wks file,
and so by the target: only an x86 image asks for syslinux. Currently
image_types_wic.bbclass adds syslinux-native when the BUILD HOST is
x86 instead, which is a different question. Does an image depend on
syslinux-native today?

                 | x86 target | non-x86 target
    -------------+------------+----------------
    x86 host     | yes        | yes
    non-x86 host | no         | no

The answer varies by row when it should vary by column, and both of the
wrong cells cost something. An x86 image built on a non-x86 host gets
the target bootloader without the installer that puts it in place. An
x86 host builds an installer that a non-x86 image will never use.

Gate on the target instead, as wic-tools already does [1]:

                 | x86 target | non-x86 target
    -------------+------------+----------------
    x86 host     | yes        | no
    non-x86 host | yes        | no

Bug 13276 [2] reported the bottom-right cell failing, back when the
syslinux recipe was x86-only for every variant, and it was closed in
2019 by gating on BUILD_ARCH [3]. The recipe has since been reworked so
that only its target code is x86-specific [4], which leaves that gate
unnecessary as well as misdirected. A non-x86 target never asks for
syslinux, so 13276's case stays fixed.

[YOCTO #16383]

[1] https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/meta/wic-tools.bb
[2] https://bugzilla.yoctoproject.org/show_bug.cgi?id=13276
[3] https://git.openembedded.org/openembedded-core/commit/?id=7e2ee2b59319
[4] https://git.openembedded.org/openembedded-core/commit/?id=7273e131bfc7

AI-Generated: codex/claude-opus 5 (xhigh)
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
changes in v5:
- new in v5
---
 meta/classes-recipe/image_types_wic.bbclass | 3 +--
 meta/conf/wic-helper-tools.inc              | 3 +++
 meta/recipes-core/meta/wic-tools.bb         | 4 ----
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/meta/classes-recipe/image_types_wic.bbclass b/meta/classes-recipe/image_types_wic.bbclass
index 3f25b7912b26..b00b5155475d 100644
--- a/meta/classes-recipe/image_types_wic.bbclass
+++ b/meta/classes-recipe/image_types_wic.bbclass
@@ -120,9 +120,8 @@ do_image_wic[depends] += "${@' '.join('%s:do_populate_sysroot' % r for r in ('wi
 do_image_wic[recrdeptask] += "do_deploy"
 do_image_wic[deptask] += "do_image_complete"
 
-WKS_FILE_DEPENDS_DEFAULT = '${@bb.utils.contains_any("BUILD_ARCH", [ 'x86_64', 'i686' ], "syslinux-native", "",d)}'
 # Unified kernel images need objcopy
-WKS_FILE_DEPENDS_DEFAULT += "virtual/cross-binutils"
+WKS_FILE_DEPENDS_DEFAULT = "virtual/cross-binutils"
 WKS_FILE_DEPENDS_BOOTLOADERS = ""
 WKS_FILE_DEPENDS_BOOTLOADERS:aarch64 = "grub-efi systemd-boot"
 WKS_FILE_DEPENDS_BOOTLOADERS:arm = "systemd-boot"
diff --git a/meta/conf/wic-helper-tools.inc b/meta/conf/wic-helper-tools.inc
index 66f2f1b2bddc..0ee4aaee6a89 100644
--- a/meta/conf/wic-helper-tools.inc
+++ b/meta/conf/wic-helper-tools.inc
@@ -14,6 +14,9 @@ WIC_HELPER_TOOLS ?= "\
 
 WIC_HELPER_TOOLS_NATIVE_ONLY ?= "cdrtools"
 WIC_HELPER_TOOLS_DEPENDS = "${@' '.join('%s-native' % t for t in (d.getVar('WIC_HELPER_TOOLS') + ' ' + d.getVar('WIC_HELPER_TOOLS_NATIVE_ONLY')).split())}"
+WIC_HELPER_TOOLS_DEPENDS:append:x86 = " syslinux-native"
+WIC_HELPER_TOOLS_DEPENDS:append:x86-64 = " syslinux-native"
+WIC_HELPER_TOOLS_DEPENDS:append:x86-x32 = " syslinux-native"
 
 WIC_HELPER_TOOLS_PACKAGE_ONLY ?= "e2fsprogs-resize2fs"
 WIC_HELPER_TOOLS_RDEPENDS = "${WIC_HELPER_TOOLS} ${WIC_HELPER_TOOLS_PACKAGE_ONLY}"
diff --git a/meta/recipes-core/meta/wic-tools.bb b/meta/recipes-core/meta/wic-tools.bb
index c3c39cec011d..22d530e42300 100644
--- a/meta/recipes-core/meta/wic-tools.bb
+++ b/meta/recipes-core/meta/wic-tools.bb
@@ -9,10 +9,6 @@ DEPENDS = "\
            grub-native pseudo-native \
            virtual/cross-binutils \
            "
-DEPENDS:append:x86 = " syslinux-native"
-DEPENDS:append:x86-64 = " syslinux-native"
-DEPENDS:append:x86-x32 = " syslinux-native"
-
 INHIBIT_DEFAULT_DEPS = "1"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
-- 
2.50.0.173.g8b6f19ccfc3a



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

end of thread, other threads:[~2026-07-31 15:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-31 15:28 [PATCH v5 0/6] wic: ship the tools it invokes Trevor Woerner
2026-07-31 15:28 ` [PATCH v5 1/6] wic-tools: drop the target bootloader firmware Trevor Woerner
2026-07-31 15:28 ` [PATCH v5 2/6] wic: add a shared helper tool list Trevor Woerner
2026-07-31 15:28 ` [PATCH v5 3/6] wic: add runtime dependencies on the tools it invokes Trevor Woerner
2026-07-31 15:28 ` [PATCH v5 4/6] oeqa/selftest/wic: drop dead COREBASE/scripts wic lookup Trevor Woerner
2026-07-31 15:28 ` [PATCH v5 5/6] oeqa/selftest/wic: drop redundant per-test PATH overrides Trevor Woerner
2026-07-31 15:28 ` [PATCH v5 6/6] wic: gate syslinux-native on the target, not the build host Trevor Woerner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).