Changeset 2668 in MondoRescue for devel/mr/lib/MondoRescue/Inventory.pm


Ignore:
Timestamp:
Jul 1, 2010, 5:08:50 PM (10 years ago)
Author:
Bruno Cornec
Message:

r3939@athonet: bruno | 2010-06-30 16:50:32 +0200
Renaming of conf file parameters to be more specific

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/mr/lib/MondoRescue/Inventory.pm

    r2667 r2668  
    2121use ProjectBuilder::Distribution;
    2222use MondoRescue::LVM;
    23 use MondoRescue::Kernel;
    2423
    2524# Inherit from the "Exporter" module which handles exporting functions.
     
    8079
    8180# Get some conf file content when they exist; Depends on genre or more precise tuple
    82 for my $p ("mr_cmdline","mr_fstab","mr_raidtab","mr_swap","mr_partitions","mr_filesystems","mr_modules","mr_xen") {
     81for my $p ("mr_proc_cmdline","mr_etc_fstab","mr_etc_raidtab","mr_proc_swaps","mr_proc_partitions","mr_proc_filesystems","mr_proc_modules","mr_proc_xen","mr_proc_cpuinfo","mr_proc_devices","mr_proc_meminfo","mr_proc_misc","mr_proc_mounts","mr_proc_version") {
    8382    my $key = $p;
    8483    $key =~ s/mr_//;
     
    9089            $mr_os->{'files'}->{$key} = pb_get_content($file);
    9190        } else {
    92             pb_log(2,"WARNING: $file not found\n");
     91            pb_log(1,"WARNING: $file not found\n");
    9392        }
    9493    }
     
    9695
    9796# Get some commands result content when they exist; Depends on genre or more precise tuple
    98 for my $p ("mr_mount","mr_lsmod","mr_df") {
     97for my $p ("mr_cmd_mount","mr_cmd_df","mr_cmd_dmidecode","mr_cmd_lshw") {
    9998    my $key = $p;
    100     $key =~ s/mr_//;
     99    $key =~ s/mr_cmd_//;
    101100    my ($pp) = pb_conf_get_if($p);
     101    my ($po) = pb_conf_get_if("mr_opt_".$key);
    102102    if (defined $pp) {
    103103        my $cmd = pb_distro_get_param($mr_os->{'name'},$mr_os->{'version'},$mr_os->{'arch'},$pp,$mr_os->{'family'},$mr_os->{'type'},$mr_os->{'os'});
    104         pb_log(2,"DEBUG: Cmd found: $cmd\n");
    105         $mr_os->{'cmd'}->{$key} = `$cmd`;
     104        my $opt = "";
     105        $opt = pb_distro_get_param($mr_os->{'name'},$mr_os->{'version'},$mr_os->{'arch'},$po,$mr_os->{'family'},$mr_os->{'type'},$mr_os->{'os'}) if (defined ($po));
     106        if (-x $cmd) {
     107            pb_log(2,"DEBUG: Cmd found: $cmd $opt\n");
     108            $mr_os->{'cmd'}->{$key} = `$cmd $opt`;
     109        } else {
     110            pb_log(1,"WARNING: $cmd not found\n");
     111        }
    106112    }
    107113}
     
    109115# LVM setup
    110116#
    111 ($mr_os->{'lvmver'},$mr_os->{'$lvmcmd'}) = mr_lvm_check();
     117($mr_os->{'lvmver'},$mr_os->{'lvmcmd'}) = mr_lvm_check();
    112118
    113119# Summary of conf printed.
Note: See TracChangeset for help on using the changeset viewer.