[dahdi-commits] tzafrir: branch tools/2.2 r7814 - in /tools/branches/2.2: ./ xpp/xpp_fxloader

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Sun Jan 10 05:02:07 CST 2010


Author: tzafrir
Date: Sun Jan 10 05:02:04 2010
New Revision: 7814

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7814
Log:
xpp_fxloader: adapt to newer kernels

This commit prepares xpp_fxloader to get hotplug envirnment from newer kernel
versions:
* DEVICE will eventually be replaced with DEVNAME. Accept both (and look
  at DEVNAME first).
* If we get DEVICE, we'll probably get an invalid path based at
  /proc/bus/usb . Fix it to use /dev/bus/usb .
* While we're at it, allow using PRODUCT from the envirnment instead of
  from the command-line.

This should allow fixing udev rules but will also work with existing
rules in DAHDI-linux from trunk (for systems where they are valid).

Merged revisions 7752 via svnmerge from 
http://svn.digium.com/svn/dahdi/tools/trunk

Modified:
    tools/branches/2.2/   (props changed)
    tools/branches/2.2/xpp/xpp_fxloader

Propchange: tools/branches/2.2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sun Jan 10 05:02:04 2010
@@ -1,1 +1,1 @@
-/tools/trunk:1-6678,6823,6829-6830,6832-6833,6835,6837-6886,6889-6982,6985-6998,7000-7011,7013-7042,7044,7046-7131,7133,7135-7136,7139-7217,7219-7255,7257-7332,7334-7460,7462-7476,7596,7609,7792
+/tools/trunk:1-6678,6823,6829-6830,6832-6833,6835,6837-6886,6889-6982,6985-6998,7000-7011,7013-7042,7044,7046-7131,7133,7135-7136,7139-7217,7219-7255,7257-7332,7334-7460,7462-7476,7596,7609,7752,7792

Modified: tools/branches/2.2/xpp/xpp_fxloader
URL: http://svnview.digium.com/svn/dahdi/tools/branches/2.2/xpp/xpp_fxloader?view=diff&rev=7814&r1=7813&r2=7814
==============================================================================
--- tools/branches/2.2/xpp/xpp_fxloader (original)
+++ tools/branches/2.2/xpp/xpp_fxloader Sun Jan 10 05:02:04 2010
@@ -244,9 +244,17 @@
 # to run manually, pass the parameter 'xppdetect'
 case "$1" in
 udev) 
-	# the following emulate hotplug's environment from udev's environment:
-	DEVICE="$DEVNAME"
-	PRODUCT="$2"
+	# Various kernel versions use different sets of variables.
+	# Here we want to make sure we have 'DEVICE' and 'PRODUCT' set
+	# up. DEVICE is now deprecated in favour of DEVNAME. It will
+	# likely to contain an invalid name if /proc/bus/usb is not
+	# mounted. So it needs further cooking.
+	DEVICE="${DEVNAME:-$DEVICE}"
+	case "$DEVICE" in /proc/*) DEVICE="/dev${DEVICE#/proc}" ;; esac
+	# PRODUCT contains 'vendor_id'/'product_id'/'version' . We
+	# currently pass it as a parameter, but might as well get it
+	# from the envirnment.
+	PRODUCT="${PRODUCT:-$2}"
 	# skip on to the rest of the script. Don't exit.
 	;;
 reset-wait)




More information about the dahdi-commits mailing list