From: Keith Packard Date: Sun, 19 Feb 2017 06:46:29 +0000 (-0800) Subject: ao-bringup: test-chaoskey needs to use the SerialNumber dmesg line X-Git-Tag: 1.7~117 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=f43c3ad0c643f714c523e513bdc8585c6d5a4050;hp=a21c7b5156e428a4f8e029fdb652c8ca1c63823b ao-bringup: test-chaoskey needs to use the SerialNumber dmesg line I had a locally hacked kernel which was reporting the serial number along with the device name. Instead of depending on that, just look for the regular SerialNumber report which is in all kernel versions Signed-off-by: Keith Packard --- diff --git a/ao-bringup/test-chaoskey b/ao-bringup/test-chaoskey index b4c8164f..f64b1f84 100755 --- a/ao-bringup/test-chaoskey +++ b/ao-bringup/test-chaoskey @@ -12,7 +12,9 @@ case "$#" in serial="--serial $1" ;; 0) - snum=`dmesg | grep 'on chaoskey' | tail -1 | sed 's/.*chaoskey \([0-9a-f][0-9a-f]*\) on chaoskey.*/\1/'` + snum=`sudo dmesg | awk '/usb.*Product:/ { ck = index($0, "ChaosKey"); } + /usb.*SerialNumber:/ { if (ck) print $5; }' | tail -1` + case "$snum" in "") serial=""