2 # Copyright 2021 Google LLC
5 # Check that the .config file provided does not try to disable OF_BOARD for
6 # boards that use CONFIG_OF_HAS_PRIOR_STAGE
9 # check-of.sh <path to .config> <path to allowlist file>
12 # scripts/check-of.sh b/chromebook_link/u-boot.cfg kconfig_allowlist.txt
14 # Exit code is 0 if OK, 3 if the .config is wrong, as above
22 echo "$PROG_NAME <path to .config> <path to allowlist file>"
31 sys_config="$(sed -n 's/CONFIG_SYS_CONFIG_NAME="\(.*\)"$/\1/p' "${path}")"
33 if grep -q OF_HAS_PRIOR_STAGE=y "${path}"; then
34 if ! grep -lq CONFIG_OF_BOARD=y "${path}"; then
35 echo >&2 "This board uses a prior stage to provide the device tree."
36 echo >&2 "Please enable CONFIG_OF_BOARD to ensure that it works correctly."
37 if grep -q "${sys_config}" "${allowlist}"; then