mirror of
https://github.com/qca/qca-swiss-army-knife.git
synced 2025-12-09 23:34:42 +01:00
We are going to rename this git tree to qca-swiss-army-knife.git and add more tools, as such lets throw the initvals work into its own directory and allow for other tools to be thrown in here. Lets add our own top level copyright license, and a simple README. Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
40 lines
953 B
Bash
Executable file
40 lines
953 B
Bash
Executable file
#!/bin/sh
|
|
|
|
CSUM_DIR=".tmp_checksum"
|
|
get_family_checksum()
|
|
{
|
|
local family="$1"
|
|
local suffix="$2"
|
|
local flag
|
|
|
|
[ "$suffix" == "hal" ] && flag="ATHEROS=1"
|
|
|
|
make clean all $flag >/dev/null
|
|
./initvals -f $family > "$CSUM_DIR/${family}_$suffix.txt"
|
|
./initvals -f $family | sha1sum | sed -e 's/[ -]//g'
|
|
}
|
|
|
|
verify_family_checksum()
|
|
{
|
|
local family="$1"
|
|
local sum_hal
|
|
local sum_ath9k
|
|
local res
|
|
|
|
sum_hal=$(get_family_checksum $family hal)
|
|
sum_ath9k=$(get_family_checksum $family ath9k)
|
|
|
|
[ "$sum_hal" == "$sum_ath9k" ] && res="pass" || res="fail"
|
|
printf "%-14s %-40s %s\n" "$family" "$sum_hal" "$res"
|
|
[ "$res" == "fail" ] && \
|
|
diff -Nurw "$CSUM_DIR/${family}_hal.txt" "$CSUM_DIR/${family}_ath9k.txt" | grep '^+[0-9a-f]'
|
|
}
|
|
|
|
FAMILIES="$@"
|
|
[ -z "$FAMILIES" ] && FAMILIES="ar5008 ar9001 ar9002 ar9003-2p2 ar9330-1p1 ar9330-1p2 ar9485 ar9580-1p0"
|
|
|
|
mkdir -p "$CSUM_DIR"
|
|
for family in $FAMILIES; do
|
|
verify_family_checksum $family
|
|
done
|
|
rm -rf "$CSUM_DIR"
|