2017-03-15 16:43:11 +03:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
my $dir = shift;
|
|
|
|
|
|
|
|
die "no directory to scan" if !$dir;
|
|
|
|
|
|
|
|
die "no such directory" if ! -d $dir;
|
|
|
|
|
2017-09-14 11:41:17 +03:00
|
|
|
die "strange directory name" if $dir !~ m|^(.*/)?(4.13.\d+\-\d+\-pve)(/+)?$|;
|
2017-03-15 16:43:11 +03:00
|
|
|
|
|
|
|
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;
|