[U-Boot] [PATCH 2/3] mkconfig: create CONFIG_ defines without relying on GNU extensions

Marek Vasut marek.vasut at gmail.com
Wed Jul 20 00:57:58 CEST 2011


On Tuesday, July 19, 2011 10:41:49 PM Jeroen Hofstee wrote:
> Parsing of boards.cfg relies on sed GNU extensions and fails if sed
> doesn't support these. On FreeBSD this leads to the error:
> 
> sed: 1: "/=/ {s/=/\t/;q } ; { s/ ...": extra characters at the end
> of q command

Does it still work on linux as well? Did you test? If so, I'm all for it being 
merged, but just from a brief look, I see it'll be missing the TAB. Am I right?

> 
> Signed-off-by: Jeroen Hofstee <jeroen at myspectrum.nl>
> Cc: Marek Vasut <marek.vasut at gmail.com>
> ---
>  mkconfig |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/mkconfig b/mkconfig
> index 6ff533f..b9cfc94 100755
> --- a/mkconfig
> +++ b/mkconfig
> @@ -148,7 +148,7 @@ fi
>  echo "/* Automatically generated - do not edit */" >>config.h
> 
>  for i in ${TARGETS} ; do
> -	i="`echo ${i} | sed '/=/ {s/=/\t/;q } ; { s/$/\t1/ }'`"
> +	i="`echo ${i} | sed -e '/=/!s/$/=1/' -e 's/=/	/'`"
>  	echo "#define CONFIG_${i}" >>config.h ;
>  done


More information about the U-Boot mailing list