- Timestamp:
- Feb 27, 2014, 3:48:25 AM (11 years ago)
- Location:
- branches/3.2/MondoRescue
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/MondoRescue/bin/mr-kernel-get-modules
r3249 r3250 18 18 shift; 19 19 } 20 my ($modulepath,@allmodpaths) = mr_kernel_get_modules($ver,@ARGV); 21 print "modules path: $modulepath\n"; 22 print "all modpaths: ".join(' ',@allmodpaths)."\n"; 20 if ((defined $ARGV[0]) && ($ARGV[0] eq "-m")) { 21 shift; 22 } 23 24 print join(' ',mr_kernel_get_modules($ver,@ARGV))."\n"; -
branches/3.2/MondoRescue/lib/MondoRescue/Kernel.pm
r3249 r3250 76 76 sub mr_kernel_get_modules { 77 77 78 my $ver = $_; 78 my @allmodules = @_; 79 my $ver = shift @allmodules; 79 80 $ver = mr_kernel_get_version() if (not defined ($ver)); 80 my @allmodules = @_;81 81 82 82 my $module = ""; … … 86 86 my $modulepath = ""; 87 87 88 #print Dumper(@allmodules); 89 88 90 # If no module names list passed as parameter, the work on all modules of the system 89 91 if (not defined $allmodules[0]) { … … 92 94 next if (/^Module/); 93 95 ($module, $void) = split(/ /); 96 print "***$module***|***$void***\n"; 94 97 push @allmodules,$module; 95 98 } 96 99 close(LSMOD); 97 100 } 101 #print Dumper(@allmodules); 98 102 99 103 open(DEPMOD, "/sbin/depmod -n $ver |") or die "Unable to launch depmod"; … … 102 106 last if ($module =~ /^#/); 103 107 chomp($void); 108 $void =~ s/\s+//; 104 109 $modlist{$module} = $void; 105 110 pb_log(2,"Depmod on $module gives $void\n"); … … 126 131 ($void,$lib,$modulep,$kernelv,$modpath) = split(/\//,$module,5); 127 132 next if (not defined $modpath); 128 pb_log(2,"modpath: $modpath\n"); 129 push @allmodpaths,$modpath,split(/ /,$modlist{$modpath}); 133 $modulepath = "/$lib/$modulep/$kernelv"; 134 pb_log(2,"modpath: $modulepath/$modpath\n"); 135 push @allmodpaths,"$modulepath/$modpath",map { "$modulepath/".$_ } split(/ /,$modlist{$modpath}); 130 136 } 131 $modulepath = "/$lib/$modulep/$kernelv";132 pb_log(1,"modules path: $modulepath\n");133 137 pb_log(1,"all modpaths: ".join(' ',@allmodpaths)."\n"); 134 return($modulepath,@allmodpaths); 138 # From List::More 139 my %seen = (); 140 return(grep { not $seen{$_}++ } @allmodpaths); 135 141 } 136 142
Note:
See TracChangeset
for help on using the changeset viewer.