]>
git.proxmox.com Git - pve-kernel.git/blob - debian/scripts/abi-generate
7 my $input_file = shift;
8 my $output_file = shift;
10 my $extract_deb = shift;
12 die "input file '$input_file' does not exist\n" if ! -e
$input_file;
14 my $modules_symver_fh;
18 push @$cmd, ['dpkg', '--fsys-tarfile', $input_file];
19 push @$cmd, ['tar', '-xOf', '-', "./usr/src/linux-headers-${abi}/Module.symvers"];
20 $modules_symver_fh = IO
::File-
>new_tmpfile();
21 PVE
::Tools
::run_command
($cmd, output
=> '>&'.fileno($modules_symver_fh));
22 seek($modules_symver_fh, 0, 0);
24 open($modules_symver_fh, '<', $input_file) or die "can't open '$input_file' - $!\n";
28 while(my $line = <$modules_symver_fh>) {
29 if ($line =~ /^(.+)\s+(.+)\s+(.+)$/) {
30 push @$lines, "$3 $2 $1";
32 warn "malformed symvers line: '$line'\n";
35 close($modules_symver_fh);
37 PVE
::Tools
::file_set_contents
($output_file, join("\n", sort @$lines));