linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Multiple firmware paths
@ 2005-03-19 21:39 Philippe Troin
  2005-03-19 21:44 ` Marco d'Itri
  2005-03-19 21:55 ` Marcel Holtmann
  0 siblings, 2 replies; 3+ messages in thread
From: Philippe Troin @ 2005-03-19 21:39 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 289 bytes --]

[I'm not subscribed to linux-hotplug-devel@lists.sourceforge.net,
please CC any replies]

Hi,

The enclosed patch makes hotplug work with multiple firmware
directories (typically in /usr/local, /usr, /lib).

There's one patch against cvs, and one patch against the latest
release.

Phil.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: hotplug-2004_03_29-multiple-firmware-dirs.patch --]
[-- Type: text/x-patch, Size: 1195 bytes --]

diff -ruN hotplug-2004_03_29.orig/etc/hotplug/firmware.agent hotplug-2004_03_29/etc/hotplug/firmware.agent
--- hotplug-2004_03_29.orig/etc/hotplug/firmware.agent	Fri Mar 26 14:34:34 2004
+++ hotplug-2004_03_29/etc/hotplug/firmware.agent	Sat Mar 19 13:29:29 2005
@@ -20,7 +20,8 @@
 # DEBUG=yes export DEBUG
 
 # directory of the firmware files
-FIRMWARE_DIR=/usr/lib/hotplug/firmware
+FIRMWARE_DIRS="/opt/lib/hotplug/firmware /usr/local/lib/hotplug/firmware \
+               /usr/lib/hotplug/firmware /lib/hotplug/firmware"
 
 # mountpoint of sysfs
 SYSFS=$(sed -n 's/^.* \([^ ]*\) sysfs .*$/\1/p' /proc/mounts)
@@ -40,13 +41,16 @@
         sleep 1
     fi
 
-    if [ -f "$FIRMWARE_DIR/$FIRMWARE" ]; then
-        echo 1 > $SYSFS/$DEVPATH/loading
-        cp "$FIRMWARE_DIR/$FIRMWARE" $SYSFS/$DEVPATH/data
-        echo 0 > $SYSFS/$DEVPATH/loading
-    else
-        echo -1 > $SYSFS/$DEVPATH/loading
-    fi
+    done=-1
+    for i in $FIRMWARE_DIRS; do
+        if [ -f "$i/$FIRMWARE" ]; then
+            echo 1 > $SYSFS/$DEVPATH/loading
+            cp "$i/$FIRMWARE" $SYSFS/$DEVPATH/data
+	    done=0
+	    break
+        fi
+    done
+    echo $done > $SYSFS/$DEVPATH/loading
 
     ;;
 

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: hotplug-cvs-multiple-firmware-dirs.patch --]
[-- Type: text/x-patch, Size: 1177 bytes --]

Index: etc/hotplug/firmware.agent
===================================================================
RCS file: /cvsroot/linux-hotplug/admin/etc/hotplug/firmware.agent,v
retrieving revision 1.5
diff -b -u -r1.5 firmware.agent
--- etc/hotplug/firmware.agent	19 Jan 2005 17:42:45 -0000	1.5
+++ etc/hotplug/firmware.agent	19 Mar 2005 21:36:41 -0000
@@ -20,7 +20,8 @@
 # DEBUG=yes export DEBUG
 
 # directory of the firmware files
-FIRMWARE_DIR=/lib/firmware
+FIRMWARE_DIRS="/opt/lib/firmware /usr/local/lib/firmware /usr/lib/firmware \
+               /lib/firmware"
 
 # mountpoint of sysfs
 SYSFS=$(sed -n 's/^.* \([^ ]*\) sysfs .*$/\1/p' /proc/mounts)
@@ -40,13 +41,16 @@
         sleep 1
     fi
 
-    if [ -f "$FIRMWARE_DIR/$FIRMWARE" ]; then
+    done=-1
+    for i in $FIRMWARE_DIRS; do
+        if [ -f "$i/$FIRMWARE" ]; then
         echo 1 > $SYSFS/$DEVPATH/loading
-        cp "$FIRMWARE_DIR/$FIRMWARE" $SYSFS/$DEVPATH/data
-        echo 0 > $SYSFS/$DEVPATH/loading
-    else
-        echo -1 > $SYSFS/$DEVPATH/loading
+            cp "$i/$FIRMWARE" $SYSFS/$DEVPATH/data
+	    done=0
+	    break
     fi
+    done
+    echo $done > $SYSFS/$DEVPATH/loading
 
     ;;
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-03-19 21:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-19 21:39 Multiple firmware paths Philippe Troin
2005-03-19 21:44 ` Marco d'Itri
2005-03-19 21:55 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).