mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2] scripts: container.sh: don't add -v twice if unneeded
Date: Wed, 21 Jun 2023 09:51:59 +0200	[thread overview]
Message-ID: <20230621075159.GP18491@pengutronix.de> (raw)
In-Reply-To: <20230619104405.652821-1-a.fatoum@pengutronix.de>

On Mon, Jun 19, 2023 at 12:44:05PM +0200, Ahmad Fatoum wrote:
> The script bind mounts the barebox directory as in $PWD as well as the
> realpath into the container to reduce surprises when $PWD contains a
> symlinked path. In cases where the path is not symlinked, some podman
> versions complain about "duplicate mount destination". Fix this by only
> adding the second volume specification, if the path isn't already
> canonical.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> v1 -> v2:
>   - drop single quotes in double quotes. These were passed literally
>     to podman
> ---
>  scripts/container.sh | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Applied, thanks

Sascha

> 
> diff --git a/scripts/container.sh b/scripts/container.sh
> index eb1e87b59baa..2850f26fc749 100755
> --- a/scripts/container.sh
> +++ b/scripts/container.sh
> @@ -31,9 +31,13 @@ shift $((OPTIND-1))
>  
>  [ -n "$update" ] && podman pull "$CONTAINER"
>  
> +volumes="-v $PWD:$PWD:z"
>  pwd_real=$(realpath $PWD)
> +if [ "$(realpath --no-symlinks $PWD)" != "$pwd_real" ]; then
> +	volumes="$volumes -v $pwd_real:$pwd_real:z"
> +fi
>  
> -exec podman run -it -v "$PWD:$PWD:z" -v "$pwd_real:$pwd_real:z" --rm \
> +exec podman run -it $volumes --rm \
>  	-e TERM -e ARCH -e CONFIG -e JOBS -e LOGDIR -e REGEX \
>  	-e KCONFIG_ADD -w "$PWD" --userns=keep-id \
>  	-- "$CONTAINER" "${@:-/bin/bash}"
> -- 
> 2.39.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



      reply	other threads:[~2023-06-21  7:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-19 10:44 Ahmad Fatoum
2023-06-21  7:51 ` Sascha Hauer [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=20230621075159.GP18491@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=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