Changeset 3110 in MondoRescue for devel/mr


Ignore:
Timestamp:
May 5, 2013, 4:48:59 AM (11 years ago)
Author:
Bruno Cornec
Message:
  • Store a status for devel ersion of mondo
File:
1 edited

Legend:

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

    r2668 r3110  
    1515use File::Basename;
    1616use File::Copy;
    17 use POSIX qw(strftime);
     17use POSIX qw(strftime uname);
    1818use lib qw (lib);
    1919use ProjectBuilder::Base;
     
    7676sub mr_inv_os {
    7777
    78 ($mr_os->{'name'}, $mr_os->{'version'}, $mr_os->{'family'}, $mr_os->{'type'}, $mr_os->{'os'}, $mr_os->{'suffix'}, $mr_os->{'update'}, $mr_os->{'arch'}) = pb_distro_init();
     78$mr_os->{'pbos'} = pb_distro_init();
     79
     80pb_log(2,"OS Inventory: pbos ".Dumper($mr_os)."\n");
     81
     82# Get some running kernel info
     83($mr_os->{'uname'}->{'sysname'}, $mr_os->{'uname'}->{'nodename'}, $mr_os->{'uname'}->{'release'}, $mr_os->{'uname'}->{'version'}, $mr_os->{'uname'}->{'machine'}) = uname();
     84
     85pb_log(2,"OS Inventory: uname ".Dumper($mr_os)."\n");
    7986
    8087# Get some conf file content when they exist; Depends on genre or more precise tuple
    81 for 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") {
     88for 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") {
    8289    my $key = $p;
    8390    $key =~ s/mr_//;
    8491    my ($pp) = pb_conf_get_if($p);
    8592    if (defined $pp) {
    86         my $file = pb_distro_get_param($mr_os->{'name'},$mr_os->{'version'},$mr_os->{'arch'},$pp,$mr_os->{'family'},$mr_os->{'type'},$mr_os->{'os'});
     93        my $file = pb_distro_get_param($mr_os->{'pbos'},$pp);
    8794        if (-r $file) {
    8895            pb_log(2,"DEBUG: File found: $file\n");
     
    94101}
    95102
     103pb_log(2,"OS Inventory: files ".Dumper($mr_os)."\n");
     104
     105return;
    96106# Get some commands result content when they exist; Depends on genre or more precise tuple
    97107for my $p ("mr_cmd_mount","mr_cmd_df","mr_cmd_dmidecode","mr_cmd_lshw") {
     
    101111    my ($po) = pb_conf_get_if("mr_opt_".$key);
    102112    if (defined $pp) {
    103         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'});
     113        my $cmd = pb_distro_get_param($mr_os->{'pbos'},$pp);
    104114        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));
     115        $opt = pb_distro_get_param($mr_os->{'pbos'},$po) if (defined ($po));
    106116        if (-x $cmd) {
    107117            pb_log(2,"DEBUG: Cmd found: $cmd $opt\n");
     
    112122    }
    113123}
     124
     125pb_log(2,"OS Inventory: cmds ".Dumper($mr_os)."\n");
    114126#
    115127# LVM setup
Note: See TracChangeset for help on using the changeset viewer.