- Timestamp:
- Jun 27, 2010, 3:27:16 PM (15 years ago)
- Location:
- devel/mr
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/mr/etc/mondorescue.conf
r2659 r2667 16 16 17 17 # 18 # Location of the fstab file 18 # Location of some configuration files 19 # 20 # depends on genre 21 mr_cmdline linux = /proc/cmdline 22 mr_cmdline bsd = /tmp/cmdline 23 # TBC 24 mr_cmdline solaris = /proc/cmdline 19 25 # 20 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 33 34 # Location of some commands 35 # 36 mr_mount linux = /bin/mount 37 mr_df linux = /bin/df 38 mr_lsmod linux = /sbin/lsmod 21 39 22 40 # -
devel/mr/lib/MondoRescue/Base.pm
r2666 r2667 117 117 =item B<mr_conf_get> 118 118 119 This function get parameters in configuration files and returns from the least significant level (default) to the emost significant level (application name), passing by the project name.119 This function get parameters in configuration files and returns from the least significant level (default) to the most significant level (application name), passing by the project name. 120 120 It takes a list of parameters to find and returns the values corresponding 121 121 -
devel/mr/lib/MondoRescue/Inventory.pm
r2468 r2667 19 19 use ProjectBuilder::Base; 20 20 use ProjectBuilder::Conf; 21 use ProjectBuilder::Distribution; 22 use MondoRescue::LVM; 23 use MondoRescue::Kernel; 21 24 22 25 # Inherit from the "Exporter" module which handles exporting functions. … … 28 31 29 32 our @ISA = qw(Exporter); 30 our @EXPORT = qw(mr_exit); 33 our @EXPORT = qw(mr_inv_os $mr_os); 34 35 # Globals 36 our %mr_hw; 37 our $mr_hw = \%mr_hw; 38 our %mr_os; 39 our $mr_os = \%mr_hw; 31 40 32 41 =pod … … 66 75 } 67 76 68 sub mr_inv_ hw_context{77 sub mr_inv_os { 69 78 70 my %pb; 71 my ($ddir, $dver, $dfam); 72 my $cmdline = "/dev/null"; 73 ($ddir, $dver, $dfam, $pb{'dtype'}, $pb{'suf'}, $pb{'upd'}, $pb{'arch'}) = pb_distro_init(); 74 pb_log(2,"DEBUG: distro tuple: ".Dumper($ddir, $dver, $dfam, $pb{'dtype'}, $pb{'suf'})."\n"); 79 ($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(); 75 80 76 if (($pb{{'dtype'} eq "rpm") || ($pb{{'dtype'} eq "deb") || ($pb{{'dtype'} eq "ebuild") || ($pb{{'dtype'} eq "tgz")) { 77 cmdline = "/proc/cmdline"; 78 } elsif ($pb{{'dtype'} eq "pkg") { 79 cmdline = "/proc/cmdline"; 81 # 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") { 83 my $key = $p; 84 $key =~ s/mr_//; 85 my ($pp) = pb_conf_get_if($p); 86 if (defined $pp) { 87 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'}); 88 if (-r $file) { 89 pb_log(2,"DEBUG: File found: $file\n"); 90 $mr_os->{'files'}->{$key} = pb_get_content($file); 91 } else { 92 pb_log(2,"WARNING: $file not found\n"); 93 } 94 } 80 95 } 81 return(pb_get_content($cmdline)); 96 97 # 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") { 99 my $key = $p; 100 $key =~ s/mr_//; 101 my ($pp) = pb_conf_get_if($p); 102 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'}); 104 pb_log(2,"DEBUG: Cmd found: $cmd\n"); 105 $mr_os->{'cmd'}->{$key} = `$cmd`; 106 } 107 } 108 # 109 # LVM setup 110 # 111 ($mr_os->{'lvmver'},$mr_os->{'$lvmcmd'}) = mr_lvm_check(); 112 113 # Summary of conf printed. 114 pb_log(1,"OS Inventory: ".Dumper($mr_os)."\n"); 82 115 } 83 116
Note:
See TracChangeset
for help on using the changeset viewer.