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 2/3] utils/docker-run: also mount externals
Date: Sat, 13 Jul 2024 16:33:41 +0000 [thread overview]
Message-ID: <D2OK174T21RK.3UMDWJLPTP3AQ@collins.com> (raw)
In-Reply-To: <20240713144316.403640-2-arnout@mind.be>
Hi Arnout,
On Sat Jul 13, 2024 at 2:43 PM UTC, Arnout Vandecappelle via buildroot wrote:
> When building in docker, we may want to include BR2_EXTERNALs that are
> not in the current directory. These need to be mounted into the
> container as well.
>
> There is unfortunately no easy, generic way to find the list of
> externals, except by running `make printvars`, but we'd need to run that
> inside the container with all the command-line overrides set in order to
> be fully correct. That is pretty hopeless, so as an approximation we
> look for `.br2-external.mk` in the current directory.
I have a maybe bad idea. But Buildroot does have a feature where it will
call `make` inside of `make` to set umask and other args, the '_all'
target in '$(TOPDIR)/Makefile'. Could we support all of these features
like this?
ifeq ($(BR2_ENABLE_DOCKER),y)
ifeq ($(BR2_SOME_VARIABLE_SET_INSIDE_DOCKER),)
_all:
$(TOPDIR)/utils/docker-run umask $(REQ_UMASK) && $(MAKE) ...
else
_all:
...
endif
Buildroot has access to the actual BR2_EXTERNAL, OUTPUT_DIR, etc. So it
would be able to call docker-run with the correct arguments. And then it
would work when calling make from $(TOPDIR), or from inside custom
scripts like `brmake`.
Thanks,
Brandon
>
> Clearly this is quite limited because it doesn't support O= or
> BR2_EXTERNAL= passed on the command line. This also means that the first
> time, it doesn't work at all, because .br2-external.mk doesn't exist
> yet. The EXTRA_MOUNTPOINTS feature can be used for that.
>
> Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
> ---
> Since this feature is not bulletproof, and EXTRA_MOUNTPOINTS already
> covers the use case, it's perhaps not necessary to include this patch.
> ---
> utils/docker-run | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/utils/docker-run b/utils/docker-run
> index 3bb7b6a41b..76fb81b074 100755
> --- a/utils/docker-run
> +++ b/utils/docker-run
> @@ -29,6 +29,19 @@ declare -a mountpoints=(
> "$(pwd)"
> )
>
> +# If any externals are defined, mount them as well. We assume that the current
> +# directory is OUTPUT_DIR - ideally we'd parse O= and BR2_EXTERNAL= from the
> +# command line but that's not really feasible in practice.
> +if [ -e '.br2-external.mk' ]; then
> + mapfile -t mountpoints_external < <(
> + # We obviously want to quote the make syntax here
> + # shellcheck disable=SC2016
> + make -f .br2-external.mk -E \
> + 'default:; @:$(foreach external,$(BR2_EXTERNAL_DIRS),$(info $(external)))'
> + )
> + mountpoints+=("${mountpoints_external[@]}")
> +fi
> +
> # We use the PODMAN_USERNS environment variable rather than using the
> # --userns command line argument because Fedora system may have the
> # podman-docker package installed, providing the "docker"
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2024-07-13 16:33 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 [this message]
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
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=D2OK174T21RK.3UMDWJLPTP3AQ@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.