Commit bf97bdc4 authored by Stefan Tauner's avatar Stefan Tauner
Browse files

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.

Corresponding to flashrom svn r1654.
Signed-off-by: default avatarStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: default avatarStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
parent d3b98fb8
#!/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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment