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 <keithp@keithp.com>
serial="--serial $1"
;;
0)
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=""
case "$snum" in
"")
serial=""