Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Trevor Woerner <twoerner@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v4 02/10] wic: add runtime dependencies on the tools it invokes
Date: Fri, 24 Jul 2026 05:01:38 -0400	[thread overview]
Message-ID: <20260724090146.19924-3-twoerner@gmail.com> (raw)
In-Reply-To: <20260724090146.19924-1-twoerner@gmail.com>

wic shells out to a number of host-side tools to do its work: parted,
mkdosfs, mcopy, the mkfs.* family, sfdisk, e2fsck, resize2fs, debugfs,
blkid and more, depending on the operation and on the partition types
in the image.

None of these are declared as dependencies of wic. For the bitbake
do_image_wic task this is handled by the wic-tools recipe, which builds
the tools into a native sysroot. Wherever else wic is installed as a
package it gets none of them, and its offline lookup (wic ls/cp/write)
resolves each tool over a search path that falls back to the host PATH,
so on a machine that happens to have the tool installed system-wide wic
succeeds while on a machine without it wic fails:

  wic.WicError: Can't find executable 'mcopy'

Falling back to the host is unreliable even when the tool is found: wic
depends on specific minimum versions of some of these tools, and an
arbitrary host copy may be too old, so wic can pick up a tool that does
not behave as it needs. Declaring the tools as dependencies pins
known-good versions instead of trusting whatever the host provides.

Add the tools wic runs as RDEPENDS so they are installed alongside it.
resize2fs is listed on its own because e2fsprogs packages it separately
as e2fsprogs-resize2fs, which e2fsprogs does not pull in, and wic needs
it for the cp/write resize path.

grub (grub-mkimage) is used to assemble EFI boot images, and is only
compatible with, and only used by wic on, x86 and aarch64. In particular
grub is not in COMPATIBLE_HOST on arm hard-float, so an unconditional
dependency makes wic unbuildable there and breaks "bitbake world"
(Nothing RPROVIDES 'grub'). Gate grub to the hosts that can build and
use it.

syslinux is only available on x86, so it is gated to those hosts too.
Its bits are split across packages: the syslinux package provides the
isohybrid helper wic runs, syslinux-misc carries the ldlinux.sys,
isohdpfx.bin and ldlinux.c32 data files, and syslinux-isolinux carries
isolinux.bin; wic copies all of these into a hybrid ISO, so all three
are listed. cdrtools (mkisofs) is native-only with no nativesdk variant
and is only needed for ISO images, so it is not listed here.

AI-Generated: codex/claude-opus 4.8 (xhigh)
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
changes in v4:
- gate grub to x86 and aarch64 (it is not in COMPATIBLE_HOST on arm
  hard-float, which made wic unbuildable and broke bitbake world); move
  syslinux into the same arch-gated appends
- also depend on syslinux-isolinux, which carries isolinux.bin that wic
  copies into a hybrid ISO; the syslinux/syslinux-misc pair alone missed
  it

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

changes in v2:
- merge the tool list from the v1 "wic-tools.inc: add" patch into this
  recipe as RDEPENDS; the separate .inc is dropped
- list the tools inline rather than via a shared WIC_TOOLS variable
- note in the commit log that a host tool may also be the wrong version,
  not merely absent
---
 meta/recipes-support/wic/wic_0.3.1.bb | 30 +++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/meta/recipes-support/wic/wic_0.3.1.bb b/meta/recipes-support/wic/wic_0.3.1.bb
index d9b4cc05c4bd..75fa734a9761 100644
--- a/meta/recipes-support/wic/wic_0.3.1.bb
+++ b/meta/recipes-support/wic/wic_0.3.1.bb
@@ -17,4 +17,34 @@ RDEPENDS:${PN} += " \
     python3-misc \
     "
 
+# wic shells out to these host-side tools when it runs, so they must be
+# installed alongside it.
+RDEPENDS:${PN} += " \
+    parted \
+    gptfdisk \
+    dosfstools \
+    mtools \
+    bmaptool \
+    btrfs-tools \
+    squashfs-tools \
+    e2fsprogs \
+    e2fsprogs-resize2fs \
+    util-linux \
+    tar \
+    erofs-utils \
+"
+
+# grub (grub-mkimage) assembles EFI boot images; it is only compatible
+# with, and only used by wic on, x86 and aarch64, so gate it to those
+# hosts. In particular grub is not compatible with arm hard-float, so an
+# unconditional dependency makes wic unbuildable there. syslinux is only
+# available on x86: its installer provides the isohybrid helper wic runs,
+# syslinux-misc carries ldlinux.sys/isohdpfx.bin/ldlinux.c32 and
+# syslinux-isolinux carries isolinux.bin, all of which wic copies into a
+# hybrid ISO.
+RDEPENDS:${PN}:append:x86 = " grub syslinux syslinux-misc syslinux-isolinux"
+RDEPENDS:${PN}:append:x86-64 = " grub syslinux syslinux-misc syslinux-isolinux"
+RDEPENDS:${PN}:append:x86-x32 = " grub syslinux syslinux-misc syslinux-isolinux"
+RDEPENDS:${PN}:append:aarch64 = " grub"
+
 BBCLASSEXTEND = "native nativesdk"
-- 
2.50.0.173.g8b6f19ccfc3a



  parent 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 ` [PATCH v4 01/10] wic-tools: move bootloader firmware staging into the wic oe-selftest Trevor Woerner
2026-07-24  9:01 ` Trevor Woerner [this message]
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-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