1 2 3 4 5 6 7 8
#!/bin/sh # Run from a directory containing the kernel modules for mod in $(find -name '*.ko*'); do USB=$(modinfo $mod | grep -E '^alias:.*usb:') if [ -n "$USB" ]; then modinfo $mod | grep '^firmware:' | cut -b 17- >> usb-firmware-list.txt fi done