From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>,
Ricardo Martincoski <ricardo.martincoski@gmail.com>,
buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/2] utils/docker-run: use portable bash shebang
Date: Mon, 14 Feb 2022 18:04:56 +0100 [thread overview]
Message-ID: <20220214170456.GE38097@scaer> (raw)
In-Reply-To: <20220214162413.17301-1-luca@lucaceresoli.net>
Luca, All,
Series of two applied to master, thanks.
As Giulio requested, an additional patch to use --rm would be nice.
And now there is something that strikes me: we bind-mount the Buildroot
tree as the home of the br-user, so we don't have any file from the
br-user avvailable at all, so we can as well run the container with the
local user, by running with:
--user $(id -u):$(id -g)
This way, there wil no longer be any issue with file acccess rights.
There would however be the issue that the paths in the container would
not be the same as on the host, but we can also alleviate that isue by
doing the bind-mount in the same location (Docker creates the montpoint
if it does not exists prior do doing the mount), and change the cwd:
exec docker run \
-it --rm \
--workdir "${MAIN_DIR}" \
--mount "type=bind,src=${MAIN_DIR},dst=${MAIN_DIR}" \
"${IMAGE}" \
"$@"
Et voilà, that's much more interesting now! :-]
Care to send a patch please? ;-)
Regards,
Yann E. MORIN.
On 2022-02-14 17:24 +0100, Luca Ceresoli spake thusly:
> /usr/bin/bash does not exist on Ubuntu 2018.04. Use the more portable
> alternative /bin/bash.
>
> Note that currently "/usr/bin/bash" does not appear anywhere in the
> Buildroot source code, while "/bin/bash" is used by many scripts.
>
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> Fixes: 242e9d72e7d2 ("utils/docker-run: new script")
> ---
> utils/docker-run | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/utils/docker-run b/utils/docker-run
> index 0614f1325d78..979aec69b946 100755
> --- a/utils/docker-run
> +++ b/utils/docker-run
> @@ -1,4 +1,4 @@
> -#!/usr/bin/bash
> +#!/bin/bash
> set -o errexit -o pipefail
> DIR=$(dirname "${0}")
> MAIN_DIR=$(readlink -f "${DIR}/..")
> --
> 2.35.1
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
prev parent reply other threads:[~2022-02-14 17:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-14 16:24 [Buildroot] [PATCH 1/2] utils/docker-run: use portable bash shebang Luca Ceresoli
2022-02-14 16:24 ` [Buildroot] [PATCH 2/2] utils/docker-run: allow interactive use Luca Ceresoli
2022-02-14 16:28 ` Giulio Benetti
2022-02-14 16:36 ` [Buildroot] [PATCH 1/2] utils/docker-run: use portable bash shebang Yann E. MORIN
2022-02-14 17:04 ` Yann E. MORIN [this message]
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=20220214170456.GE38097@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@buildroot.org \
--cc=giulio.benetti@benettiengineering.com \
--cc=luca@lucaceresoli.net \
--cc=ricardo.martincoski@gmail.com \
/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.