From: "'Moessbauer, Felix' via isar-users" <isar-users@googlegroups.com>
To: "Kowalsky, Clara" <clara.kowalsky@siemens.com>,
"isar-users@googlegroups.com" <isar-users@googlegroups.com>
Subject: Re: [PATCH v2 3/6] wic: run the Python driver outside the imaging chroot
Date: Wed, 18 Nov 2026 12:25:13 +0000 [thread overview]
Message-ID: <908ddcf273ee9550b490473ff2a1cd39f4306446.camel@siemens.com> (raw)
In-Reply-To: <20261117144109.2417395-4-clara.kowalsky@siemens.com>
On Tue, 2026-11-17 at 15:41 +0100, Clara Kowalsky wrote:
> WIC is a Python tool that imports BitBake (scripts/wic: "import bb"),
> so it needs a Python interpreter that BitBake supports. Isar runs WIC
> inside the imaging chroot, which has the userland of the target
> distribution, so WIC is executed by the chroot's python3.
>
> This blocks updating BitBake to the latest version: BitBake 2.8 to 2.18
> require Python 3.8, BitBake 2.20 requires 3.9, but Debian buster ships
> Python 3.7.
> Isar worked around this by lowering BitBake's version check (commit
> da17d920 "bitbake: Downgrade python requirements"). Carrying it on
> would run BitBake 2.20 on an interpreter it does not support.
>
> Fix this by running WIC with the build host's Python, which BitBake
> itself already uses, and executing only the image utilities (e.g.,
> mkfs, mtools, bmaptool) in the chroot. imager_run_host runs a script
> outside the chroot with the same privilege handling and mounts as
> imager_run and provides IMAGER_CHROOT. WIC uses WIC_TOOL_RUNNER
> (scripts/wic-chroot) to execute utilities in the chroot and
> WIC_TOOL_SYSROOT to translate native sysroot paths with
> get_native_path(). The WIC rootfs plugin routes its copy commands
> through WIC_TOOL_RUNNER when configured.
>
> WIC is invoked as an external script, so its source files are not
> included in do_image_wic's task signature automatically. Fix this by
> listing the driver, runner and modified plugin files in the
> file-checksums, so changes to them rerun the task instead of reusing a
> stale image. The WIC work directory is now ${WORKDIR}/wic instead of
> /tmp in the chroot.
>
> Signed-off-by: Clara Kowalsky <clara.kowalsky@siemens.com>
> Tested-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
> RECIPE-API-CHANGELOG.md | 17 +++++++
> doc/technical_overview.md | 17 +++++++
> .../image-tools-extension.bbclass | 17 ++++++-
> meta/classes-recipe/imagetypes_wic.bbclass | 49 ++++++++++++++++---
> .../source/bootimg-biosplusefi-isar.py | 1 +
> .../wic/plugins/source/bootimg-efi-isar.py | 8 ++-
> .../wic/plugins/source/bootimg-pcbios-isar.py | 6 ++-
> .../plugins/source/isoimage-isohybrid-isar.py | 4 +-
> .../lib/wic/plugins/source/rootfs-u-boot.py | 15 +++---
> scripts/lib/wic/misc.py | 38 +++++++++++++-
> scripts/lib/wic/partition.py | 5 +-
> scripts/lib/wic/plugins/imager/direct.py | 9 ++--
> .../lib/wic/plugins/source/bootimg-pcbios.py | 6 ++-
> .../wic/plugins/source/isoimage-isohybrid.py | 4 +-
> scripts/lib/wic/plugins/source/rawcopy.py | 20 ++++----
> scripts/lib/wic/plugins/source/rootfs.py | 45 +++++++++++++++--
> scripts/wic-chroot | 38 ++++++++++++++
> 17 files changed, 256 insertions(+), 43 deletions(-)
> create mode 100755 scripts/wic-chroot
>
> diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> index 3798a9d1..42641d9a 100644
> --- a/RECIPE-API-CHANGELOG.md
> +++ b/RECIPE-API-CHANGELOG.md
> @@ -1225,3 +1225,20 @@ the rootfs. This has been replaced by the `exclude-docs` rootfs feature. The
>
> When enabled, the package changelogs are now removed as well (copyright is still
> kept for legal reasons).
> +
> +### WIC runs on the build host, add imager_run_host
> +
> +WIC's Python driver now runs on the build host instead of inside the imaging
> +chroot. Only the image utilities (e.g. mkfs tools, mtools, bmaptool) still run
> +in the chroot. By that, the chroot distribution no longer needs a Python
> +interpreter that is compatible with BitBake, which is required to update
> +BitBake beyond Debian buster's Python version.
> +
> +Recipes can use the new `imager_run_host` instead of `imager_run` to run a
> +script on the host. It provides the same privilege handling and mounts and
> +sets `IMAGER_CHROOT` to the path of the prepared imaging chroot.
> +
> +Custom WIC plugins that start subprocesses directly must use `exec_cmd()` or
> +`exec_native_cmd()` from `wic.misc` to still run their tools in the chroot.
> +Native sysroot paths passed to such tools must be converted with
> +`get_native_path()`. The WIC work directory is now `${WORKDIR}/wic`.
Hi, I tested this on isar-cip-core and there it unfortunately silently
broke - as the old exec_cmd seems to not error out, resulting in images
that build successfully but cannot be booted.
I tried converting the plugins, but the migration from exec_cmd to
exec_native_cmd is non trivial - also because both the parameter as
well as the result signature is different.
Would it be possible to at least error out on exec_cmd, so downstream
knowns that migration is needed?
Felix
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/908ddcf273ee9550b490473ff2a1cd39f4306446.camel%40siemens.com.
next prev parent reply other threads:[~2026-11-18 12:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 14:41 [PATCH v2 0/6] Update BitBake in Isar 'Clara Kowalsky' via isar-users
2026-11-17 14:41 ` [PATCH v2 1/6] base: replace BitBake's outdated persist_data 'Clara Kowalsky' via isar-users
2026-11-17 14:41 ` [PATCH v2 2/6] isar-events: preserve cleanup for default multiconfig 'Clara Kowalsky' via isar-users
2026-11-17 14:41 ` [PATCH v2 3/6] wic: run the Python driver outside the imaging chroot 'Clara Kowalsky' via isar-users
2026-11-18 12:25 ` 'Moessbauer, Felix' via isar-users [this message]
2026-11-18 12:47 ` 'Moessbauer, Felix' via isar-users
2026-11-17 14:41 ` [PATCH v2 4/6] bitbake.conf: explicitly exclude export and func from signatures 'Clara Kowalsky' via isar-users
2026-11-17 14:41 ` [PATCH v2 5/6] meta: add missing whitespace around assignment operators 'Clara Kowalsky' via isar-users
2026-11-17 14:41 ` [PATCH v2 6/6] bitbake: update to branch 2.18, tag yocto-6.0.4 'Clara Kowalsky' via isar-users
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=908ddcf273ee9550b490473ff2a1cd39f4306446.camel@siemens.com \
--to=isar-users@googlegroups.com \
--cc=clara.kowalsky@siemens.com \
--cc=felix.moessbauer@siemens.com \
/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