Last change
on this file since 1808 was 1047, checked in by Bruno Cornec, 18 years ago |
Take mindi from trunk with configuration file and multiple deplist
|
-
Property svn:executable
set to
*
|
File size:
838 bytes
|
Line | |
---|
1 | #!/usr/bin/perl -w
|
---|
2 |
|
---|
3 | use strict;
|
---|
4 | use POSIX "uname";
|
---|
5 |
|
---|
6 | my ($sysname, $nodename, $release, $version, $machine ) = uname;
|
---|
7 | my $ver = "";
|
---|
8 | my $module = "";
|
---|
9 | my %modlist;
|
---|
10 | my $void = "";
|
---|
11 | my $allmodules = "";
|
---|
12 |
|
---|
13 |
|
---|
14 | if (not (defined $ARGV[0])) {
|
---|
15 | $ver = $release;
|
---|
16 | } else {
|
---|
17 | $ver = $ARGV[0];
|
---|
18 | }
|
---|
19 | open(LSMOD, "/sbin/lsmod |") or die "Unable to launch lsmod";
|
---|
20 | open(DEPMOD, "/sbin/depmod -n $ver |") or die "Unable to launch depmod";
|
---|
21 |
|
---|
22 | while (<DEPMOD>) {
|
---|
23 | ($module, $modlist{$module}) = split(/:/);
|
---|
24 | last if ($module =~ /^#/);
|
---|
25 | #print "Analyzing $module\n";
|
---|
26 | }
|
---|
27 | while (<LSMOD>) {
|
---|
28 | next if (/^Module/);
|
---|
29 | ($module, $void) = split(/ /);
|
---|
30 | #print "Analyzing $module\n";
|
---|
31 | $module = `/sbin/modinfo -n $module`;
|
---|
32 | chomp($module);
|
---|
33 | $allmodules .= $modlist{$module};
|
---|
34 | }
|
---|
35 | close(LSMOD);
|
---|
36 | close(DEPMOD);
|
---|
37 | $allmodules =~ s/\n/ /g;
|
---|
38 | $allmodules =~ s/ */ /g;
|
---|
39 | print "$allmodules\n";
|
---|
Note:
See
TracBrowser
for help on using the repository browser.