coreboot/util/lint/lint-stable-005-board-status
Sean Rhodes 5cb36eb16c util/lint: Don't check for board_info.txt in common directory
Adjust the linter to skip `common` directories, as a board_info.txt
serves no purpose there.

This also changes `sort | uniq` to `sort -u` for efficiency.

Change-Id: I29639d8b620bcd4f2f7032802f375d79ac391535
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/89050
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2025-09-07 19:27:32 +00:00

38 lines
921 B
Bash
Executable file

#!/usr/bin/env sh
# SPDX-License-Identifier: GPL-2.0-or-later
#
# DESCR: Check that every board has a meaningful board_info.txt
LINTDIR="$(
cd -- "$(dirname "$0")" > /dev/null 2>&1 || return
pwd -P
)"
# shellcheck source=helper_functions.sh
. "${LINTDIR}/helper_functions.sh"
for mobodir in $(${FIND_FILES} src/mainboard | sed -n 's,^\(src/mainboard/[^/]*/[^/]*\)/.*$,\1,p' \
| grep -v '/common$' | sort -u); do
board_info="$mobodir/board_info.txt"
if ! [ -f "$board_info" ]; then
echo "No $board_info found"
continue
fi
category="$(sed -n 's#^Category: \(.*\)$#\1#p' < "$board_info")"
case "$category" in
desktop|server|laptop|half|mini|settop|"eval"|sbc|emulation|misc)
;;
"")
echo "$board_info doesn't contain 'Category' tag"
continue
;;
*)
echo "$board_info specifies unknown category '$category'"
continue
;;
esac
done
exit 0