From af5041f90befc28d8d99efa052d5823b2b1833c6 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Fri, 26 Feb 2021 12:36:53 -0700 Subject: [PATCH] scripts: Check coreboot config is correct If a board in models/ does not exist in coreboot, coreboot will emit a warning and select the first available board for the vendor instead. This may result in building and being able to flash coreboot with an addw1 configuration on another board. --- scripts/_build/coreboot.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/_build/coreboot.sh b/scripts/_build/coreboot.sh index 8b0c9e6..611a09c 100755 --- a/scripts/_build/coreboot.sh +++ b/scripts/_build/coreboot.sh @@ -17,6 +17,19 @@ pushd coreboot >/dev/null fi make distclean make defconfig KBUILD_DEFCONFIG="${CONFIG}" + + # Ensure config is correct + while read line; do + if [[ "${line}" =~ "^#" ]] || [[ -z "${line}" ]]; then + continue + fi + + if ! grep -q "${line}" ".config"; then + echo "expected config not found: ${line}" >&2 + exit 1 + fi + done < "${CONFIG}" + make --jobs="$(nproc)" cp -v "build/coreboot.rom" "${COREBOOT}" popd >/dev/null