blob: 32f5cdc0d171a0b35359392c6b995088f0796e7b [file] [log] [blame]
Vladimir Serbinenkofb2a9a92014-08-15 02:06:00 +02001#!/bin/sh
2# This file is part of the coreboot project.
3#
4# Copyright (C) 2014 Vladimir Serbinenko <phcoder@gmail.com>
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; version 2 of the License, or (at your option)
9# any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19#
20# DESCR: Check that every board has a meaningful board_info.txt
21
22LC_ALL=C export LC_ALL
Patrick Georgif9d72522014-08-16 22:50:57 +020023for mobodir in $(git diff --diff-filter ACMR --name-only src/mainboard | sed -n 's,^\(src/mainboard/[^/]*/[^/]*\)/.*$,\1,p'|sort|uniq); do
Vladimir Serbinenkofb2a9a92014-08-15 02:06:00 +020024 board_info="$mobodir/board_info.txt"
25 if ! [ -f "$board_info" ]; then
Vladimir Serbinenkob46f5892014-08-17 23:53:14 +020026 echo "No $board_info found"
Vladimir Serbinenkofb2a9a92014-08-15 02:06:00 +020027 exit 1
28 fi
29 category="$(sed -n 's#^Category: \(.*\)$#\1#p' < "$board_info")"
30 case "$category" in
31 desktop|server|laptop|half|mini|settop|"eval"|sbc|emulation|misc)
32 ;;
33 "")
Vladimir Serbinenkob46f5892014-08-17 23:53:14 +020034 echo "$board_info doesn't contain 'Category' tag"
Vladimir Serbinenkofb2a9a92014-08-15 02:06:00 +020035 exit 1
36 ;;
37 *)
Vladimir Serbinenkob46f5892014-08-17 23:53:14 +020038 echo "$board_info specifies unknown category '$category'"
Vladimir Serbinenkofb2a9a92014-08-15 02:06:00 +020039 exit 1
40 ;;
41 esac
42done
43
44exit 0
45