scripts: modernize abi-generate & find-firmware
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
c0b70725e7
commit
5198ce8db0
9
debian/scripts/abi-generate
vendored
9
debian/scripts/abi-generate
vendored
@ -1,8 +1,11 @@
|
|||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl
|
||||||
|
|
||||||
use PVE::Tools;
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
use IO::File;
|
use PVE::Tools ();
|
||||||
|
|
||||||
|
use IO::File ();
|
||||||
|
|
||||||
sub usage {
|
sub usage {
|
||||||
die "USAGE: $0 INFILE OUTFILE [ABI INFILE-IS-DEB]\n";
|
die "USAGE: $0 INFILE OUTFILE [ABI INFILE-IS-DEB]\n";
|
||||||
|
15
debian/scripts/find-firmware.pl
vendored
15
debian/scripts/find-firmware.pl
vendored
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
my $dir = shift;
|
my $dir = shift;
|
||||||
|
|
||||||
@ -12,21 +13,21 @@ warn "\n\nNOTE: strange directory name: $dir\n\n" if $dir !~ m|^(.*/)?(\d+.\d+.\
|
|||||||
|
|
||||||
my $apiver = $2;
|
my $apiver = $2;
|
||||||
|
|
||||||
open(TMP, "find '$dir' -name '*.ko'|");
|
open(my $FIND_KO_FH, "find '$dir' -name '*.ko'|");
|
||||||
while (defined(my $fn = <TMP>)) {
|
while (defined(my $fn = <$FIND_KO_FH>)) {
|
||||||
chomp $fn;
|
chomp $fn;
|
||||||
my $relfn = $fn;
|
my $relfn = $fn;
|
||||||
$relfn =~ s|^$dir/*||;
|
$relfn =~ s|^$dir/*||;
|
||||||
|
|
||||||
my $cmd = "/sbin/modinfo -F firmware '$fn'";
|
my $cmd = "/sbin/modinfo -F firmware '$fn'";
|
||||||
open(MOD, "$cmd|");
|
open(my $MOD_FH, "$cmd|");
|
||||||
while (defined(my $fw = <MOD>)) {
|
while (defined(my $fw = <$MOD_FH>)) {
|
||||||
chomp $fw;
|
chomp $fw;
|
||||||
print "$fw $relfn\n";
|
print "$fw $relfn\n";
|
||||||
}
|
}
|
||||||
close(MOD);
|
close($MOD_FH);
|
||||||
|
|
||||||
}
|
}
|
||||||
close TMP;
|
close($FIND_KO_FH);
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user