From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] support: properly check for bash as a dependency
Date: Thu, 20 Mar 2014 21:43:59 +0100 [thread overview]
Message-ID: <532B530F.5050408@mind.be> (raw)
In-Reply-To: <20140318165518.GA3342@free.fr>
On 18/03/14 17:55, Yann E. MORIN wrote:
> Thomas, All,
>
> On 2014-03-18 06:01 +0100, Thomas Petazzoni spake thusly:
>> On Mon, 17 Mar 2014 11:42:34 +0100, Yann E. MORIN wrote:
>>
>>> So, calling "$SHELL --version" will still return "^GNU bash" no matter
>>> what shell is actually running.
Have you tested this? dependencies.sh is run from the Makefile, and that
says:
SHELL:=$(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi; fi)
[snip]
export SHELL CONFIG_SHELL quiet Q KBUILD_VERBOSE VERBOSE
So $SHELL _will_ be set to bash unless there is no bash.
>>>
>>> Since quite a lot of #!/bin/sh scripts are in fact bash scripts, we
>>> really want to ensure that /bin/sh is bash.
>>
>> I'm definitely against that. My system has /bin/sh pointing to dash,
>> and Buildroot works fine. One of the thing that annoyed me in
>> OpenEmbedded was its requirements to have /bin/sh be bash.
>>
>> We clearly don't want that.
>
> I'm just fine with that. :-)
>
> But the current check is broken anyway, as all it checks is that the
> login shell of the user is bash.
>
> - if we want to work whith dash as the system shell, then the current
> check is unneeded;
>
> - if we want to work with dash as the system shell, we don't care what
> login shell the user is using, as we must also work when this is dash;
>
> - SHELL is not mandated by POSIX, so it may be empty on a
> POSIX-compliant shell anyway.
>
> So, we should just remove this check altogether.
Not remove, but rather replace it with a check for /bin/bash existence.
We do have quite a lot of stuff referring to /bin/bash. bash in PATH is
not good enough.
Regards,
Arnout
>
>> I've just checked the Free Electrons autobuilders, and there are also
>> using dash as /bin/sh. This means that if configure scripts were using
>> bashims unsupported by dash, we would have noticed.
>
> Andrew, what package was the breakage due to?
>
> Regards,
> Yann E. MORIN.
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
prev parent reply other threads:[~2014-03-20 20:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-17 10:42 [Buildroot] [PATCH] support: properly check for bash as a dependency Yann E. MORIN
2014-03-17 21:28 ` Peter Korsgaard
2014-03-17 21:36 ` Yann E. MORIN
2014-03-17 22:01 ` Peter Korsgaard
2014-03-18 5:01 ` Thomas Petazzoni
2014-03-18 16:55 ` Yann E. MORIN
2014-03-18 18:27 ` Thomas Petazzoni
2014-03-20 20:43 ` Arnout Vandecappelle [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=532B530F.5050408@mind.be \
--to=arnout@mind.be \
--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