Changeset 3147 in MondoRescue for branches/3.1/mindi/mindi-bkphw


Ignore:
Timestamp:
Jun 19, 2013, 8:34:46 AM (11 years ago)
Author:
Bruno Cornec
Message:
  • First pass on svn merge -r 2935:3146 ../3.0
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1/mindi/mindi-bkphw

    r2937 r3147  
    22#
    33# $Id$
     4# Copyright B. Cornec 2005-2013
     5# Provided under the GPL v2
    46#
    57# Backup the hardware configuration on machine supporting it
     
    810use strict;
    911use File::Basename;
     12
     13=pod
     14
     15=head1 NAME
     16
     17mindi-bkphw keeps track of your hardware configuration (BIOS, Raid, Management board, ...)
     18
     19=head1 DESCRIPTION
     20
     21mindi-bkphw keeps track of your hardware configuration by calling the tool provided by IHV (Independant Hardware Vendor) in order to store the configuration of the system BIOS, the RAID controller or the onboard management card if any of those is present.
     22
     23For the moment, this is only working for HP ProLiant servers, as HP provides all these tools in a convenient way to perform these actions. Other manufacturer can provide patches or relevant info in order to be supported as well here.
     24
     25=head1 SYNOPSIS
     26
     27mindi-bkphw /path/to/cache-dir /path/to/conf-dir
     28
     29=head1 ARGUMENTS
     30
     31=over 4
     32
     33=item B</path/to/cache-dir>
     34
     35This is the directory where the generated files will be stored.
     36
     37=item B</path/to/conf-dir>
     38
     39This is the directory where the configuration file describing the tools needed to backup hardware information is stored. Generaly /etc/mindi. It should contain a deplist.d subdirectory, and for now only the ProLiant.conf file is used in it.
     40
     41=back
     42
     43=head1 WEB SITES
     44
     45The main Web site of the project is available at L<http://www.mondorescue.org>. Bug reports should be filled using the trac instance of the project at L<http://trac.mondorescue.org/>.
     46
     47=head1 USER MAILING LIST
     48
     49For community exchanges around MondoRescue please use the list L<http://sourceforge.net/mailarchive/forum.php?forum_name=mondo-devel>
     50
     51=head1 AUTHORS
     52
     53The MondoRescue team lead by Bruno Cornec L<mailto:bruno@mondorescue.org>.
     54
     55=head1 COPYRIGHT
     56
     57MondoRescue is distributed under the GPL v2.0 license or later,
     58described in the file C<COPYING> included with the distribution.
     59
     60=cut
     61
    1062
    1163# Handling Configuration files
     
    3183close(SYSTEM);
    3284
    33 die "WARNING: No product name found for Hardware support\n" if (not defined $productname);
     85die "INFO: No product name found for Hardware support\n" if (not defined $productname);
    3486
    3587if ($productname =~ /proliant/i) {
    3688    print "Detected a $productname. Nice. Continue to support my job :-)\n";
    3789    print "Activating ProLiant support for mindi\n";
    38     print "You can install the SmartStart Scripting toolkit tool $tool\nto benefit from mindi's enhanced ProLiant support\n";
    39     print "Get it from http://www.hp.com/servers/sstoolkit\n";
    40     print "And use the SDR to get all other HP ProLiant packages\n";
    41     print "Get it from http://downloads.linux.hp.com/SDR/downloads/ProLiantSupportPack/\n";
     90    print "You can install SDR packages to benefit from mindi's enhanced ProLiant support\n";
     91    print "Get them from http://downloads.linux.hp.com/SDR/\n";
    4292    open(PROLIANT,"$confdir/deplist.d/ProLiant.conf") || die "Unable to open $confdir/deplist.d/ProLiant.conf";
    4393    # generate a list of what need to be put on the backup media
     
    71121        }
    72122        if ($tool =~ /\/conrep$/) {
     123            my $xmlf = "/opt/hp/hp-scripting-tools/etc/conrep.xml";
    73124            # From the package
    74             if (! -f "/opt/hp/hp-scripting-tools/etc/conrep.xml") {
    75                 $ret = system("$tool -s -x /opt/hp/hp-scripting-tools/etc/conrep.xml -f$bkpdir/conrep.dat");
     125            if (-f $xmlf) {
     126                $ret = system("$tool -s -x $xmlf -f$bkpdir/conrep.dat");
    76127            # From the SSSTK
    77             } elsif (! -f "/usr/share/conrep/conrep.xml") {
    78                 $ret = system("$tool -s -x /usr/share/conrep/conrep.xml -f$bkpdir/conrep.dat");
    79128            } else {
    80                 next;
     129                $xmlf = "/usr/share/conrep/conrep.xml";
     130                if (-f $xmlf) {
     131                    $ret = system("$tool -s -x $xmlf -f$bkpdir/conrep.dat");
     132                } else {
     133                    next;
     134                }
    81135            }
    82136            print SCRIPT "$tool -l -f$locbkpdir/conrep.dat\n";
    83             print TOOLS "$tool.xml\n";
     137            print TOOLS "$xmlf\n";
     138        }
     139        if ($tool =~ /\/hp-rcu$/) {
     140            $ret = system("$tool -s -f$bkpdir/conrep.dat");
     141            print SCRIPT "$tool -l -f$locbkpdir/conrep.dat\n";
    84142        }
    85143        if ($tool =~ /\/hpacuscripting$/) {
     
    100158            print SCRIPT "./$tool -s\n";
    101159        }
     160        if ($tool =~ /\/hp-fm/) {
     161            print "Found $tool, firmware will be upgraded at restore time on your HP ProLiant\n";
     162            print SCRIPT "./$tool upgrade\n";
     163        }
    102164        # Kept for compatibility with older version of tools
    103165        if (($tool =~ /\/hpacucli$/) && ($hasfound == 0)) {
     
    114176    close(SCRIPT);
    115177} else {
    116     print "\nWARNING: No Hardware support for $productname.\nNot a big issue, just less features and risks ;-)\n";
     178    print "\nINFO: No Hardware support for $productname.\nNot a big issue, just less features and risks ;-)\n";
    117179    print "You may ask your manufacturer to contribute to the mindi project (harmless)\n";
    118180}
Note: See TracChangeset for help on using the changeset viewer.