5 if [ "$1" != "configure" ]; then
10 # The debhelper udev fragments are broken; they only check for -z "$2",
11 # not for upgrades from versions without the udev script.
13 if [ -z "$2" ] || dpkg --compare-versions "$2" lt "0.10-3"; then
14 ln -sf ../usrp.rules /etc/udev/rules.d/z60_usrp.rules
18 if ! getent group usrp >/dev/null; then
19 addgroup --system usrp
23 # Activate any unactivated USRPs that are plugged in at install time.
24 # This is basically a duplication of the loop in /etc/hotplug/usb.rc,
25 # but Md claims it's the best solution for synthesizing hotplug events
26 # for the USRPs plugged in at installation time.
30 # Don't bother doing this unless we have all the firmware we need, and
31 # hotplugging working. (Rationale: If we don't have hotplug working,
32 # this will not work next boot/plugin anyhow, so it would be very confusing
33 # for the user to have it all work up _until_ the next boot/plugin.)
35 [ -r /usr/share/usrp/rev2/std_4rx_0tx.rbf ] || exit 0
36 [ -x /sbin/hotplug ] || [ -x /sbin/udevd ] || exit 0
38 # We need sysfs to do this.
39 [ -d /sys/bus/usb/devices/ ] || exit 0
41 # Go through all USB devices and find unconfigured USRPs (ie. FX2 chips).
42 for device in /sys/bus/usb/devices/[0-9]*:*; do
43 devlink=$(readlink -f $device)
44 DEVPATH=${devlink#/sys}
46 [ -f $devlink/../idVendor ] || continue
47 PRODUCT="$(cat $devlink/../idVendor)/$(cat $devlink/../idProduct)/$(cat $devlink/../bcdDevice)"
49 if [ "$PRODUCT" = "fffe/0002/0002" ] || [ "$PRODUCT" = "fffe/0002/0004" ]; then
50 /usr/bin/usrper load_standard_bits