/usr/share/kernel-wedge/commands/preprocess is in kernel-wedge 2.90ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | #!/usr/bin/perl
use strict;
use warnings;
my $defconfigdir = ($ENV{KW_DEFCONFIG_DIR} || '/usr/share/kernel-wedge');
my $sysdir="$defconfigdir/modules/";
my %modules;
my %loaded;
sub loadlist {
my $list=shift;
if ($loaded{$list}) {
die "include loop detected loading $list\n";
}
$loaded{$list}=1;
my $fh;
open ($fh, $list) || die "cannot read $list\n";
while (<$fh>) {
chomp;
if (/^\s*#include\s+<(.*)>\s*$/) {
my $basename=$1;
loadlist($sysdir.$basename);
}
elsif (/^\s*#include\s+"(.*)"\s*$/) {
my $include=$1;
my ($dirname)=$list=~m!(.*/).*!;
loadlist($dirname.$include);
}
elsif (/^\s*$/) {
next;
}
elsif (/^\s*#/) {
next;
}
elsif (/(.*) -$/) {
delete $modules{$1};
# may also appear in other forms:
delete $modules{"$1 ?"};
delete $modules{"-$1"};
}
else {
s/^\s*//;
s/\s*$//;
$modules{$_}=1;
}
}
close $fh;
}
my $file=shift || die "no input file given";
loadlist($file);
foreach my $m (sort keys %modules) {
print "$m\n";
}
|