util/abuild: Fix overriding results with the default configuration

I a file in configs/* has no suffix, then the default configuration
will override the results of the build generated by the configfile
from configs/*. Fix this by adding a '_' to the buildname.

Change-Id: Ic47105fafca41f1905a6569943079623bec5405a
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56041
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Arthur Heymans 2021-07-02 16:26:41 +02:00 committed by Patrick Georgi
parent 4dcac13043
commit 8585eabc5d
1 changed files with 7 additions and 0 deletions

View File

@ -526,6 +526,13 @@ function build_target
BUILD_NAME="${config##*/}" BUILD_NAME="${config##*/}"
BUILD_NAME="${BUILD_NAME##config.}" BUILD_NAME="${BUILD_NAME##config.}"
BUILD_NAME=$(echo "${BUILD_NAME}" | tr '[:lower:]' '[:upper:]') BUILD_NAME=$(echo "${BUILD_NAME}" | tr '[:lower:]' '[:upper:]')
echo $BUILD_NAME $MAINBOARD
# If the file in configs/ results in the same build_name as the default config
# append a '_' to differentiate. Otherwise the default configuration would
# override the results.
if [ "${MAINBOARD}" = "${BUILD_NAME}" ]; then
BUILD_NAME=${BUILD_NAME}"_"
fi
echo "Building config $BUILD_NAME" echo "Building config $BUILD_NAME"
build_dir=$TARGET/${BUILD_NAME} build_dir=$TARGET/${BUILD_NAME}
build_config "$MAINBOARD" "$build_dir" "$BUILD_NAME" "$config" build_config "$MAINBOARD" "$build_dir" "$BUILD_NAME" "$config"