...
 
Commits (2)
......@@ -26,6 +26,7 @@ Package: libu2f-udev
Architecture: all
Multi-Arch: foreign
Section: libs
Pre-Depends: udev
Depends: ${misc:Depends}
Description: Universal 2nd Factor (U2F) common files
Libu2f is a package for doing Universal 2nd Factor (U2F) host communication
......
#!/bin/bash
# This maintainer script does not set -e on purpose:
# the package should not be put in a configuration-failed state
# should the udev rules fail to be reloaded, for any reason.
set -u -o pipefail
# Reload rules
udevadm control --reload
# Deal with already-plugged-in devices
run() {
echo "$@" >&2
"$@"
}
while IFS='' read -r line || [[ -n "$line" ]]; do
# Skip comment
if [[ "$line" == \#* ]] || [[ -z "$line" ]] ||
[[ "$line" == ACTION* ]] || [[ "$line" == LABEL* ]]; then
continue
fi
IFS=', ' read -r kernel subsystem idVendor idProduct _ <<< "$line"
if [[ "$kernel" != 'KERNEL=="hidraw*"' ]] ||
[[ "$subsystem" != 'SUBSYSTEM=="hidraw"' ]]; then
echo "Skipping unexpected rule: '$line'" >&2
continue
fi
run udevadm trigger -s hidraw -a "$idVendor" -a "$idProduct" -v
done < /lib/udev/rules.d/70-u2f.rules