Changeset 2882 in MondoRescue for branches/2.2.9/mindi/mindi-bkphw
- Timestamp:
- Oct 7, 2011, 4:16:17 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi/mindi-bkphw
r2865 r2882 11 11 # Handling Configuration files 12 12 my $tool = ""; 13 my $tooldir = "";14 13 my $ret = 0; 15 14 my $productname = undef; … … 36 35 if ($productname =~ /proliant/i) { 37 36 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 40 44 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 41 46 open(SCRIPT,"> $bkpdir/../mindi-rsthw") || die "Unable to open $bkpdir/../mindi-rsthw"; 42 47 print SCRIPT << 'EOF'; 43 48 #!/bin/bash 44 49 # 50 # Script generated by mindi 51 # 45 52 # This script will restore potentially your HW configuration 46 # on your system before partioning occurs 53 # on your system before partioning occurs. 54 # 47 55 # You may want to reboot after that step if you think that 48 56 # 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. 50 59 # 51 # put dynamic libraries at an accessible place52 for l in /usr/local/lib/*; do53 ln -sf $l /usr/lib54 done55 60 EOF 56 61 while($tool = <PROLIANT>) { 62 my $hasfound = 0; 57 63 next if ($tool =~ /^#/); 58 64 chomp($tool); 59 $tooldir = dirname($tool);65 # skip non-executable/exising binaries 60 66 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";63 67 next; 64 68 } else { 65 print "Found $tool, activating enhanced HP Pro liant support in mindi\n";69 print "Found $tool, activating enhanced HP ProLiant support in mindi\n"; 66 70 print TOOLS "$tool\n"; 67 71 } 68 72 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 } 72 79 } 73 if ($tool =~ /\/.acuxebin$/) { 80 if ($tool =~ /\/hpacuscripting$/) { 81 $hasfound = 1; 74 82 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"; 84 88 } 85 89 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"; 88 92 } 89 93 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"; 92 102 } 93 103 if ($ret != 0) {
Note:
See TracChangeset
for help on using the changeset viewer.