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 tools it
runs (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 wic should not be in the
host packagegroup unconditionally.

Introduce SDK_FEATURES, a list of optional additions to the SDK host
tools, in the same spirit as DISTRO_FEATURES, MACHINE_FEATURES and
IMAGE_FEATURES: a developer reads the setting and knows exactly what is
being included.

Gate wic in the host packagegroup on the "wic" feature, which is not
enabled by default. A configuration that wants wic in its SDK adds the
"wic" feature to SDK_FEATURES and gets a working wic, together with the
tools it invokes, in the SDK.

AI-Generated: codex/claude-opus 4.8 (xhigh)
Signed-off-by: Trevor Woerner <[email protected]>
---
changes in v3:
- replace the SDK_INCLUDE_WIC yes/no knob with a new general SDK_FEATURES list; 
gate wic on the "wic" feature
- add the SDK_FEATURES default and documentation.conf entry

changes in v2:
- gate nativesdk-wic behind a new SDK_INCLUDE_WIC knob (default "no") instead 
of adding it unconditionally as in v1
---
 meta/conf/bitbake.conf                                          | 2 +-
 meta/conf/documentation.conf                                    | 1 +
 .../packagegroups/nativesdk-packagegroup-sdk-host.bb            | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index bdf37d0da247..b7bc74887b69 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -898,6 +898,7 @@ OES_BITBAKE_CONF = "1"
 
 MACHINE_FEATURES:append = " 
${@oe.utils.filter_default_features('MACHINE_FEATURES', d)}"
 SDK_MACHINE_FEATURES ?= ""
+SDK_FEATURES ?= ""
 
 DISTRO_FEATURES:append = " 
${@oe.utils.filter_default_features('DISTRO_FEATURES', d)}"
 
@@ -992,4 +993,3 @@ MULTILIB_VARIANTS ??= ""
 # what it would be anyway if the signature generator (e.g. OEEquivHash) doesn't
 # support unihashes.
 BB_UNIHASH ?= "${BB_TASKHASH}"
-
diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf
index 842cf31739de..604c51322813 100644
--- a/meta/conf/documentation.conf
+++ b/meta/conf/documentation.conf
@@ -361,6 +361,7 @@ SANITY_TESTED_DISTROS[doc] = "A list of the host 
distribution identifiers that t
 SDK_ARCH[doc] = "The target architecture for the SDK."
 SDK_DEPLOY[doc] = "The directory set up and used by the populate_sdk_base to 
which the SDK is deployed."
 SDK_DIR[doc] = "The parent directory used by the OpenEmbedded build system 
when creating SDK output."
+SDK_FEATURES[doc] = "The list of optional features to add to the standalone 
SDK's host tools, for example 'wic'. Analogous to IMAGE_FEATURES but for the 
SDK host side."
 SDK_NAME[doc] = "The base name for SDK output files."
 SDK_OUTPUT[doc] = "The location used by the OpenEmbedded build system when 
creating SDK output."
 SDKIMAGE_FEATURES[doc] = "Equivalent to IMAGE_FEATURES. However, this variable 
applies to the SDK generated from an image using the command 'bitbake -c 
populate_sdk imagename'."
diff --git a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb 
b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
index 51e48f250b19..c2974a57fe3e 100644
--- a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
+++ b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
@@ -29,6 +29,7 @@ RDEPENDS:${PN} = "\
     nativesdk-bison \
     nativesdk-flex \
     nativesdk-perl-module-integer \
+    ${@bb.utils.contains('SDK_FEATURES', 'wic', 'nativesdk-wic', '', d)} \
     "
 
 RDEPENDS:${PN}:darwin = "\
-- 
2.50.0.173.g8b6f19ccfc3a

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#241184): 
https://lists.openembedded.org/g/openembedded-core/message/241184
Mute This Topic: https://lists.openembedded.org/mt/120314943/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to