Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v2 0/3] wic: give installed wic the tools it needs
@ 2026-07-07 14:40 Trevor Woerner
  2026-07-07 14:40 ` [PATCH v2 1/3] wic: add runtime dependencies on the tools it invokes Trevor Woerner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Trevor Woerner @ 2026-07-07 14:40 UTC (permalink / raw)
  To: openembedded-core

wic shells out to a range of host-side tools but does not declare them,
so wherever it is installed as a package (rather than run from the
bitbake do_image_wic task, which has the wic-tools native sysroot on
PATH) it works only by chance depending on what the host happens to
have installed. This series makes an installed wic carry its own tools
and makes putting wic into the SDK an explicit, opt-in choice.

Changes since v1:
 - Dropped the wic-tools.inc refactor. With wic no longer added to the
   SDK by default and the tarball entries removed, there was nothing
   left to share, so the tool list now lives directly in the wic recipe
   as RDEPENDS instead of a new .inc.
 - buildtools-extended-tarball no longer swaps the parted/dosfstools/
   gptfdisk entries for nativesdk-wic; those three tools never belonged
   in this tarball (it ships build prerequisites, not image helpers), so
   they are simply removed.
 - wic is no longer added to nativesdk-packagegroup-sdk-host
   unconditionally. It is gated behind a new SDK_INCLUDE_WIC knob
   (default "no"), since pulling in wic also pulls in the long list of
   tools it might need.

The wic/wic-tools split and the machine-specific bootloader firmware
that wic-tools drags in are left for a separate follow-up.

Trevor Woerner (3):
  wic: add runtime dependencies on the tools it invokes
  buildtools-extended-tarball: drop wic helper tools
  nativesdk-packagegroup-sdk-host: optionally add wic

 .../meta/buildtools-extended-tarball.bb       |  3 ---
 .../nativesdk-packagegroup-sdk-host.bb        |  6 +++++
 meta/recipes-support/wic/wic_0.3.0.bb         | 23 +++++++++++++++++++
 3 files changed, 29 insertions(+), 3 deletions(-)

-- 
2.50.0.173.g8b6f19ccfc3a


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

* [PATCH v2 1/3] wic: add runtime dependencies on the tools it invokes
  2026-07-07 14:40 [PATCH v2 0/3] wic: give installed wic the tools it needs Trevor Woerner
@ 2026-07-07 14:40 ` Trevor Woerner
  2026-07-07 14:40 ` [PATCH v2 2/3] buildtools-extended-tarball: drop wic helper tools Trevor Woerner
  2026-07-07 14:40 ` [PATCH v2 3/3] nativesdk-packagegroup-sdk-host: optionally add wic Trevor Woerner
  2 siblings, 0 replies; 4+ messages in thread
From: Trevor Woerner @ 2026-07-07 14:40 UTC (permalink / raw)
  To: openembedded-core

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. Providing the tools as proper dependencies pins
known-good versions rather than leaving it to whatever the host has.

Add the tools as RDEPENDS so they are installed alongside wic and found
regardless of the host. They are added to the nativesdk variant only,
which is where wic is packaged for use outside a bitbake build; the
native and target variants are unaffected (and wic is not expected on a
target).

resize2fs is named 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 here.

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 | 23 +++++++++++++++++++++++
 1 file changed, 23 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..2d4d32a6b15d 100644
--- a/meta/recipes-support/wic/wic_0.3.0.bb
+++ b/meta/recipes-support/wic/wic_0.3.0.bb
@@ -17,4 +17,27 @@ RDEPENDS:${PN} += " \
     python3-misc \
     "
 
+# Pull in the tools wic invokes for the nativesdk variant, where wic is
+# packaged for use outside a bitbake build; native and target are
+# unaffected. resize2fs is named explicitly as e2fsprogs splits it into
+# its own package.
+RDEPENDS:${PN}:append:class-nativesdk = " \
+    nativesdk-parted \
+    nativesdk-gptfdisk \
+    nativesdk-dosfstools \
+    nativesdk-mtools \
+    nativesdk-bmaptool \
+    nativesdk-grub \
+    nativesdk-btrfs-tools \
+    nativesdk-squashfs-tools \
+    nativesdk-e2fsprogs \
+    nativesdk-e2fsprogs-resize2fs \
+    nativesdk-util-linux \
+    nativesdk-tar \
+    nativesdk-erofs-utils \
+"
+
+# syslinux (with its isohybrid helper) only builds for x86 hosts.
+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



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

* [PATCH v2 2/3] buildtools-extended-tarball: drop wic helper tools
  2026-07-07 14:40 [PATCH v2 0/3] wic: give installed wic the tools it needs Trevor Woerner
  2026-07-07 14:40 ` [PATCH v2 1/3] wic: add runtime dependencies on the tools it invokes Trevor Woerner
@ 2026-07-07 14:40 ` Trevor Woerner
  2026-07-07 14:40 ` [PATCH v2 3/3] nativesdk-packagegroup-sdk-host: optionally add wic Trevor Woerner
  2 siblings, 0 replies; 4+ messages in thread
From: Trevor Woerner @ 2026-07-07 14:40 UTC (permalink / raw)
  To: openembedded-core

The extended buildtools tarball exists to make a host with inadequate
or ancient software able to run bitbake builds: it provides a compiler,
autotools, python3, git, tar and the rest of the build essentials. The
things it ships are the build prerequisites a build host is otherwise
expected to provide.

nativesdk-parted, -dosfstools and -gptfdisk do not fit that purpose.
They are not build prerequisites; they are disk-image helper tools that
only make sense for someone assembling or inspecting a .wic image, and
they do not belong in the set of essentials this tarball guarantees.

Drop the three entries so the tarball's contents stay limited to what
its description promises.

AI-Generated: codex/claude-opus 4.8 (xhigh)
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 meta/recipes-core/meta/buildtools-extended-tarball.bb | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/meta/recipes-core/meta/buildtools-extended-tarball.bb b/meta/recipes-core/meta/buildtools-extended-tarball.bb
index 633f8e6b99d6..bd4c19c7eac7 100644
--- a/meta/recipes-core/meta/buildtools-extended-tarball.bb
+++ b/meta/recipes-core/meta/buildtools-extended-tarball.bb
@@ -30,9 +30,6 @@ TOOLCHAIN_HOST_TASK += "\
     nativesdk-glibc-utils \
     nativesdk-glibc-gconvs \
     nativesdk-libxcrypt-dev \
-    nativesdk-parted \
-    nativesdk-dosfstools \
-    nativesdk-gptfdisk \
     "
 # gconvs needed for iconv to work in vim builds
 
-- 
2.50.0.173.g8b6f19ccfc3a



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

* [PATCH v2 3/3] nativesdk-packagegroup-sdk-host: optionally add wic
  2026-07-07 14:40 [PATCH v2 0/3] wic: give installed wic the tools it needs Trevor Woerner
  2026-07-07 14:40 ` [PATCH v2 1/3] wic: add runtime dependencies on the tools it invokes Trevor Woerner
  2026-07-07 14:40 ` [PATCH v2 2/3] buildtools-extended-tarball: drop wic helper tools Trevor Woerner
@ 2026-07-07 14:40 ` Trevor Woerner
  2 siblings, 0 replies; 4+ messages in thread
From: Trevor Woerner @ 2026-07-07 14:40 UTC (permalink / raw)
  To: openembedded-core

wic is useful from an installed SDK for assembling or inspecting a wic
image, but adding it is not free: nativesdk-wic pulls in the long list
of host-side tools it might need (parted, gptfdisk, dosfstools, mtools,
bmaptool, grub, btrfs-tools, squashfs-tools, e2fsprogs, util-linux,
tar, erofs-utils, and syslinux on x86). Most SDKs do not need any of
that, so it should not be forced into the host packagegroup
unconditionally.

Add an SDK_INCLUDE_WIC knob, defaulting to "no", that gates
nativesdk-wic in the host packagegroup. A configuration that wants wic
in its SDK opts in with

  SDK_INCLUDE_WIC = "yes"

and gets a working wic, together with the tools it invokes, in the SDK;
the default SDK is unchanged.

AI-Generated: codex/claude-opus 4.8 (xhigh)
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 .../packagegroups/nativesdk-packagegroup-sdk-host.bb        | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
index 51e48f250b19..37218824171f 100644
--- a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
+++ b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
@@ -9,6 +9,11 @@ inherit_defer nativesdk
 
 PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
 
+# wic is useful from an installed SDK for assembling or inspecting a wic
+# image, but it is not needed by every SDK, so it is opt-in. Set
+# SDK_INCLUDE_WIC = "yes" to add it (it pulls in the tools it invokes).
+SDK_INCLUDE_WIC ?= "no"
+
 # autoconf pulls in nativesdk-perl but perl-module-integer is needed to 
 # build some recent linux kernels (5.14+) for arm
 RDEPENDS:${PN} = "\
@@ -29,6 +34,7 @@ RDEPENDS:${PN} = "\
     nativesdk-bison \
     nativesdk-flex \
     nativesdk-perl-module-integer \
+    ${@'nativesdk-wic' if bb.utils.to_boolean(d.getVar('SDK_INCLUDE_WIC')) else ''} \
     "
 
 RDEPENDS:${PN}:darwin = "\
-- 
2.50.0.173.g8b6f19ccfc3a



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

end of thread, other threads:[~2026-07-07 14:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-07 14:40 [PATCH v2 0/3] wic: give installed wic the tools it needs Trevor Woerner
2026-07-07 14:40 ` [PATCH v2 1/3] wic: add runtime dependencies on the tools it invokes Trevor Woerner
2026-07-07 14:40 ` [PATCH v2 2/3] buildtools-extended-tarball: drop wic helper tools Trevor Woerner
2026-07-07 14:40 ` [PATCH v2 3/3] nativesdk-packagegroup-sdk-host: optionally add wic Trevor Woerner

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