Changeset 2668 for devel


Ignore:
Timestamp:
Jul 1, 2010, 5:08:50 PM (9 years ago)
Author:
bruno
Message:

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

Location:
devel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • devel/mr/etc/mondorescue.conf

    r2667 r2668  
    2424mr_cmdline solaris = /proc/cmdline
    2525#
    26 mr_fstab default = /etc/fstab
    27 mr_raidtab linux = /etc/raidtab
    28 mr_swap linux = /proc/swaps
    29 mr_partitions linux = /proc/partitions
    30 mr_filesystems linux = /proc/filesystems
    31 mr_modules linux = /proc/modules
    32 mr_xen linux = /proc/sys/xen
     26mr_etc_fstab default = /etc/fstab
     27mr_etc_raidtab linux = /etc/raidtab
     28mr_proc_partitions linux = /proc/partitions
     29mr_proc_filesystems linux = /proc/filesystems
     30mr_proc_modules linux = /proc/modules
     31mr_proc_cpuinfo linux = /proc/cpuinfo
     32mr_proc_devices linux = /proc/devices
     33mr_proc_meminfo linux = /proc/meminfo
     34mr_proc_version linux = /proc/version
     35mr_proc_mounts linux = /proc/mounts
     36mr_proc_misc linux = /proc/misc
     37mr_proc_swaps linux = /proc/swaps
     38mr_proc_xen linux = /proc/sys/xen
    3339
    3440# Location of some commands
    3541#
    36 mr_mount linux = /bin/mount
    37 mr_df linux = /bin/df
    38 mr_lsmod linux = /sbin/lsmod
     42mr_cmd_mount linux = /bin/mount
     43mr_opt_mount linux = -l
     44mr_cmd_df linux = /bin/df
     45mr_opt_df linux = -TP
     46mr_cmd_dmidecode linux = /usr/sbin/dmidecode
     47mr_cmd_lshw linux = /usr/sbin/lshw
     48# Pb of key here want both linux and mrmini or mondoarchive or ...
     49mr_cmd_mkisofs linux = /usr/bin/mkisofs
    3950
    4051#
  • 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.
  • devel/mr/lib/MondoRescue/Kernel.pm

    r2667 r2668  
    1212use strict 'vars';
    1313use Data::Dumper;
    14 use English;
    1514use lib qw (lib);
    1615use ProjectBuilder::Base;
    1716use ProjectBuilder::Conf;
    1817use MondoRescue::Base;
     18use MondoRescue::Inventory;
    1919
    2020# Inherit from the "Exporter" module which handles exporting functions.
     
    2626
    2727our @ISA = qw(Exporter);
    28 our @EXPORT = qw(mr_kernel_check);
     28our @EXPORT = qw(mr_kernel_get_version);
    2929
    3030=pod
     
    4242=over 4
    4343
    44 =item B<mr_kernel_check>
     44=item B<mr_kernel_get_version>
    4545
    4646This function checks the kernel and returns back its version
     
    5050sub mr_kernel_get_version {
    5151
     52my ($os,$ver,$kernelver,$rest);
     53
     54# By default we don't know how it works for other OSes
     55$kernelver = "unknown";
     56
     57($os,$ver,$kernelver,$rest) = split(/ /,$mr_os->{'files'}->{'proc_version'}) if ($mr_os->{'os'} eq "linux");
     58
     59return($kernelver);
    5260}
    5361
  • devel/mrmini/lib/MondoRescue/Mini/Base.pm

    r2667 r2668  
    5656#
    5757# Checks
    58 die "mr->mini_conf not declared in environment" if (not defined $mr->{'confdir'});
     58die "mr->confdir not declared in environment" if (not defined $mr->{'confdir'});
    5959
    6060# Better ?
Note: See TracChangeset for help on using the changeset viewer.