From: Brandon Maier via buildroot <buildroot@buildroot.org>
To: "Arnout Vandecappelle" <arnout@mind.be>, <buildroot@buildroot.org>
Cc: "Fiona Klute \(WIWA\)" <fiona.klute@gmx.de>
Subject: Re: [Buildroot] [PATCH 1/3] utils/docker-run: allow to specify extra mount points to propagate
Date: Sat, 13 Jul 2024 16:24:52 +0000 [thread overview]
Message-ID: <D2OJUFSZ6Y3N.CIWMCVYF7ZFS@collins.com> (raw)
In-Reply-To: <20240713144316.403640-1-arnout@mind.be>
Hi Arnout,
On Sat Jul 13, 2024 at 2:43 PM UTC, Arnout Vandecappelle via buildroot wrote:
> 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}"
I think it would be good to use `IFS=:` here and split EXTRA_MOUNTPOINTS
on ':'. That would make sure we don't split on other unexpected
characters like spaces, tabs, and newlines. And it would be consistent
with how BR2_EXTERNAL works.
Thanks,
Brandon
> + 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
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2024-07-13 16:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Brandon Maier via buildroot [this message]
2024-07-13 16:30 ` [Buildroot] [PATCH 1/3] utils/docker-run: allow to specify extra mount points to propagate Arnout Vandecappelle via buildroot
2024-07-13 19:48 ` Brandon Maier via buildroot
2024-07-14 11:09 ` Fiona Klute via buildroot
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=D2OJUFSZ6Y3N.CIWMCVYF7ZFS@collins.com \
--to=buildroot@buildroot.org \
--cc=arnout@mind.be \
--cc=brandon.maier@collins.com \
--cc=fiona.klute@gmx.de \
/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 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.