summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2013-03-09 17:55:35 +0000
committerstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2013-03-09 17:55:35 +0000
commitf59b725138d40814d722161cb9e37616754cc2a4 (patch)
tree2e3c490f08231ce86716f8a3fb991f2787246a50 /util
parent3880ef3fcd11f52b648b51c385afab2ce1571ac2 (diff)
downloadflashrom-f59b725138d40814d722161cb9e37616754cc2a4.tar.gz
Add utility to print all chip names in flashchips.h that are not in flashchips.c.
This allows to list yet unsupported chips easily. First it tries to find the directory containing the files, then it uses sed to extract the macro names of chips from flashchips.h, greps for them in flashchips.c and prints it if it is not found. If verbose mode is activated by giving at least one additional parameter it prints the chip ID and comment following the macro definition too. Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1654 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util')
-rwxr-xr-xutil/list_yet_unsupported_chips.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/util/list_yet_unsupported_chips.sh b/util/list_yet_unsupported_chips.sh
new file mode 100755
index 0000000..3a4d1b8
--- /dev/null
+++ b/util/list_yet_unsupported_chips.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+scriptname=$(readlink -f "$0") 2>/dev/null
+path=$(dirname "$scriptname")/.. 2>/dev/null
+if [ ! -e "$path/flashchips.c" -o ! -e "$path/flashchips.h" ]; then
+ echo "Warning: could not calculate flashchips.[ch]'s directory. Trying current..."
+ path="."
+ if [ ! -e "$path/flashchips.c" -o ! -e "$path/flashchips.h" ]; then
+ echo "Nope, sorry!"
+ exit 1
+ fi
+fi
+
+chips=$(sed -re '/#define [A-Z]/ !d' -e '/_ID\s/d' -e 's/\s*#define\s+([[:alnum:]_]+)\s+.*/\1/' "$path/flashchips.h")
+for c in $chips ; do
+ if ! grep "$c" "$path/flashchips.c" >/dev/null ; then
+ if [ -n "$1" ]; then
+ grep -o "$c.*" "$path/flashchips.h"
+ else
+ echo "$c"
+ fi
+ fi
+done