mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] scripts: container.sh: explicitly pass build dir as volume
@ 2026-01-05 15:13 Ahmad Fatoum
  2026-02-23 11:27 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread

* Re: [PATCH] scripts: container.sh: explicitly pass build dir as volume
  2026-01-05 15:13 [PATCH] scripts: container.sh: explicitly pass build dir as volume Ahmad Fatoum
@ 2026-02-23 11:27 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2026-02-23 11:27 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Mon, 05 Jan 2026 16:13:14 +0100, Ahmad Fatoum wrote:
> 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.
> 
> [...]

Applied, thanks!

[1/1] scripts: container.sh: explicitly pass build dir as volume
      https://git.pengutronix.de/cgit/barebox/commit/?id=c2c4023b9849 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-02-23 11:28 UTC | newest]

Thread overview: 2+ messages (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
2026-02-23 11:27 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox