Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] Add dependency on bash to gzip for runtime
Date: Thu, 17 Sep 2015 19:23:15 +0200	[thread overview]
Message-ID: <20150917192315.6db18115@free-electrons.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1509171922410.13941@orcam81.orcam.lan>

Dear Jonathan Ben Avraham,

On Thu, 17 Sep 2015 19:33:24 +0300 (IDT), Jonathan Ben Avraham wrote:

> > Then we should probably patch the problem and send upstream. gzip bundled
> > scripts are pretty trivial, and AFAICS, should work under any POSIX-like
> > shell.
> 
> But we would at least need to ln -s /bin/<ash|dash> /bin/bash in 
> Buildroot, no? so maybe the upstream fix is to change the hashbangs from 
> /bin/bash to /bin/sh. Do you really think that the gzip upstream would 
> accept this?

All the gzip scripts are in fact generated. zgrep is generated from
zgrep.in. zgrep.in contains:

#!/bin/sh

which gets replaced by the gzip Makefile.am by the value of $(SHELL):

SUFFIXES = .in
.in:
        $(AM_V_GEN)sed \
                -e 's|/bin/sh|$(SHELL)|g' \
                -e 's|[@]bindir@|'\''$(bindir)'\''|g' \
                -e 's|[@]GREP@|$(GREP)|g' \
                -e 's|[@]VERSION@|$(VERSION)|g' \
                $(srcdir)/$@.in >$@-t \
          && chmod a+x $@-t \
          && mv $@-t $@

Which is completely wrong, because it makes the assumption that
$(SHELL) on your build machine is going to be available on your target.

So your patch is in fact wrong I believe, because if someone is using
zsh, or tcsh or some other shell on their build machine, $(SHELL) will
point to this shell and not to bash, and the scripts generated by gzip
will use zsh/tcsh, etc. on the target.

So the proper way is most likely to adjust the gzip build system so
that we can pass at configure time a different value for the shell path
on the target (and it would default to $(SHELL) is not passed).

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2015-09-17 17:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-17 14:46 [Buildroot] [PATCH 1/2] Add dependency on bash to gzip for runtime Jonathan Ben-Avraham
2015-09-17 14:46 ` [Buildroot] [PATCH 2/2] Add dependency on gzip to lxc " Jonathan Ben-Avraham
2015-09-17 15:03   ` Baruch Siach
2015-09-17 15:20     ` Jonathan Ben Avraham
2015-09-17 17:16       ` Thomas Petazzoni
2015-09-17 15:01 ` [Buildroot] [PATCH 1/2] Add dependency on bash to gzip " Baruch Siach
2015-09-17 15:16   ` Jonathan Ben Avraham
2015-09-17 16:20     ` Baruch Siach
2015-09-17 16:33       ` Jonathan Ben Avraham
2015-09-17 17:23         ` Thomas Petazzoni [this message]
2015-09-17 19:04           ` Baruch Siach
2015-09-17 20:15             ` Thomas Petazzoni
2015-09-19 20:36               ` Jonathan Ben Avraham
2015-09-20  8:22                 ` Thomas Petazzoni
2015-09-20 10:39                   ` Arnout Vandecappelle
2015-09-20 11:16                     ` Thomas Petazzoni
2015-09-20 11:35                       ` Baruch Siach

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=20150917192315.6db18115@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /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