Changeset 2882 in MondoRescue for branches/2.2.9/mindi/mindi-bkphw


Ignore:
Timestamp:
Oct 7, 2011, 4:16:17 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Add compatibility with the latest SSSTK + PSP content for HP ProLiant + branding homogeneous now. We only take conrep out of the SSSTK pending a package availability. Using hpacuscripting now. Review of parameters called following test made.
File:
1 edited

Legend:

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

    r2865 r2882  
    1111# Handling Configuration files
    1212my $tool = "";
    13 my $tooldir = "";
    1413my $ret = 0;
    1514my $productname = undef;
     
    3635if ($productname =~ /proliant/i) {
    3736    print "Detected a $productname. Nice. Continue to support my job :-)\n";
    38     print "Activating Proliant support for mindi\n";
    39     open(PROLIANT,"$confdir/proliant.files") || die "Unable to open $confdir/proliant.files";
     37    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";
     42    open(PROLIANT,"$confdir/deplist.d/ProLiant.conf") || die "Unable to open $confdir/deplist.d/ProLiant.conf";
     43    # generate a list of what need to be put on the backup media
    4044    open(TOOLS,"> $bkpdir/../tools.files") || die "Unable to open $bkpdir/../tools.files";
     45    # generate a script that will be launched at rstore time to perform the HW setup
    4146    open(SCRIPT,"> $bkpdir/../mindi-rsthw") || die "Unable to open $bkpdir/../mindi-rsthw";
    4247    print SCRIPT  << 'EOF';
    4348#!/bin/bash
    4449#
     50# Script generated by mindi
     51#
    4552# This script will restore potentially your HW configuration
    46 # on your system before partioning occurs
     53# on your system before partioning occurs.
     54#
    4755# You may want to reboot after that step if you think that
    4856# resetting BIOS parameters to the value restored
    49 # may have an impact on you restoration process
     57# may have an impact on your restoration process or if
     58# you want to benefit from any firmware update that could have happened.
    5059#
    51 # put dynamic libraries at an accessible place
    52 for l in /usr/local/lib/*; do
    53     ln -sf $l /usr/lib
    54 done
    5560EOF
    5661    while($tool = <PROLIANT>) {
     62        my $hasfound = 0;
    5763        next if ($tool =~ /^#/);
    5864        chomp($tool);
    59         $tooldir = dirname($tool);
     65        # skip non-executable/exising binaries
    6066        if (! (-x $tool)) {
    61             print "You could install the SmartStart Scripting toolkit tool $tool\nto benefit from mindi's enhanced hardware support\n";
    62             print "Get it from http://www.hp.com/servers/sstoolkit\n";
    6367            next;
    6468        } else {
    65             print "Found $tool, activating enhanced HP Proliant support in mindi\n";
     69            print "Found $tool, activating enhanced HP ProLiant support in mindi\n";
    6670            print TOOLS "$tool\n";
    6771        }
    6872        if ($tool =~ /\/conrep$/) {
    69             $ret = system("cd $tooldir ; $tool -s -f$bkpdir/conrep.dat");
    70             print SCRIPT "(cd $tooldir ; $tool -l -f$locbkpdir/conrep.dat)\n";
    71             print TOOLS "$tool.xml\n";
     73            if (! -f "/usr/share/conrep/conrep.xml") {
     74            } else {
     75                $ret = system("$tool -s -x /usr/share/conrep/conrep.xml -f$bkpdir/conrep.dat");
     76                print SCRIPT "($tool -l -f$locbkpdir/conrep.dat)\n";
     77                print TOOLS "$tool.xml\n";
     78            }
    7279        }
    73         if ($tool =~ /\/.acuxebin$/) {
     80        if ($tool =~ /\/hpacuscripting$/) {
     81            $hasfound = 1;
    7482            my $dir=basename($tool);
    75             $ret = system("export ACUXE_BIN_INSTALLATION_DIR=$dir ; export IM_CFGFILE_PATH=$dir ; export ACUXE_LOCK_FILES_DIR=$dir/locks ; $tool -c $bkpdir/cpqacuxe.dat");
    76             print SCRIPT "export ACUXE_BIN_INSTALLATION_DIR=$dir ; export IM_CFGFILE_PATH=$dir ; export ACUXE_LOCK_FILES_DIR=$dir/locks ; $tool -i $locbkpdir/cpqacuxe.dat\n";
    77             print TOOLS "$tooldir/bld\n";
    78         }
    79         if ($tool =~ /\/hpacucli$/) {
    80             my $dir=basename($tool);
    81             $ret = system("export ACUXE_BIN_INSTALLATION_DIR=$dir ; export IM_CFGFILE_PATH=$dir ; export ACUXE_LOCK_FILES_DIR=$dir/locks ; $tool -c $bkpdir/hpacucli.dat");
    82             print SCRIPT "export ACUXE_BIN_INSTALLATION_DIR=$dir ; export IM_CFGFILE_PATH=$dir ; export ACUXE_LOCK_FILES_DIR=$dir/locks ; $tool -i $locbkpdir/hpacucli.dat\n";
    83             print TOOLS "$tooldir/bld\n";
     83            # Just backup internal info for a DR
     84            $ret = system("$tool -c $bkpdir/hpacuscripting.dat -internal");
     85            # We could want to reset it before.
     86            print SCRIPT "# $tool -reset -i $locbkpdir/hpacusripting.dat\n";
     87            print SCRIPT "$tool -i $locbkpdir/hpacusripting.dat\n";
    8488        }
    8589        if ($tool =~ /\/hponcfg$/) {
    86             $ret = system("$tool -w $bkpdir/hponcfg.dat");
    87             print SCRIPT "$tool -r $locbkpdir/hponcfg.dat\n";
     90            $ret = system("$tool -a -w $bkpdir/hponcfg.dat");
     91            print SCRIPT "$tool -f $locbkpdir/hponcfg.dat\n";
    8892        }
    8993        if ($tool =~ /\.scexe$/) {
    90             print "Found $tool, that firmware will be applied at restore time on your HP Proliant\n";
    91             print SCRIPT "./$tool\n";
     94            print "Found $tool, that firmware will be applied at restore time on your HP ProLiant\n";
     95            print SCRIPT "./$tool -s\n";
     96        }
     97        # Kept for compatibility with older version of tools
     98        if (($tool =~ /\/hpacucli$/) && ($hasfound == 0)) {
     99            my $dir=basename($tool);
     100            $ret = system("$tool -c $bkpdir/hpacucli.dat");
     101            print SCRIPT "$tool -i $locbkpdir/hpacucli.dat\n";
    92102        }
    93103        if ($ret != 0) {
Note: See TracChangeset for help on using the changeset viewer.