All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/3] utils/docker-run: allow to specify extra mount points to propagate
@ 2024-07-13 14:43 Arnout Vandecappelle via buildroot
  2024-07-13 14:43 ` [Buildroot] [PATCH 2/3] utils/docker-run: also mount externals Arnout Vandecappelle via buildroot
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2024-07-13 14:43 UTC (permalink / raw)
  To: buildroot; +Cc: Fiona Klute (WIWA)

Sometimes, the build needs access to directories which are outside of
the current directory, e.g. for pre-downloaded toolchains, local kernel
sources, OVERRIDE_SRCDIR, BR2_EXTERNALs, ... We need these to be mounted
into the container to be able to perform the build.

Since there is no generic way to find out all the directories that are
needed, we need a manual mechanism. We choose the environment variable
EXTRA_MOUNTPOINTS which contains a space-separated list of directories
(or files) to mount.

We choose an environment variable to avoid having to parse command-line
arguments to docker-run.

Update the terse documentation in utils/readme.txt with this
information.

Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
---
 utils/docker-run | 5 +++++
 utils/readme.txt | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/utils/docker-run b/utils/docker-run
index 1adb02d74e..3bb7b6a41b 100755
--- a/utils/docker-run
+++ b/utils/docker-run
@@ -90,6 +90,11 @@ if [ "${BR2_DL_DIR}" ]; then
     docker_opts+=( --env BR2_DL_DIR )
 fi
 
+if [ -n "${EXTRA_MOUNTPOINTS:-}" ]; then
+    read -r -a extra_mountpoints <<<"${EXTRA_MOUNTPOINTS}"
+    mountpoints+=( "${extra_mountpoints[@]}" )
+fi
+
 # shellcheck disable=SC2013 # can't use while-read because of the assignment
 for dir in $(printf '%s\n' "${mountpoints[@]}" |LC_ALL=C sort -u); do
     docker_opts+=( --mount "type=bind,src=${dir},dst=${dir}" )
diff --git a/utils/readme.txt b/utils/readme.txt
index 6488d13c75..0cc665e478 100644
--- a/utils/readme.txt
+++ b/utils/readme.txt
@@ -21,7 +21,10 @@ check-package
 docker-run
     a script that runs a command (like make check-package) inside the
     buildroot CI docker container; pass no command to get an interactive
-    shell.
+    shell. If additional directories need to be accessible inside the
+    container, specify them with the environment variable EXTRA_MOUNTPOINTS.
+    The buildroot directory, the current directory, and the download
+    directory are automatically propagated.
 
 genrandconfig
     a script that generates a random configuration, used by the autobuilders
-- 
2.45.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2024-07-14 11:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-13 14:43 [Buildroot] [PATCH 1/3] utils/docker-run: allow to specify extra mount points to propagate Arnout Vandecappelle via buildroot
2024-07-13 14:43 ` [Buildroot] [PATCH 2/3] utils/docker-run: also mount externals Arnout Vandecappelle via buildroot
2024-07-13 16:33   ` Brandon Maier via buildroot
2024-07-13 14:43 ` [Buildroot] [PATCH 3/3] utils/brmake: allow override of MAKE Arnout Vandecappelle via buildroot
2024-07-13 16:24 ` [Buildroot] [PATCH 1/3] utils/docker-run: allow to specify extra mount points to propagate Brandon Maier via buildroot
2024-07-13 16:30   ` Arnout Vandecappelle via buildroot
2024-07-13 19:48     ` Brandon Maier via buildroot
2024-07-14 11:09       ` Fiona Klute via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.