Last change
on this file since 3255 was 3213, checked in by Bruno Cornec, 11 years ago |
- Add a get-modules.pl script to mindi (TBD further)
|
-
Property svn:executable
set to
*
|
File size:
1.1 KB
|
Rev | Line | |
---|
[900] | 1 | #!/usr/bin/perl -w
|
---|
| 2 |
|
---|
| 3 | use strict;
|
---|
| 4 | use POSIX "uname";
|
---|
[3213] | 5 | use Data::Dumper;
|
---|
[900] | 6 |
|
---|
[3213] | 7 | my ($sysname, $nodename, $release, $version, $machine ) = uname();
|
---|
[900] | 8 | my $ver = "";
|
---|
| 9 | my $module = "";
|
---|
| 10 | my %modlist;
|
---|
| 11 | my $void = "";
|
---|
| 12 | my $allmodules = "";
|
---|
| 13 |
|
---|
| 14 |
|
---|
| 15 | if (not (defined $ARGV[0])) {
|
---|
| 16 | $ver = $release;
|
---|
| 17 | } else {
|
---|
| 18 | $ver = $ARGV[0];
|
---|
| 19 | }
|
---|
| 20 | open(LSMOD, "/sbin/lsmod |") or die "Unable to launch lsmod";
|
---|
| 21 | open(DEPMOD, "/sbin/depmod -n $ver |") or die "Unable to launch depmod";
|
---|
| 22 |
|
---|
| 23 | while (<DEPMOD>) {
|
---|
| 24 | ($module, $modlist{$module}) = split(/:/);
|
---|
[3213] | 25 | chomp($modlist{$module});
|
---|
[900] | 26 | last if ($module =~ /^#/);
|
---|
| 27 | #print "Analyzing $module\n";
|
---|
| 28 | }
|
---|
[3213] | 29 | print Dumper(%modlist)."\n";
|
---|
[900] | 30 | while (<LSMOD>) {
|
---|
| 31 | next if (/^Module/);
|
---|
| 32 | ($module, $void) = split(/ /);
|
---|
| 33 | #print "Analyzing $module\n";
|
---|
| 34 | $module = `/sbin/modinfo -n $module`;
|
---|
| 35 | chomp($module);
|
---|
[3213] | 36 | my ($void,$lib,$modulep,$kernelv,$modpath) = split(/\//,$module,5);
|
---|
| 37 | print "modpath: $modpath\n";
|
---|
| 38 | $allmodules .= $modlist{$modpath};
|
---|
[900] | 39 | }
|
---|
| 40 | close(LSMOD);
|
---|
| 41 | close(DEPMOD);
|
---|
| 42 | $allmodules =~ s/\n/ /g;
|
---|
| 43 | $allmodules =~ s/ */ /g;
|
---|
[3213] | 44 | $allmodules =~ s/ [0-9A-z\/]*\// /g;
|
---|
| 45 | $allmodules =~ s/\.ko.xz//g;
|
---|
| 46 | print "all modules: $allmodules\n";
|
---|
Note:
See
TracBrowser
for help on using the repository browser.