Skip to contentSkip to conversation

Location of firmware files

DISCUSSION Applied Brian King 4 participants 15 messages May 20, 2004 – Sep 20, 2004

lore
Share & tools
lore

Brian King

author
#0 lore raw

Currently, firmware.agent looks for firmware files in /usr/lib/hotplug/firmware. Would /etc/ or /lib/ be a better place? What if firmware is needed in order to access /usr? What if /usr is an nfs share?

-Brian

-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id149&alloc_id�66&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 4 lines · Brian King

Currently, firmware.agent looks for firmware files in /usr/lib/hotplug/firmware. Would /etc/ or /lib/ be a better place? What if firmware is needed in order to access /usr? What if /usr is an nfs share?

I think that firmware.agent should be modified to check first /usr/share/lib/hotplug/firmware/ and the /lib/hotplug/firmware/ .

Signature · 13 lines
ciao, |
Marco | [6379 rirwjbBP4ATsA]


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id149&alloc_id�66&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#2 lore raw
In reply to Brian King

Hi Marco,

Quoted 6 lines
Quoted 4 lines

Currently, firmware.agent looks for firmware files in /usr/lib/hotplug/firmware. Would /etc/ or /lib/ be a better place? What if firmware is needed in order to access /usr? What if /usr is an nfs share?

I think that firmware.agent should be modified to check first /usr/share/lib/hotplug/firmware/ and the /lib/hotplug/firmware/ .

I won't vote for checking two places. Let's see what the LSB says and choose the best place. Btw I don't think that we need a subdirectory called "hotplug" in the path. I think /lib/firmware/ or /etc/firmware/ will be enough.

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id149&alloc_id�66&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Brian King
Quoted 2 lines · Marcel Holtmann

I won't vote for checking two places. Let's see what the LSB says and choose the best place.

Why not? If a firmware file is needed at boot time before /usr is available then it has to go in /lib, else it has to go in /usr/share. It's not like using test -e is hard...

Quoted 2 lines

Btw I don't think that we need a subdirectory
called "hotplug" in the path.

Good point.

Signature · 13 lines
ciao, |
Marco | [6382 scHvMf/nwXQTM]


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id149&alloc_id�66&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#4 lore raw
In reply to Brian King

Hi Marco,

Quoted 5 lines
Quoted 2 lines

I won't vote for checking two places. Let's see what the LSB says and choose the best place.

Why not? If a firmware file is needed at boot time before /usr is available then it has to go in /lib, else it has to go in /usr/share. It's not like using test -e is hard...

that's not the point. What if you have two different firmware files in two different locations? This makes debugging of newbie problems very hard. I like to have one location and then go for it.

However I think /usr/share/ is wrong, because maybe for different architectures you need different firmwares and /usr/share/ can be a unique mount point accross architectures. I think /usr/lib/ is much better in this case.

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id149&alloc_id�66&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#5 lore raw
In reply to Brian King

Getting back to the following thread regarding the proper location for firmware files:

http://marc.theaimsgroup.com/?t8507086500007&r=1&w=2

I guess I don't see a real big advantage to change from /usr/lib/hotplug/firmware to /usr/lib/firmware, which looks to be where this discussion ended.

Signature · 15 lines
Brian King
eServer Storage I/O
IBM Linux Technology Center



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#6 lore raw
In reply to Brian King
Quoted 2 lines · Brian King

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.

Signature · 2 lines
ciao, |
Marco | [6878 svWwedgktgMa2]
etc/hotplug/firmware.agent +10 -7
diff -ruN hotplug-2004_03_29.orig/etc/hotplug/firmware.agent hotplug-2004_03_29/etc/hotplug/firmware.agent
@@ -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
 
     ;;
 
#7 lore raw
In reply to Brian King

Hi Marco,

Quoted 4 lines
Quoted 2 lines

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.

as I already argued I am not really happy with having two locations for the firmware files. Lets agree on one. We have /lib/modules/ for our kernel modules and so I think /lib/firmware/ is also fine. What does the LSB says about it?

Regards

Marcel

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#8 lore raw
In reply to Brian King
Quoted 6 lines · Marcel Holtmann

Hi Marco,

Quoted 3 lines
Quoted 2 lines

Getting back to the following thread regarding the proper location for firmware files:

Quoted 8 lines
Quoted 2 lines

FYI, I applied this patch to the debian package, because some firmwares are needed before / is mounted.

as I already argued I am not really happy with having two locations for the firmware files. Lets agree on one. We have /lib/modules/ for our kernel modules and so I think /lib/firmware/ is also fine. What does the LSB says about it?

The LSB doesn't say much in this respect. I had a discussion on this a while back on the FHS list:

http://sourceforge.net/mailarchive/message.php?msg_idh01284

The result of this discussion suggested placing them in somewhere in /lib. /lib/drivername was suggested, but it was brought up outside this thread that this could cause problems for devices that can use multiple drivers, such as some scsi devices.

Signature · 15 lines
Brian King
eServer Storage I/O
IBM Linux Technology Center



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#9 lore raw
In reply to Brian King

Hi Brian,

Quoted 8 lines
Quoted 4 lines

as I already argued I am not really happy with having two locations for the firmware files. Lets agree on one. We have /lib/modules/ for our kernel modules and so I think /lib/firmware/ is also fine. What does the LSB says about it?

The LSB doesn't say much in this respect. I had a discussion on this a while back on the FHS list:

Quoted 6 lines

http://sourceforge.net/mailarchive/message.php?msg_idh01284

The result of this discussion suggested placing them in somewhere in /lib. /lib/drivername was suggested, but it was brought up outside this thread that this could cause problems for devices that can use multiple drivers, such as some scsi devices.

using something like /lib/drivername will cause much more troubles than it will help us. So I think /lib/firmware is a nice place to keep the firmware files. The Debian packages already did it this way and so I think we should go this way. Any arguments against it?

Regards

Marcel

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#10 lore raw
In reply to Brian King
Quoted 19 lines · Marcel Holtmann

Hi Brian,

Quoted 8 lines
Quoted 4 lines

as I already argued I am not really happy with having two locations for the firmware files. Lets agree on one. We have /lib/modules/ for our kernel modules and so I think /lib/firmware/ is also fine. What does the LSB says about it?

The LSB doesn't say much in this respect. I had a discussion on this a while back on the FHS list:

Quoted 6 lines

http://sourceforge.net/mailarchive/message.php?msg_idh01284

The result of this discussion suggested placing them in somewhere in /lib. /lib/drivername was suggested, but it was brought up outside this thread that this could cause problems for devices that can use multiple drivers, such as some scsi devices.

Quoted 4 lines

using something like /lib/drivername will cause much more troubles than it will help us. So I think /lib/firmware is a nice place to keep the firmware files. The Debian packages already did it this way and so I think we should go this way. Any arguments against it?

Sounds fine to me.

Anyone have any opinions regarding microcode/firmware file naming conventions, or is this something that will be difficult to standardize?

Signature · 15 lines
Brian King
eServer Storage I/O
IBM Linux Technology Center



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#11 lore raw
In reply to Brian King

Hi Brian,

Quoted 6 lines
Quoted 4 lines

using something like /lib/drivername will cause much more troubles than it will help us. So I think /lib/firmware is a nice place to keep the firmware files. The Debian packages already did it this way and so I think we should go this way. Any arguments against it?

Sounds fine to me.

if nobody else speaks up, prepare a patch for it and send it to Greg (CC the list).

Quoted 2 lines

Anyone have any opinions regarding microcode/firmware file naming conventions, or is this something that will be difficult to standardize?

I used the original names of the firmware files from the Windows drivers.

Regards

Marcel

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#12 lore raw
In reply to Brian King
Quoted 17 lines · Marcel Holtmann

Hi Brian,

Quoted 8 lines
Quoted 4 lines

as I already argued I am not really happy with having two locations for the firmware files. Lets agree on one. We have /lib/modules/ for our kernel modules and so I think /lib/firmware/ is also fine. What does the LSB says about it?

The LSB doesn't say much in this respect. I had a discussion on this a while back on the FHS list:

Quoted 6 lines

http://sourceforge.net/mailarchive/message.php?msg_idh01284

The result of this discussion suggested placing them in somewhere in /lib. /lib/drivername was suggested, but it was brought up outside this thread that this could cause problems for devices that can use multiple drivers, such as some scsi devices.

Quoted 4 lines

using something like /lib/drivername will cause much more troubles than it will help us. So I think /lib/firmware is a nice place to keep the firmware files. The Debian packages already did it this way and so I think we should go this way. Any arguments against it?

No argument from me. We can get the LSB to add this after we implement it (they document current usage.)

thanks,

greg k-h

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#13 lore raw
In reply to Brian King

Hi Greg,

Quoted 7 lines
Quoted 4 lines

using something like /lib/drivername will cause much more troubles than it will help us. So I think /lib/firmware is a nice place to keep the firmware files. The Debian packages already did it this way and so I think we should go this way. Any arguments against it?

No argument from me. We can get the LSB to add this after we implement it (they document current usage.)

then please apply the attached patch ;)

Regards

Marcel

etc/hotplug/firmware.agent +1 -1
diff -urN hotplug-2004_03_29/etc/hotplug/firmware.agent hotplug-2004_03_29-mh/etc/hotplug/firmware.agent
@@ -20,7 +20,7 @@
 # DEBUG=yes export DEBUG
 
 # directory of the firmware files
-FIRMWARE_DIR=/usr/lib/hotplug/firmware
+FIRMWARE_DIR=/lib/firmware
 
 # mountpoint of sysfs
 SYSFS=$(sed -n 's/^.* \([^ ]*\) sysfs .*$/\1/p' /proc/mounts)
Applied
#14 lore raw
In reply to Brian King
Quoted 11 lines · Marcel Holtmann

Hi Greg,

Quoted 7 lines
Quoted 4 lines

using something like /lib/drivername will cause much more troubles than it will help us. So I think /lib/firmware is a nice place to keep the firmware files. The Debian packages already did it this way and so I think we should go this way. Any arguments against it?

No argument from me. We can get the LSB to add this after we implement it (they document current usage.)

then please apply the attached patch ;)

Applied, thanks.

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel