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.
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.
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 diff --git a/Makefile b/Makefile index 5f61b93..599e7f5 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/toolchain/patch-kernel.sh b/toolchain/patch-kernel.sh index 76cb9f7..1e64d8d 100755 --- a/toolchain/patch-kernel.sh +++ b/toolchain/patch-kernel.sh @@ -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
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.