pve-kernel-thunderx/debian/scripts/find-firmware.pl
Fabian Mastenbroek 2b91eaf97f
Introduce pve-edge-kernel package
This change adds a Debian package for customized Proxmox kernels.
2020-04-28 20:05:57 +02:00

32 lines
562 B
Perl
Executable file

#!/usr/bin/perl -w
use strict;
my $dir = shift;
die "no directory to scan" if !$dir;
die "no such directory" if ! -d $dir;
# die "strange directory name: $dir" if $dir !~ m|^(.*/)?(5.\d.\d+\-\d+\-pve)(/+)?$|;
my $apiver = $2;
open(TMP, "find '$dir' -name '*.ko'|");
while (defined(my $fn = <TMP>)) {
chomp $fn;
my $relfn = $fn;
$relfn =~ s|^$dir/*||;
my $cmd = "/sbin/modinfo -F firmware '$fn'";
open(MOD, "$cmd|");
while (defined(my $fw = <MOD>)) {
chomp $fw;
print "$fw $relfn\n";
}
close(MOD);
}
close TMP;
exit 0;