Skip to contentSkip to conversation

New: Consider using /usr/bin/env bash in scripts

Buildroot bugzilla at busybox.net 3 participants 6 messages May 11, 2011 – Jan 31, 2012 Kbuild

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=3703

Summary: Consider using /usr/bin/env bash in scripts
Product: buildroot
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: minor
Priority: P5
Component: Other
AssignedTo: unassigned at buildroot.uclibc.org
ReportedBy: holger+br at freyther.de
CC: buildroot at uclibc.org
Estimated Hours: 0.0

On FreeBSD bash will not be inside /bin/bash but will be in /usr/local/bin/bash, by using /usr/bin/env bash one can have a script that works well with a Linux system and FreeBSD.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#1 lore raw
Quoted 17 lines · bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=3703

Summary: Consider using /usr/bin/env bash in scripts
Product: buildroot
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: minor
Priority: P5
Component: Other
AssignedTo: unassigned at buildroot.uclibc.org
ReportedBy: holger+br at freyther.de
CC: buildroot at uclibc.org
Estimated Hours: 0.0

Quoted 4 lines

On FreeBSD bash will not be inside /bin/bash but will be in /usr/local/bin/bash, by using /usr/bin/env bash one can have a script that works well with a Linux system and FreeBSD.

When did Build Root start building FreeBSD systems? I must have missed that memo.

Mike

#2 lore raw

[Buildroot] [Bug 3703] Consider using /usr/bin/env bash in scripts

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=3703

--- Comment #1 from Peter Korsgaard <[email protected]> --- Does buildroot otherwise work on freebsd? I would expect some of the host packages to fail.

I'm not against freebsd support as such, but it needs active testers to ensure it keeps working as all the main devs use Linux.

In general, the least troublesome option for building embedded Linux systems with buildroot is running it on a Linux system.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#3 lore raw

[Buildroot] [Bug 3703] Consider using /usr/bin/env bash in scripts

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=3703

--- Comment #2 from holger+br at freyther.de --- I am hacking my way... so here is my incomplete list I do have symlinks to help me.. with GNU coreutils
mktemp -> gmktemp
sed -> gsed
install -> ginstall

uclibc fails to build a host utility... but on the second gmake just continues...
HOSTCC utils/ldconfig.host
In file included from ../utils/ldconfig.c:170:
../utils/readsoname2.c: In function 'readsoname32':
../utils/readsoname2.c:3: warning: implicit declaration of function 'ElfW' (and more pointers to Elf names)

busybox fails with a include of shadow.h (not present on FreeBSD)

so I do have a basic gcc/uclibc toolchain for mips right now with the below hacky changes

Makefile +4 -3
index 5f61b93..599e7f5 100644
@@ -108,9 +108,10 @@ else
 endif
 
 # we want bash as shell
-SHELL:=$(shell if [ -x "$$BASH" ]; then echo $$BASH; \
-       else if [ -x /bin/bash ]; then echo /bin/bash; \
-       else echo sh; fi; fi)
+SHELL:=/usr/local/bin/bash
+#$(shell if [ -x "$$BASH" ]; then echo $$BASH; \
+       #else if [ -x /bin/bash ]; then echo /bin/bash; \
+       #else echo sh; fi; fi)
 
 # kconfig uses CONFIG_SHELL
 CONFIG_SHELL:=$(SHELL)

# Check if we can link to ncurses

toolchain/patch-kernel.sh +1 -1
index 76cb9f7..1e64d8d 100755
@@ -1,4 +1,4 @@
-#! /bin/bash
+#! /usr/bin/env bash
 # A little script I whipped up to make it easy to
 # patch source trees and have sane error handling
 # -Erik
Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#5 lore raw

[Buildroot] [Bug 3703] Consider using /usr/bin/env bash in scripts

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=3703

Thomas Petazzoni <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #3 from Thomas Petazzoni <[email protected]> 2012-01-31 22:50:47 UTC --- Not sure what to do with those FreeBSD-specific changes. I am not sure we want
to support FreeBSD as a build host, since nobody is actively working on this.
If someone is interested, please send the corresponding patches on the mailing
list. There has been no activity on this FreeBSD topic since may 2011, so I
suspect there simply isn't enough interested people.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.