From: "'Felix Moessbauer' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH 1/2] fix(imager): mount base-apt on unshare if needed
Date: Tue, 28 Jul 2026 10:20:09 +0200 [thread overview]
Message-ID: <20260728082010.687942-1-felix.moessbauer@siemens.com> (raw)
In case the build is performed with ISAR_USE_CACHED_BASE_REPO, we need
to mount the base-apt in the imager_run as well. Otherwise, tooling that
is only needed during imaging is not cached and by that is not available
on the next offline build.
This fix is related to the ReproTest with -p rootless=1.
Fixes: 4fedb1ae ("add support for fully rootless builds")
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
.../classes-recipe/image-tools-extension.bbclass | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/meta/classes-recipe/image-tools-extension.bbclass b/meta/classes-recipe/image-tools-extension.bbclass
index c75025ca..313c81aa 100644
--- a/meta/classes-recipe/image-tools-extension.bbclass
+++ b/meta/classes-recipe/image-tools-extension.bbclass
@@ -19,6 +19,16 @@ SCHROOT_MOUNTS += "${REPO_ISAR_DIR}/${DISTRO}:/isar-apt"
# only used on unshare
ROOTFS_IMAGETOOLS ?= "${WORKDIR}/rootfs-imgtools-${BB_CURRENTTASK}"
+# mirror the handling of ROOTFS_MOUNTS in rootfs.bbclass, only used on unshare
+IMAGER_UNSHARE_MOUNTS ?= "${SCHROOT_MOUNTS}"
+
+python () {
+ if bb.utils.to_boolean(d.getVar('ISAR_USE_CACHED_BASE_REPO')) \
+ and ':/base-apt' not in d.getVar('IMAGER_UNSHARE_MOUNTS', False):
+ d.appendVar('IMAGER_UNSHARE_MOUNTS',
+ ' {}:/base-apt'.format(d.getVar('REPO_BASE_DIR')))
+}
+
imager_run() {
imager_run_${ISAR_CHROOT_MODE} "$@"
}
@@ -162,7 +172,7 @@ EOF
${SCRIPTSDIR}/lockrun.py -r -f "${REPO_ISAR_DIR}/isar.lock" -s <<'EOAPT'
local_install=$local_install ${@run_privileged_cmd(d)} /bin/bash -s <<'EOF'
set -e
- ${@insert_isar_mounts(d, d.getVar('ROOTFS_IMAGETOOLS'), d.getVar('SCHROOT_MOUNTS'))}
+ ${@insert_isar_mounts(d, d.getVar('ROOTFS_IMAGETOOLS'), d.getVar('IMAGER_UNSHARE_MOUNTS'))}
chroot ${ROOTFS_IMAGETOOLS} apt-get update \
-o Dir::Etc::SourceList='sources.list.d/isar-apt.list' \
-o Dir::Etc::SourceParts='-' \
@@ -176,7 +186,7 @@ EOAPT
deb_dl_dir_export ${ROOTFS_IMAGETOOLS} ${distro}
local_install=$local_install run_privileged_heredoc <<'EOF'
set -e
- ${@insert_isar_mounts(d, d.getVar('ROOTFS_IMAGETOOLS'), d.getVar('SCHROOT_MOUNTS'))}
+ ${@insert_isar_mounts(d, d.getVar('ROOTFS_IMAGETOOLS'), d.getVar('IMAGER_UNSHARE_MOUNTS'))}
chroot ${ROOTFS_IMAGETOOLS} apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y \
--allow-unauthenticated --allow-downgrades install \
$local_install
@@ -186,7 +196,7 @@ EOF
run_privileged_heredoc <<'EOF' "$@"
set -e
mkdir -p ${ROOTFS_IMAGETOOLS}/${SCRIPTSDIR}
- ${@insert_isar_mounts(d, d.getVar('ROOTFS_IMAGETOOLS'), d.getVar('SCHROOT_MOUNTS'))}
+ ${@insert_isar_mounts(d, d.getVar('ROOTFS_IMAGETOOLS'), d.getVar('IMAGER_UNSHARE_MOUNTS'))}
chroot ${ROOTFS_IMAGETOOLS} "$@" <&3
EOF
--
2.53.0
--
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/20260728082010.687942-1-felix.moessbauer%40siemens.com.
next reply other threads:[~2026-07-28 8:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 8:20 'Felix Moessbauer' via isar-users [this message]
2026-07-28 8:20 ` [PATCH 2/2] fix(imager): correctly expand to-be-installed package list 'Felix Moessbauer' via isar-users
2026-07-31 8:28 ` [PATCH 1/2] fix(imager): mount base-apt on unshare if needed Zhihang Wei
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=20260728082010.687942-1-felix.moessbauer@siemens.com \
--to=isar-users@googlegroups.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