mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] scripts: container.sh: explicitly pass build dir as volume
Date: Mon,  5 Jan 2026 16:13:14 +0100	[thread overview]
Message-ID: <20260105151328.87837-1-a.fatoum@pengutronix.de> (raw)

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




                 reply	other threads:[~2026-01-05 15:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260105151328.87837-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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