* [PATCH 1/2] fix(imager): mount base-apt on unshare if needed
@ 2026-07-28 8:20 'Felix Moessbauer' via isar-users
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
0 siblings, 2 replies; 3+ messages in thread
From: 'Felix Moessbauer' via isar-users @ 2026-07-28 8:20 UTC (permalink / raw)
To: isar-users; +Cc: Felix Moessbauer
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.
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH 2/2] fix(imager): correctly expand to-be-installed package list
2026-07-28 8:20 [PATCH 1/2] fix(imager): mount base-apt on unshare if needed 'Felix Moessbauer' via isar-users
@ 2026-07-28 8:20 ` 'Felix Moessbauer' via isar-users
2026-07-31 8:28 ` [PATCH 1/2] fix(imager): mount base-apt on unshare if needed Zhihang Wei
1 sibling, 0 replies; 3+ messages in thread
From: 'Felix Moessbauer' via isar-users @ 2026-07-28 8:20 UTC (permalink / raw)
To: isar-users; +Cc: Felix Moessbauer
The local_install variable is a shell variable. By that, it has to be
explicitly passed to the heredocs that expand the variables in the outer
shell. In case of the package pre-caching, this was done on the wrong
level: inside the lockrun heredoc, but without passing it to the lockrun
heredoc. By that, the variable was effectively empty, meaning no
packages have been downloaded and cached.
The later heredoc that does the install then downloaded the packages
(instead of just taking them from the cache), which works but also does
mean the packages were never added to the downloads cache. On subsequent
offline builds, these packages were missing, breaking the 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>
---
meta/classes-recipe/image-tools-extension.bbclass | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/classes-recipe/image-tools-extension.bbclass b/meta/classes-recipe/image-tools-extension.bbclass
index 313c81aa..8f666444 100644
--- a/meta/classes-recipe/image-tools-extension.bbclass
+++ b/meta/classes-recipe/image-tools-extension.bbclass
@@ -169,8 +169,9 @@ EOF
E="${@ isar_export_proxies(d)}"
deb_dl_dir_import ${ROOTFS_IMAGETOOLS} ${distro}
+ local_install=$local_install \
${SCRIPTSDIR}/lockrun.py -r -f "${REPO_ISAR_DIR}/isar.lock" -s <<'EOAPT'
- local_install=$local_install ${@run_privileged_cmd(d)} /bin/bash -s <<'EOF'
+ ${@run_privileged_cmd(d)} /bin/bash -s <<'EOF'
set -e
${@insert_isar_mounts(d, d.getVar('ROOTFS_IMAGETOOLS'), d.getVar('IMAGER_UNSHARE_MOUNTS'))}
chroot ${ROOTFS_IMAGETOOLS} apt-get update \
--
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-2-felix.moessbauer%40siemens.com.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 1/2] fix(imager): mount base-apt on unshare if needed
2026-07-28 8:20 [PATCH 1/2] fix(imager): mount base-apt on unshare if needed 'Felix Moessbauer' via isar-users
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 ` Zhihang Wei
1 sibling, 0 replies; 3+ messages in thread
From: Zhihang Wei @ 2026-07-31 8:28 UTC (permalink / raw)
To: Felix Moessbauer, isar-users
Applied to next, thanks.
Zhihang
On 7/28/26 10:20, 'Felix Moessbauer' via isar-users wrote:
> 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
>
--
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/9c5a3a1d-a59a-47aa-9cff-c72d2a06c99f%40ilbers.de.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-31 8:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-28 8:20 [PATCH 1/2] fix(imager): mount base-apt on unshare if needed 'Felix Moessbauer' via isar-users
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox