linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philippe Troin <phil@fifi.org>
To: linux-hotplug@vger.kernel.org
Subject: Multiple firmware paths
Date: Sat, 19 Mar 2005 21:39:39 +0000	[thread overview]
Message-ID: <87mzsz8gdg.fsf@ceramic.fifi.org> (raw)

[-- 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
 
     ;;
 

             reply	other threads:[~2005-03-19 21:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-19 21:39 Philippe Troin [this message]
2005-03-19 21:44 ` Multiple firmware paths Marco d'Itri
2005-03-19 21:55 ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mzsz8gdg.fsf@ceramic.fifi.org \
    --to=phil@fifi.org \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).