linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marco d'Itri" <md@Linux.IT>
To: linux-hotplug@vger.kernel.org
Subject: Re: Location of firmware files
Date: Tue, 22 Jun 2004 21:17:55 +0000	[thread overview]
Message-ID: <20040622211755.GA17750@wonderland.linux.it> (raw)
In-Reply-To: <40ACDCE3.5040500@us.ibm.com>

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

On Jun 22, Brian King <brking@us.ibm.com> wrote:

> Getting back to the following thread regarding the proper location
> for firmware files:
FYI, I applied this patch to the debian package, because some firmwares
are needed before / is mounted.

-- 
ciao, |
Marco | [6878 svWwedgktgMa2]

[-- Attachment #2: firmware_dirs --]
[-- Type: text/plain, Size: 1154 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	2004-03-26 23:34:34.000000000 +0100
+++ hotplug-2004_03_29/etc/hotplug/firmware.agent	2004-06-06 17:05:35.000000000 +0200
@@ -19,8 +19,8 @@
 . ./hotplug.functions
 # DEBUG=yes export DEBUG
 
-# directory of the firmware files
-FIRMWARE_DIR=/usr/lib/hotplug/firmware
+# directories with the firmware files
+FIRMWARE_DIRS="/lib/firmware /usr/lib/hotplug/firmware"
 
 # mountpoint of sysfs
 SYSFS=$(sed -n 's/^.* \([^ ]*\) sysfs .*$/\1/p' /proc/mounts)
@@ -40,13 +40,16 @@
         sleep 1
     fi
 
-    if [ -f "$FIRMWARE_DIR/$FIRMWARE" ]; then
+    for DIR in $FIRMWARE_DIRS; do
+        [ -e "$DIR/$FIRMWARE" ] || continue
         echo 1 > $SYSFS/$DEVPATH/loading
-        cp "$FIRMWARE_DIR/$FIRMWARE" $SYSFS/$DEVPATH/data
+        cat "$DIR/$FIRMWARE" > $SYSFS/$DEVPATH/data
         echo 0 > $SYSFS/$DEVPATH/loading
-    else
-        echo -1 > $SYSFS/$DEVPATH/loading
-    fi
+        exit
+    done
+
+    # the firmware was not found
+    echo -1 > $SYSFS/$DEVPATH/loading
 
     ;;
 

  parent reply	other threads:[~2004-06-22 21:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-20 16:29 Location of firmware files Brian King
2004-05-20 16:53 ` Marco d'Itri
2004-05-20 17:19 ` Marcel Holtmann
2004-05-20 17:25 ` Marco d'Itri
2004-05-20 18:16 ` Marcel Holtmann
2004-06-22 20:50 ` Brian King
2004-06-22 21:17 ` Marco d'Itri [this message]
2004-06-22 21:36 ` Marcel Holtmann
2004-06-22 21:51 ` Brian King
2004-06-22 22:02 ` Marcel Holtmann
2004-06-22 22:27 ` Brian King
2004-06-22 22:37 ` Marcel Holtmann
2004-06-22 23:09 ` Greg KH
2004-06-23  8:14 ` Marcel Holtmann
2004-09-20 21:23 ` Greg KH

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=20040622211755.GA17750@wonderland.linux.it \
    --to=md@linux.it \
    --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).