From: Anton Mikanovich <amikan@ilbers.de>
To: Felix Moessbauer <felix.moessbauer@siemens.com>,
isar-users@googlegroups.com
Cc: cedric.hombourger@siemens.com
Subject: Re: [RFC 2/2] rootfs: use host apt when installing in cross mode
Date: Tue, 21 Jul 2026 16:58:49 +0300 [thread overview]
Message-ID: <9145ccb1-1679-497f-a467-e7dad05e964a@ilbers.de> (raw)
In-Reply-To: <20260720105228.395364-2-felix.moessbauer@siemens.com>
20.07.2026 13:52, 'Felix Moessbauer' via isar-users wrote:
> Currently the apt inside the chroot is used to perform the extraction
> and installation. This is really slow on non native architectures (esp.
> on larger packages), as the whole operation is emulated.
>
> We improve this by using the host apt for the dependency resolution,
> unpack and configure operation. The dpkg chroots into the rootfs to run
> the target maintainer scripts (emulated via qemu in cross builds),
> mirroring how mmdebstrap installs. As we already have all packages in
> the apt cache (since e09589d28), we don't need to mount the isar apt or
> base apt - which would not work as the host apt would lookup the
> absolute apt paths on the host (i.e. read /isar-apt from the host
> instead of the chroot).
>
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
> meta/classes-recipe/rootfs.bbclass | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/meta/classes-recipe/rootfs.bbclass b/meta/classes-recipe/rootfs.bbclass
> index 6af29b40..95210f4c 100644
> --- a/meta/classes-recipe/rootfs.bbclass
> +++ b/meta/classes-recipe/rootfs.bbclass
> @@ -390,9 +390,15 @@ rootfs_install_pkgs_install[network] = "${TASK_USE_SUDO}"
> rootfs_install_pkgs_install() {
> run_privileged_heredoc <<'EOF'
> set -e
> + # Unpack and configure packages using the host apt. Dependency resolution
> + # and the apt frontend run natively (-o Dir points at the rootfs), while
> + # dpkg chroots into the rootfs to run the target maintainer scripts
> + # (emulated via qemu in cross builds), mirroring how mmdebstrap installs.
> ${@insert_isar_mounts(d, d.getVar('ROOTFSDIR'), d.getVar('ROOTFS_MOUNTS')) if d.getVar('ISAR_CHROOT_MODE') == 'unshare' else ''}
> - chroot "${ROOTFSDIR}" \
> - /usr/bin/apt-get ${ROOTFS_APT_ARGS} --no-download ${ROOTFS_PACKAGES}
> + /usr/bin/apt-get -o APT::Architecture=${ROOTFS_ARCH} \
> + -o Dir="${ROOTFSDIR}" \
> + -o DPkg::Chroot-Directory="${ROOTFSDIR}" \
> + ${ROOTFS_APT_ARGS} --no-download ${ROOTFS_PACKAGES}
I think we can drop full binary path here and just let the host OS use its
PATH value.
> EOF
> }
>
--
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/9145ccb1-1679-497f-a467-e7dad05e964a%40ilbers.de.
next prev parent reply other threads:[~2026-07-21 13:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 10:52 [RFC 1/2] rootfs: download packages with host apt 'Felix Moessbauer' via isar-users
2026-07-20 10:52 ` [RFC 2/2] rootfs: use host apt when installing in cross mode 'Felix Moessbauer' via isar-users
2026-07-21 13:58 ` Anton Mikanovich [this message]
2026-07-21 13:56 ` [RFC 1/2] rootfs: download packages with host apt Anton Mikanovich
2026-07-21 15:02 ` 'MOESSBAUER, Felix' 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=9145ccb1-1679-497f-a467-e7dad05e964a@ilbers.de \
--to=amikan@ilbers.de \
--cc=cedric.hombourger@siemens.com \
--cc=felix.moessbauer@siemens.com \
--cc=isar-users@googlegroups.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