util/abuild: Fix update_config function

- Because $configoptions contains embedded newlines that we want to be
interpreted when we pipe it out to the config file, change that back to
a printf, and tell shellcheck that we want to do it.
- 'make olddefconfig' & 'yes "" | make oldconfig' give us the same
output for the config file, but olddefconfig doesn't generate the log
the way oldconfig does.  Go back to the previous behavior.
- Don't overwrite the config log with make savedefconfig.

Change-Id: I4966a3bb2541b452eeb4ca73ac3cd727f8525636
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17853
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Martin Roth 2016-12-13 15:29:30 -07:00
parent 2ab96fc955
commit 6bc4416968
1 changed files with 4 additions and 5 deletions

View File

@ -260,14 +260,13 @@ function update_config
fi
if [ "$quiet" == "false" ]; then echo " $MAINBOARD ($customizing)"; fi
echo "$configoptions" >> "${config_file}"
# shellcheck disable=SC2059
printf "$configoptions" >> "${config_file}"
# shellcheck disable=SC2086
$MAKE olddefconfig $silent "DOTCONFIG=${config_file}" "obj=${build_dir}" "objutil=$TARGET/sharedutils" &> "${build_dir}/config.log" ; \
yes "" 2>/dev/null | $MAKE oldconfig $silent "DOTCONFIG=${config_file}" "obj=${build_dir}" "objutil=$TARGET/sharedutils" &> "${build_dir}/config.log" ; \
CONFIG_OK=$?
if [ $CONFIG_OK -eq 0 ]; then
# shellcheck disable=SC2086
$MAKE savedefconfig $silent DEFCONFIG="${defconfig_file}" DOTCONFIG="${config_file}" obj="${build_dir}" objutil="$TARGET/sharedutils" &> "${build_dir}/config.log"
$MAKE savedefconfig $silent DEFCONFIG="${defconfig_file}" DOTCONFIG="${config_file}" obj="${build_dir}" objutil="$TARGET/sharedutils" &>> "${build_dir}/config.log"
return $?
else
return 1