[PATCH] Use modinfo to find out what firmware we need in initrd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We can use 'modinfo -F firmware' to query the modules that are
going into the initrd about what firmware they require. Some
modules don't (or can't) export that information, so they will
still need to be pulled in manually.

iwl4965 and iwl5000 don't exist anymore, so they were removed from
the case statement; qla2xxx exports modinfo data so it's not
necessary to pull its firmware manually.
---
 scripts/mk-images |   25 ++++++++++---------------
 1 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/scripts/mk-images b/scripts/mk-images
index d745c7f..6ab52ce 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -301,12 +301,16 @@ makemoduletree() {
         }
     done
 
-    # Copy in driver firmware we want during installation.  NOTE:  This isn't
-    # the ideal solution, but we'll do this for now.  What we really want is
-    # for the kernel modules to include a modinfo field that names the firmware
-    # file we should have.  If we can get that it would make it even easier to
-    # push the kernel people to depend on the firmware packages in the kernel,
-    # but we have to take small steps first.
+    echo "Copying required firmware..."
+    find $MMB_DIR/lib/modules/ -name *.ko | while read module ; do
+        for fw in $(modinfo -F firmware $module); do
+            cp $KERNELROOT/lib/firmware/$fw $MBD_DIR/firmware
+        done
+    done
+
+    # Copy in driver firmware we know we'll want during installation. This is
+    # required for modules which still don't (or can't) export information
+    # about what firmware files they require.
     for module in $MODSET ; do
         case $module in
             ipw2100)
@@ -318,21 +322,12 @@ makemoduletree() {
             iwl3945)
                 cp $KERNELROOT/lib/firmware/iwlwifi-3945* $MBD_DIR/firmware
                 ;;
-            iwl4965)
-                cp $KERNELROOT/lib/firmware/iwlwifi-4965* $MBD_DIR/firmware
-                ;;
-            iwl5000)
-                cp $KERNELROOT/lib/firmware/iwlwifi-5000* $MBD_DIR/firmware
-                ;;
             atmel)
                 cp $KERNELROOT/lib/firmware/atmel_*.bin $MBD_DIR/firmware
                 ;;
             zd1211rw)
                 cp -r $KERNELROOT/lib/firmware/zd1211 $MBD_DIR/firmware
                 ;;
-            qla2xxx)
-                cp $KERNELROOT/lib/firmware/ql* $MBD_DIR/firmware
-                ;;
         esac
     done
 
-- 
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux