* [PATCH] scripts: container.sh: explicitly pass build dir as volume
@ 2026-01-05 15:13 Ahmad Fatoum
0 siblings, 0 replies; only message in thread
From: Ahmad Fatoum @ 2026-01-05 15:13 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
For cases, where KBUILD_OUTPUT/LG_BUILDDIR may be a symlink, processes
running inside the container may not have the necessary permissions to
follow it.
Fix this by calling realpath on it and explicitly registering it as
volume.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
scripts/container.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/scripts/container.sh b/scripts/container.sh
index 90c3a1d0accd..5375fdd91d39 100755
--- a/scripts/container.sh
+++ b/scripts/container.sh
@@ -41,6 +41,15 @@ if [ "$(realpath --no-symlinks $PWD)" != "$pwd_real" ]; then
volumes="$volumes -v $pwd_real:$pwd_real:z"
fi
+if [ -n "$KBUILD_OUTPUT" ]; then
+ KBUILD_OUTPUT=$(realpath $KBUILD_OUTPUT)
+ volumes="$volumes -v $KBUILD_OUTPUT:$KBUILD_OUTPUT:z"
+fi
+if [ -n "$LG_BUILDDIR" ] && [ "$KBUILD_OUTPUT" != "$LG_BUILDDIR" ]; then
+ LG_BUILDDIR=$(realpath $LG_BUILDDIR)
+ volumes="$volumes -v $LG_BUILDDIR:$LG_BUILDDIR:z"
+fi
+
exec podman run -it $volumes --rm \
-e TERM -e ARCH -e CONFIG -e JOBS -e LOGDIR -e REGEX \
-e KBUILD_OUTPUT -e LG_BUILDDIR $env \
--
2.47.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-01-05 15:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-05 15:13 [PATCH] scripts: container.sh: explicitly pass build dir as volume Ahmad Fatoum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox