Changeset 3110


Ignore:
Timestamp:
May 5, 2013, 4:48:59 AM (5 years ago)
Author:
bruno
Message:
  • Store a status for devel ersion of mondo
Location:
devel
Files:
3 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
  • devel/mrmini/lib/MondoRescue/Mini/Base.pm

    r2668 r3110  
    6262chomp($ARCH);
    6363
    64 pb_conf_add("$mr->{'confdir'}/$ENV{'PBPROJ'}.conf.dist");
    6564($mr->{'boot_size'},$mr->{'boot_cd'},$mr->{'boot_usb'},$mr->{'boot_tape'},$mr->{'kernel'},$mr->{'fstab'}) =  mr_conf_get("mr_boot_size","mr_boot_cd","mr_boot_usb","mr_boot_tape","mr_kernel","mr_fstab");
    6665($mr->{'tape_mods'},$mr->{'scsi_mods'},$mr->{'ide_mods'},$mr->{'pcmcia_mods'},$mr->{'usb_mods'},$mr->{'net_mods'},$mr->{'cdrom_mods'},$mr->{'deny_mods'},$mr->{'force_mods'}) =  mr_conf_get("mr_tape_mods","mr_scsi_mods","mr_ide_mods","mr_pcmcia_mods","mr_usb_mods","mr_net_mods","mr_cdrom_mods","mr_extra_mods","mr_deny_mods","mr_force_mods");
    6766($mr->{'cache_dir'},$mr->{'boot_msg'},$mr->{'burn_cmd'},$mr->{'burn_opt'}) = mr_conf_get("mr_cache_dir","mr_boot_msg","mr_burn_cmd","mr_burn_opt");
    68 
    69 #
    70 # Manage log file
    71 #
    72 $pbLOG = $mr->{'logdesc'};
    73 $pbdebug = 1  if ($pbdebug == -1);
    74 pb_log_init($pbdebug, $pbLOG);
    7567
    7668my $sep = "-----------------------------------------------\n";
     
    8678    pb_log(0,$sep);
    8779    pb_log(0,"Conf file $ENV{'HOME'}/.mondorescuerc\n");
    88     pb_display_file("$ENV{'HOME'}/.mondorescuerc",$pbLOG);
     80    pb_display_file("$ENV{'HOME'}/.mondorescuerc",$mr->{'logdesc'}) if ($pbdebug ge 0);
    8981}
    9082if (-r "$mr->{'confdir'}/mondorescue.conf") {
    9183    pb_log(0,$sep);
    9284    pb_log(0,"Conf file $mr->{'confdir'}/mondorescue.conf\n");
    93     pb_display_file("$mr->{'confdir'}/mondorescue.conf",$pbLOG);
     85    pb_display_file("$mr->{'confdir'}/mondorescue.conf",$mr->{'logdesc'}) if ($pbdebug ge 0);
    9486}
    9587
     
    10597
    10698# Full OS inventory
     99pb_log(0,$sep);
    107100mr_inv_os();
    108101}
  • devel/mrmini/sbin/mrmini

    r2667 r3110  
    169169# Global variables
    170170#
    171 my $proj;
    172 ($mr->{'confdir'},$proj) = mr_dynconf_init();
    173 my @date = pb_get_date();
    174 $mr->{'start_date'} = strftime("%Y-%m-%d %H:%M:%S", @date);
    175 
    176 $ENV{'PBPROJ'} = $proj;
     171mr_init();
    177172$ENV{'PBPKG'} = "mrmini";
    178173
    179174# Adds conf files in order
    180 pb_conf_add("$mr->{'confdir'}/mondorescue.conf.dist","$mr->{'confdir'}/mondorescue.conf");
    181175($mr->{'install_dir'},$mr->{'version'}) =  mr_conf_get("mr_install_dir","mr_version");
    182176
     
    193187}
    194188if (defined $opts{'p'}) {
    195     pb_display("$ENV{$opts{'p'}}\n");
     189    print("$ENV{$opts{'p'}}\n");
    196190    exit(0);
    197191}
     
    230224}
    231225
    232 #
    233 # Temp dir
    234 #
    235 pb_temp_init();
     226pb_log_init($pbdebug,$mr->{'logdesc'});
    236227mr_mini_main();
    237228mr_exit(0);
Note: See TracChangeset for help on using the changeset viewer.