Ignore:
Timestamp:
Mar 5, 2015, 1:23:38 PM (9 years ago)
Author:
Bruno Cornec
Message:
  • mr-kernel-get-modules now uses Getopt for parameter management, allowing verbosity increase
  • Fix mr_kernel_get_modules to support depmod version providing relative paths such as on RHEL5
  • Fix mr_kernel_get_modules to support modinfo version withou -k option support, using module full path instead
  • the modlist hash is now having keys being full path module names as a consequence
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/MondoRescue/bin/mr-kernel-get-modules

    r3250 r3354  
    66use ProjectBuilder::Base;
    77use MondoRescue::Kernel;
     8use Getopt::Long qw(:config auto_abbrev no_ignore_case);
    89
    9 my $ver = undef;
     10my %opts;                           # CLI Options
    1011
    11 if ((defined $ARGV[0]) && ($ARGV[0] eq "-v")) {
    12     #$pbverbose = 1;
    13     shift;
    14 }
    15 if ((defined $ARGV[0]) && ($ARGV[0] eq "-k")) {
    16     shift;
    17     $ver = $ARGV[0];
    18     shift;
    19 }
    20 if ((defined $ARGV[0]) && ($ARGV[0] eq "-m")) {
    21     shift;
    22 }
     12GetOptions(
     13        "kernel|k:s" => \$opts{'k'},
     14        "verbose|v+" => \$opts{'v'},
     15);
    2316
    24 print join(' ',mr_kernel_get_modules($ver,@ARGV))."\n";
     17$pbdebug = $opts{'v'};
     18$pbdebug = 0 if (not defined $pbdebug);
     19print join(' ',mr_kernel_get_modules($opts{'k'},@ARGV))."\n";
Note: See TracChangeset for help on using the changeset viewer.