]> git.proxmox.com Git - pve-firmware.git/commitdiff
assemble: support GLOBs in FW list entries
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 4 May 2022 11:48:25 +0000 (13:48 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 4 May 2022 11:48:27 +0000 (13:48 +0200)
even if I'm a bit unsure how the kernel resolves these...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
assemble-firmware.pl

index 99bb2ff0d567bf6e82234272543dae32b71ff053..540f0163c9ef1439ce509827d328c1cfadc17b27 100755 (executable)
@@ -422,6 +422,26 @@ while(defined(my $line = <$fd>)) {
     }
 
     my $module = basename($mod);
+    my $name = basename($fw);
+
+    if ($name =~ /\*/) {
+       my $sr = `find '$target' \\( -type f -o -type l \\) -name '$name'`;
+       chomp $sr;
+       if ($sr) {
+           for my $f (split("\n", $sr)) {
+               print "found $f for GLOB '$name'\n";
+               my $f_name = basename($f);
+               $fwbase_name->{$f_name} = 1;
+           }
+           warn "WARN: allowed to skip existing '$fw'\n" if $skip->{$fw};
+           next;
+       } else {
+           next if $skip->{$fw};
+           warn "ERROR: unable to find FW for GLOB ($module): $fw\n";
+           $error++;
+       }
+    }
+
     if ($fw =~ m|/|) {
        next if $skip->{$fw};
 
@@ -430,8 +450,6 @@ while(defined(my $line = <$fd>)) {
        next;
     }
 
-    my $name = basename($fw);
-
     my $sr = `find '$target' \\( -type f -o -type l \\) -name '$name'`;
     chomp $sr;
     if ($sr) {