* [Buildroot] [PATCH] support/scripts: fix shebang with bash
@ 2017-06-05 7:37 Francois Perrad
2017-06-08 14:47 ` Peter Korsgaard
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Francois Perrad @ 2017-06-05 7:37 UTC (permalink / raw)
To: buildroot
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
support/scripts/br2-external | 2 +-
support/scripts/check-bin-arch | 2 +-
support/scripts/fix-configure-powerpc64.sh | 2 +-
support/scripts/genimage.sh | 2 +-
support/scripts/hardlink-or-copy | 2 +-
support/scripts/test-pkg | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/support/scripts/br2-external b/support/scripts/br2-external
index 7e816081..00cb57d1 100755
--- a/support/scripts/br2-external
+++ b/support/scripts/br2-external
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -e
# This script must be able to run with bash-3.1, so it can't use
diff --git a/support/scripts/check-bin-arch b/support/scripts/check-bin-arch
index ff974a71..b822cdd6 100755
--- a/support/scripts/check-bin-arch
+++ b/support/scripts/check-bin-arch
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
while getopts p:l:r:a: OPT ; do
case "${OPT}" in
diff --git a/support/scripts/fix-configure-powerpc64.sh b/support/scripts/fix-configure-powerpc64.sh
index ad710422..ff2b283c 100755
--- a/support/scripts/fix-configure-powerpc64.sh
+++ b/support/scripts/fix-configure-powerpc64.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# This is a script to find, and correct, a problem with old versions of
# configure that affect powerpc64 and powerpc64le.
diff --git a/support/scripts/genimage.sh b/support/scripts/genimage.sh
index 6c8d9e5a..625afc10 100755
--- a/support/scripts/genimage.sh
+++ b/support/scripts/genimage.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
die() {
echo "Error: $@" >&2
diff --git a/support/scripts/hardlink-or-copy b/support/scripts/hardlink-or-copy
index b046bdf0..a052318f 100755
--- a/support/scripts/hardlink-or-copy
+++ b/support/scripts/hardlink-or-copy
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# Try to hardlink a file into a directory, fallback to copy on failure.
#
diff --git a/support/scripts/test-pkg b/support/scripts/test-pkg
index f08c6087..7633a21e 100755
--- a/support/scripts/test-pkg
+++ b/support/scripts/test-pkg
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -e
TOOLCHAINS_URL='http://autobuild.buildroot.org/toolchains/configs/toolchain-configs.csv'
--
2.12.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] support/scripts: fix shebang with bash
2017-06-05 7:37 [Buildroot] [PATCH] support/scripts: fix shebang with bash Francois Perrad
@ 2017-06-08 14:47 ` Peter Korsgaard
2017-06-08 21:07 ` François Perrad
2017-06-08 19:32 ` Yann E. MORIN
2017-06-08 19:43 ` Thomas Petazzoni
2 siblings, 1 reply; 8+ messages in thread
From: Peter Korsgaard @ 2017-06-08 14:47 UTC (permalink / raw)
To: buildroot
>>>>> "Francois" == Francois Perrad <fperrad@gmail.com> writes:
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Out of interest, what distribution doesn't have bash in /bin?
#!/bin/bash is a quite common shebang, and we use it in several places
outside support/scripts.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] support/scripts: fix shebang with bash
2017-06-05 7:37 [Buildroot] [PATCH] support/scripts: fix shebang with bash Francois Perrad
2017-06-08 14:47 ` Peter Korsgaard
@ 2017-06-08 19:32 ` Yann E. MORIN
2017-06-08 19:43 ` Thomas Petazzoni
2 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2017-06-08 19:32 UTC (permalink / raw)
To: buildroot
Fran?ois, All,
On 2017-06-05 09:37 +0200, Francois Perrad spake thusly:
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Regards,
Yann E. MORIN.
> ---
> support/scripts/br2-external | 2 +-
> support/scripts/check-bin-arch | 2 +-
> support/scripts/fix-configure-powerpc64.sh | 2 +-
> support/scripts/genimage.sh | 2 +-
> support/scripts/hardlink-or-copy | 2 +-
> support/scripts/test-pkg | 2 +-
> 6 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/support/scripts/br2-external b/support/scripts/br2-external
> index 7e816081..00cb57d1 100755
> --- a/support/scripts/br2-external
> +++ b/support/scripts/br2-external
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
> set -e
>
> # This script must be able to run with bash-3.1, so it can't use
> diff --git a/support/scripts/check-bin-arch b/support/scripts/check-bin-arch
> index ff974a71..b822cdd6 100755
> --- a/support/scripts/check-bin-arch
> +++ b/support/scripts/check-bin-arch
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>
> while getopts p:l:r:a: OPT ; do
> case "${OPT}" in
> diff --git a/support/scripts/fix-configure-powerpc64.sh b/support/scripts/fix-configure-powerpc64.sh
> index ad710422..ff2b283c 100755
> --- a/support/scripts/fix-configure-powerpc64.sh
> +++ b/support/scripts/fix-configure-powerpc64.sh
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>
> # This is a script to find, and correct, a problem with old versions of
> # configure that affect powerpc64 and powerpc64le.
> diff --git a/support/scripts/genimage.sh b/support/scripts/genimage.sh
> index 6c8d9e5a..625afc10 100755
> --- a/support/scripts/genimage.sh
> +++ b/support/scripts/genimage.sh
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>
> die() {
> echo "Error: $@" >&2
> diff --git a/support/scripts/hardlink-or-copy b/support/scripts/hardlink-or-copy
> index b046bdf0..a052318f 100755
> --- a/support/scripts/hardlink-or-copy
> +++ b/support/scripts/hardlink-or-copy
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>
> # Try to hardlink a file into a directory, fallback to copy on failure.
> #
> diff --git a/support/scripts/test-pkg b/support/scripts/test-pkg
> index f08c6087..7633a21e 100755
> --- a/support/scripts/test-pkg
> +++ b/support/scripts/test-pkg
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
> set -e
>
> TOOLCHAINS_URL='http://autobuild.buildroot.org/toolchains/configs/toolchain-configs.csv'
> --
> 2.12.2
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] support/scripts: fix shebang with bash
2017-06-05 7:37 [Buildroot] [PATCH] support/scripts: fix shebang with bash Francois Perrad
2017-06-08 14:47 ` Peter Korsgaard
2017-06-08 19:32 ` Yann E. MORIN
@ 2017-06-08 19:43 ` Thomas Petazzoni
2 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2017-06-08 19:43 UTC (permalink / raw)
To: buildroot
Hello,
On Mon, 5 Jun 2017 09:37:40 +0200, Francois Perrad wrote:
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
> support/scripts/br2-external | 2 +-
> support/scripts/check-bin-arch | 2 +-
> support/scripts/fix-configure-powerpc64.sh | 2 +-
> support/scripts/genimage.sh | 2 +-
> support/scripts/hardlink-or-copy | 2 +-
> support/scripts/test-pkg | 2 +-
> 6 files changed, 6 insertions(+), 6 deletions(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] support/scripts: fix shebang with bash
2017-06-08 14:47 ` Peter Korsgaard
@ 2017-06-08 21:07 ` François Perrad
2017-06-08 21:58 ` Peter Korsgaard
0 siblings, 1 reply; 8+ messages in thread
From: François Perrad @ 2017-06-08 21:07 UTC (permalink / raw)
To: buildroot
2017-06-08 16:47 GMT+02:00 Peter Korsgaard <peter@korsgaard.com>:
> >>>>> "Francois" == Francois Perrad <fperrad@gmail.com> writes:
>
> > Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
>
> Out of interest, what distribution doesn't have bash in /bin?
> #!/bin/bash is a quite common shebang, and we use it in several places
> outside support/scripts.
>
>
I found this issue with NixOS (http://nixos.org/) where:
$ ls /bin
sh
$ ls /usr/bin
env
$ which bash
/run/current-system/sw/bin/bash
$ which which
/run/current-system/sw/bin/which
so, #!/bin/sh is the only shebang which doesn't require to start with
#!/usr/bin/env
Fran?ois
> --
> Bye, Peter Korsgaard
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170608/e352d69e/attachment.html>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] support/scripts: fix shebang with bash
2017-06-08 21:07 ` François Perrad
@ 2017-06-08 21:58 ` Peter Korsgaard
2017-06-09 8:18 ` François Perrad
0 siblings, 1 reply; 8+ messages in thread
From: Peter Korsgaard @ 2017-06-08 21:58 UTC (permalink / raw)
To: buildroot
>>>>> "Fran?ois" == Fran?ois Perrad <francois.perrad@gadz.org> writes:
> 2017-06-08 16:47 GMT+02:00 Peter Korsgaard <peter@korsgaard.com>:
>> >>>>> "Francois" == Francois Perrad <fperrad@gmail.com> writes:
>>
>> > Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
>>
>> Out of interest, what distribution doesn't have bash in /bin?
>> #!/bin/bash is a quite common shebang, and we use it in several places
>> outside support/scripts.
>>
>>
> I found this issue with NixOS (http://nixos.org/) where:
> $ ls /bin
> sh
> $ ls /usr/bin
> env
> $ which bash
> /run/current-system/sw/bin/bash
> $ which which
> /run/current-system/sw/bin/which
> so, #!/bin/sh is the only shebang which doesn't require to start with
> #!/usr/bin/env
And /bin/sh is a symlink to /run/current-system/sw/bin/bash? Otherwise I
don't understand how the logic in Makefile and
support/dependencies/dependencies.sh could work?
What about packages? Are there no package build systems that hardcodes
/bin/bash?
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] support/scripts: fix shebang with bash
2017-06-08 21:58 ` Peter Korsgaard
@ 2017-06-09 8:18 ` François Perrad
2017-06-09 8:50 ` Peter Korsgaard
0 siblings, 1 reply; 8+ messages in thread
From: François Perrad @ 2017-06-09 8:18 UTC (permalink / raw)
To: buildroot
2017-06-08 23:58 GMT+02:00 Peter Korsgaard <peter@korsgaard.com>:
> >>>>> "Fran?ois" == Fran?ois Perrad <francois.perrad@gadz.org> writes:
>
> > 2017-06-08 16:47 GMT+02:00 Peter Korsgaard <peter@korsgaard.com>:
> >> >>>>> "Francois" == Francois Perrad <fperrad@gmail.com> writes:
> >>
> >> > Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> >>
> >> Out of interest, what distribution doesn't have bash in /bin?
> >> #!/bin/bash is a quite common shebang, and we use it in several places
> >> outside support/scripts.
> >>
> >>
> > I found this issue with NixOS (http://nixos.org/) where:
> > $ ls /bin
> > sh
> > $ ls /usr/bin
> > env
> > $ which bash
> > /run/current-system/sw/bin/bash
> > $ which which
> > /run/current-system/sw/bin/which
>
> > so, #!/bin/sh is the only shebang which doesn't require to start with
> > #!/usr/bin/env
>
> And /bin/sh is a symlink to /run/current-system/sw/bin/bash? Otherwise I
> don't understand how the logic in Makefile and
> support/dependencies/dependencies.sh could work?
>
/bin/sh is a symlink to
/nix/store/bxr5lwdhhgfh1p28mh3w7kyc0spk7niz-bash-4.4-p5/bin/sh
/run/current-system/sw/bin/bash is a symlink to
/nix/store/bxr5lwdhhgfh1p28mh3w7kyc0spk7niz-bash-4.4-p5/bin/bash
>
> What about packages? Are there no package build systems that hardcodes
> /bin/bash?
>
No.
Packages needed by Buildroot could be declared like this :
https://github.com/fperrad/misc/blob/master/nix/buildroot.nix
Fran?ois
>
> --
> Bye, Peter Korsgaard
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170609/65605813/attachment.html>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] support/scripts: fix shebang with bash
2017-06-09 8:18 ` François Perrad
@ 2017-06-09 8:50 ` Peter Korsgaard
0 siblings, 0 replies; 8+ messages in thread
From: Peter Korsgaard @ 2017-06-09 8:50 UTC (permalink / raw)
To: buildroot
>>>>> "Fran?ois" == Fran?ois Perrad <francois.perrad@gadz.org> writes:
Hi,
>> And /bin/sh is a symlink to /run/current-system/sw/bin/bash? Otherwise I
>> don't understand how the logic in Makefile and
>> support/dependencies/dependencies.sh could work?
>>
> /bin/sh is a symlink to
> /nix/store/bxr5lwdhhgfh1p28mh3w7kyc0spk7niz-bash-4.4-p5/bin/sh
> /run/current-system/sw/bin/bash is a symlink to
> /nix/store/bxr5lwdhhgfh1p28mh3w7kyc0spk7niz-bash-4.4-p5/bin/bash
Ok, and than ../bin/sh is presumably a symlink to ../bin/bash?
>> What about packages? Are there no package build systems that hardcodes
>> /bin/bash?
>>
> No.
> Packages needed by Buildroot could be declared like this :
> https://github.com/fperrad/misc/blob/master/nix/buildroot.nix
What I mean is that seeing scripts with the #!/bin/bash shebang is quite
common, so I wouldn't be surprised if some of the upstream build systems
used by some of the packages we have in buildroot use that.
For one, some of our board specific scripts use it:
board/stmicroelectronics/stm32f429-disco/flash.sh:#!/bin/bash
board/stmicroelectronics/stm32f469-disco/flash.sh:#!/bin/bash
board/technologic/ts4800/post-image.sh:#!/bin/bash
board/technologic/ts4900/post-image.sh:#!/bin/bash
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-06-09 8:50 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-05 7:37 [Buildroot] [PATCH] support/scripts: fix shebang with bash Francois Perrad
2017-06-08 14:47 ` Peter Korsgaard
2017-06-08 21:07 ` François Perrad
2017-06-08 21:58 ` Peter Korsgaard
2017-06-09 8:18 ` François Perrad
2017-06-09 8:50 ` Peter Korsgaard
2017-06-08 19:32 ` Yann E. MORIN
2017-06-08 19:43 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox