summaryrefslogtreecommitdiffstats
path: root/kernel/modules.pl
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2020-12-12 17:33:53 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2020-12-12 20:03:06 +0000
commit919c65ddceb95bef0e959e0ce4df4a2e4e01ed7c (patch)
tree9c5ce1593b79bd4154aef0cdd650f390f6f7a460 /kernel/modules.pl
parentc5e51a435098a211910d02e801523c52df1214c4 (diff)
downloaddrakx-919c65ddceb95bef0e959e0ce4df4a2e4e01ed7c.tar
drakx-919c65ddceb95bef0e959e0ce4df4a2e4e01ed7c.tar.gz
drakx-919c65ddceb95bef0e959e0ce4df4a2e4e01ed7c.tar.bz2
drakx-919c65ddceb95bef0e959e0ce4df4a2e4e01ed7c.tar.xz
drakx-919c65ddceb95bef0e959e0ce4df4a2e4e01ed7c.zip
Identify and include missing firmware for iwlwifi (mga#9541)
Diffstat (limited to 'kernel/modules.pl')
-rw-r--r--kernel/modules.pl20
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/modules.pl b/kernel/modules.pl
index 70d6ed0bd..9ec6f5356 100644
--- a/kernel/modules.pl
+++ b/kernel/modules.pl
@@ -150,3 +150,23 @@ sub check() {
exit $error;
}
+
+sub list_additional_firmware {
+ my ($kern_ver) = @_;
+
+ # The firmware reported by 'modinfo iwlwifi' is the latest supported version of each firmware
+ # type. Sometimes the latest supported version is not available, and the driver falls back to
+ # an older version. This means dracut doesn't automatically identify and include the necessary
+ # firmware files, so we need to list them here (mga#9541).
+ foreach (map { /^firmware:\s+(.*)/ ? $1 : () } split("\n", `modinfo -k $kern_ver iwlwifi`)) {
+ next if -f "/lib/firmware/$_";
+ my ($basename, $version) = /(.*)-([0-9]+).ucode/;
+ while ($version-- > 0) {
+ my $filepath = "/lib/firmware/$basename-$version.ucode";
+ if (-f $filepath) {
+ print "$filepath\n";
+ last;
+ }
+ }
+ }
+}