build.config: Detect incorrectly overridden config options

The base defconfigs should only be "added on," and should options from
an earlier config should never be adjusted once set to =y or =m.

Change-Id: I62a82368cf70f515c257ff094730a2f1419805a4
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
This commit is contained in:
Elliot Berman 2020-09-12 17:31:58 -07:00
parent 2d0a372c66
commit a47c7b45db

View File

@ -61,9 +61,21 @@ function merge_defconfig_fragments() {
echo "No defconfig fragments for ${DEFCONFIG}"
return
fi
local output=$(mktemp)
KCONFIG_CONFIG=${KERNEL_DIR}/arch/${ARCH}/configs/${DEFCONFIG} \
${KERNEL_DIR}/scripts/kconfig/merge_config.sh \
-m -r ${DEFCONFIG_FRAGMENTS}
-m -r ${DEFCONFIG_FRAGMENTS} | tee $output
set +x
if grep -q -E -e "Previous value: [^=]+=[ym]" $output; then
echo "========================================================"
echo "ERROR! Detected overridden config!"
grep -C 1 -E -e "Previous value: [^=]+=[ym]" $output >&2
rm $output
exit 1
fi
rm $output
set -x
}
append_cmd PRE_DEFCONFIG_CMDS "merge_defconfig_fragments"