[U-Boot] scripts: setlocalversion: safely extract variables from auto.conf using awk

Philipp Tomsich philipp.tomsich at theobroma-systems.com
Thu Aug 10 10:29:55 UTC 2017

> Moving SPL_LDSCRIPT to Kconfig triggered an unfortunate attempt of
> command substitution, as the sourced auto.conf may include $(ARCH)
> which tries to execute a command 'ARCH'.
> This showed up as a warning similar to the following:
>   include/config/auto.conf: line 209: ARCH: command not found
> This change does no longer attempt to source auto.conf, but rather
> passes it through awk to retrieve the values for CONFIG_LOCALVERSION
> and CONFIG_LOCALVERSION_AUTO.  This will also mitigate the risk of
> unintended command substitution.
> Signed-off-by: Philipp Tomsich <philipp.tomsich at theobroma-systems.com>
> Reported-by: Andy Yan <andy.yan at rock-chips.com>
> Reviewed-by: Tom Rini <trini at konsulko.com>
> ---
>  scripts/setlocalversion | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Applied to u-boot-rockchip, thanks!

More information about the U-Boot mailing list