From: Trevor Woerner <twoerner@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 2/4] wic: add runtime dependencies on the tools it invokes
Date: Wed, 1 Jul 2026 03:54:09 -0400 [thread overview]
Message-ID: <20260701075411.1092848-3-twoerner@gmail.com> (raw)
In-Reply-To: <20260701075411.1092848-1-twoerner@gmail.com>
wic shells out to a number of host-side tools (parted, mkdosfs, mcopy,
the mkfs.* family, mdir, sfdisk, e2fsck, resize2fs, debugfs, blkid,
...) but does not declare them as dependencies. For the bitbake
do_image_wic task this is handled by the wic-tools recipe, which builds
those tools into the native sysroot. Wherever else wic is installed as
a package it gets none of them, and its offline lookup (wic ls/cp/write)
falls back to the host PATH, so wic works only by chance depending on
what the host has installed:
wic.WicError: Can't find executable 'mcopy'
Make wic carry the tools it may invoke by adding the shared WIC_TOOLS
helpers as RDEPENDS. They are added to the nativesdk variant, which is
where wic is packaged for use outside a bitbake build; the native and
target variants are unaffected.
resize2fs is added explicitly: e2fsprogs splits it into its own
e2fsprogs-resize2fs package, so nativesdk-e2fsprogs alone does not
provide it, and it is needed by the wic cp/write resize path.
syslinux (with its isohybrid helper) is gated to x86 hosts; cdrtools
(mkisofs) is native-only with no nativesdk variant and is only needed
for ISO images, so it cannot be included.
AI-Generated: codex/claude-opus 4.8 (xhigh)
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
meta/recipes-support/wic/wic_0.3.0.bb | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/meta/recipes-support/wic/wic_0.3.0.bb b/meta/recipes-support/wic/wic_0.3.0.bb
index 7dbf84b039a6..6efe974e02bd 100644
--- a/meta/recipes-support/wic/wic_0.3.0.bb
+++ b/meta/recipes-support/wic/wic_0.3.0.bb
@@ -10,6 +10,8 @@ CVE_PRODUCT = "yoctoproject:wic"
inherit python_hatchling
+require recipes-core/meta/wic-tools.inc
+
RDEPENDS:${PN} += " \
python3-core \
python3-json \
@@ -17,4 +19,20 @@ RDEPENDS:${PN} += " \
python3-misc \
"
+# wic shells out to the WIC_TOOLS tools but does not declare them, so
+# wherever wic is installed as a package it may not have them and its
+# offline lookup falls back to the host PATH. Pull them in for the
+# nativesdk variant so they are present regardless of the host; native
+# and target wic are unaffected.
+RDEPENDS:${PN}:append:class-nativesdk = "${@' '.join(' nativesdk-%s' % t for t in d.getVar('WIC_TOOLS').split())}"
+
+# resize2fs is split into its own e2fsprogs-resize2fs package, so
+# nativesdk-e2fsprogs alone does not provide it.
+RDEPENDS:${PN}:append:class-nativesdk = " nativesdk-e2fsprogs-resize2fs"
+
+# syslinux (and its isohybrid helper, in the -misc package) only builds
+# for x86 hosts; cdrtools (mkisofs) is native-only with no nativesdk
+# variant and so cannot be included.
+RDEPENDS:${PN}:append:class-nativesdk = "${@' nativesdk-syslinux nativesdk-syslinux-misc' if d.getVar('SDK_ARCH') in ['x86_64', 'i686'] else ''}"
+
BBCLASSEXTEND = "native nativesdk"
--
2.50.0.173.g8b6f19ccfc3a
next prev parent reply other threads:[~2026-07-01 7:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-01 7:54 [PATCH 0/4] wic: ship the tools it needs where it is packaged Trevor Woerner
2026-07-01 7:54 ` [PATCH 1/4] wic-tools.inc: add Trevor Woerner
2026-07-01 7:54 ` Trevor Woerner [this message]
2026-07-01 7:54 ` [PATCH 3/4] buildtools-extended-tarball: use nativesdk-wic Trevor Woerner
2026-07-01 7:54 ` [PATCH 4/4] nativesdk-packagegroup-sdk-host: add wic 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=20260701075411.1092848-3-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