diff options
author | jcorgan | 2007-08-30 01:28:27 +0000 |
---|---|---|
committer | jcorgan | 2007-08-30 01:28:27 +0000 |
commit | 975e25baef29afca48ef9b25558bf867515b4034 (patch) | |
tree | dc5e4f2f12f194fbcd63052eefad31be8c13eedd /debian/usrp.hotplug | |
parent | e754be9784681f3e439fa67f4e877fd6aeb44277 (diff) | |
download | gnuradio-975e25baef29afca48ef9b25558bf867515b4034.tar.gz gnuradio-975e25baef29afca48ef9b25558bf867515b4034.tar.bz2 gnuradio-975e25baef29afca48ef9b25558bf867515b4034.zip |
Merged -r6156:6213 from features/deb into trunk. Initial framework for creating Debian packages for 3.1 release. NOT FUNCTIONAL.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6214 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'debian/usrp.hotplug')
-rw-r--r-- | debian/usrp.hotplug | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/debian/usrp.hotplug b/debian/usrp.hotplug new file mode 100644 index 000000000..e8b943204 --- /dev/null +++ b/debian/usrp.hotplug @@ -0,0 +1,47 @@ +#! /bin/sh + +GROUP=usrp + +# Set the permissions for the USRP devices right. +set_permissions() { + if [ -f "$1" ] + then + if getent group $GROUP > /dev/null; then + chmod 660 "$DEVICE" + chown root.$GROUP "$1" + fi + fi +} + +# +# If we do not have /sbin/hotplug, we are being called by post-sarge udev +# emulating hotplug. In that case, all of this is handled by our udev rules, +# so we don't need to duplicate the work done here. +# +if ! [ -x /sbin/hotplug ]; then + exit +fi + +if [ "$ACTION" != "add" ]; then + exit +fi + +# FIXME: Map the USB device ID to usrper's idea of "which USRP". +# For now, we just assume the user only has a single one. + +case $PRODUCT in + # USRP without loaded firmware + fffe/2/2 | fffe/2/4) + sleep 1 # required on some machines + /usr/bin/usrper load_standard_bits + set_permissions "$DEVICE" + ;; + + # USRP with loaded firmware + fffe/2/102 | fffe/2/104) + set_permissions "$DEVICE" + ;; +esac + + + |