source: MondoRescue/branches/2.2.10/mindi/mindi-bkphw@ 2696

Last change on this file since 2696 was 2696, checked in by Bruno Cornec, 13 years ago
  • Adds preliminary support for hpacucli. Needs test
  • Fix a compilation issue due to bad fatal_error call (no param allowed)
  • Fix some HTML syntax issues in the docs page + link to Wiki articles
  • Boot size pushed to 20MB
  • A bit more precise for error msg from PBDI
  • Exits if the protocol used is not recognized (error with -n fs:// typo)
  • Adds support for r8169 net driver
  • Fix a cast issue
  • Precise a test case to avoid ambiguity
  • Die and related functions placed before any other code as used early, and ash doesn't support function declaration. So will solve #446 by exiting mindi before doing anything weird in it.
  • Fix #445 with another technical solution to avoid vg with similar names to b wrongly excluded (vgroot and vgroot-san e.g.) (Michael Shapiro)
  • Fix a bug on exclusion of path with common content (/home and /path/home e.g.) which was handled correctly only in a certain order (John Pearson <johnp_at_gtagalenco.com.au>)
  • mount-media function is now placed in libmondo-devices.c as used by more programs.
  • Avoids calling mount_media when it's not mandatory (change the way mondorestore was working up to now but could solve some bugs reported)
  • Add xhci support to mindi.
  • Rewrite Xen kernel support to use TryToFindKernelPath systematically.
  • mindi now copies also the /lib/firmware content in order to have it for drivers needing it (bnx2 reported)
  • Push MAX_STR_LEN to 512 to allow supporting more exclude dir (2.2.10 and dyn allocation is the way to go there)
  • Add virtio driver to mindi
  • Initialize extra_cdrom_params in any case tp avoid passing null to cdrecord later on
  • Also escapes white spaces in gen_aux_list to avoid issues in getfacl call
  • Adds multiple missing drivers to mindi (mega_sr, ide_gd_mod, pata_jmicron, cp210x, dca, raid6_pq, xor async_tx, async_memcpy, async_xor)
  • Fix #434 by really testing thet udevd is not running already (chucky)
  • Adds support of pata_sil680 driver
  • Fix again #412 !! by removing calls to tee which voids the return value of the previous command
  • The way grub.unsupported was called for opensuse 11.2 was wrong. It should be done bfore calling grub-install which also exists. And tested for existence. Now this should fix #412.
  • Try to provide a workaround in code to the #401 (over-allocation of space due to rounding errors)
  • Fix a bug when using ACLs and file with spaces in their names by adding double quotes in getfacl invocation (Tom Mortell tomm_at_dslextreme.com). Also adding the same quotes on the touch commands made earlier.
  • Points to the current latest presentation instead of the old one
  • mondo-ref-card added to the docs web page
  • Add the mondoarchive reference card (Lester Wade)
  • Change useless comments for more useful ones
  • mindi is now able to handle compressed kernel with .gz or .bz2 suffix (case of OpenSuSE 11.2)
  • Improves logging for external binary
  • Improve Xen kernel detection and avoid false detection (Michael Shapiro)
  • Updated P2V doc from Lester Wade (lester.wade_at_hp.com)

Baclports from 2.2.9
svn merge -r 2650:2695 svn+ssh://bruno@svn.mondorescue.org/mondo/svn/mondorescue/branches/2.2.9 .

  • Property svn:executable set to *
File size: 3.8 KB
Line 
1#!/usr/bin/perl -w
2#
3# $Id$
4#
5# Backup the hardware configuration on machine supporting it
6# (Bios configuration, Raid configuration, ...)
7#
8use strict;
9use File::Basename;
10
11# Handling Configuration files
12my $tool = "";
13my $tooldir = "";
14my $ret = 0;
15
16die "No CACHE_DIR parameter" if ((not defined $ARGV[0]) || (! -d $ARGV[0]));
17my $locbkpdir = "/bkphw";
18my $bkpdir = "$ARGV[0]$locbkpdir";
19die "No CONF_DIR parameter" if ((not defined $ARGV[1]) || (! -d $ARGV[1]));
20my $confdir = "$ARGV[1]";
21
22die "You need dmidecode for Hardware support\n" if (! -x "/usr/sbin/dmidecode");
23
24mkdir $bkpdir,0755 if (! -d $bkpdir) ;
25open(SYSTEM,"/usr/sbin/dmidecode -s 'system-product-name' 2> /dev/null |") || die "You need /usr/sbin/dmidecode for mindi hardware support";
26my $productname = <SYSTEM>;
27close(SYSTEM);
28
29die "ERROR: No product name found for Hardware support\n" if (not defined $productname);
30
31chomp($productname);
32if ($productname =~ /proliant/i) {
33 print "Detected a $productname. Nice. Continue to support my job :-)\n";
34 print "Activating Proliant support for mindi\n";
35 open(PROLIANT,"$confdir/proliant.files") || die "Unable to open $confdir/proliant.files";
36 open(TOOLS,"> $bkpdir/../tools.files") || die "Unable to open $bkpdir/../tools.files";
37 open(SCRIPT,"> $bkpdir/../mindi-rsthw") || die "Unable to open $bkpdir/../mindi-rsthw";
38 print SCRIPT << 'EOF';
39#!/bin/bash
40#
41# This script will restore potentially your HW configuration
42# on your system before partioning occurs
43# You may want to reboot after that step if you think that
44# resetting BIOS parameters to the value restored
45# may have an impact on you restoration process
46#
47# put dynamic libraries at an accessible place
48for l in /usr/local/lib/*; do
49 ln -sf $l /usr/lib
50done
51EOF
52 while($tool = <PROLIANT>) {
53 next if ($tool =~ /^#/);
54 chomp($tool);
55 $tooldir = dirname($tool);
56 if (! (-e $tool)) {
57 print "You should install the SmartStart Scripting toolkit tool $tool\nto benefit from mindi's enhanced hardware support\n";
58 print "Get it from http://www.hp.com/servers/sstoolkit\n";
59 next;
60 } else {
61 print "Found $tool, activating enhanced HP Proliant support in mindi\n";
62 print TOOLS "$tool\n";
63 }
64 if ($tool =~ /\/conrep$/) {
65 $ret = system("cd $tooldir ; $tool -s -f$bkpdir/conrep.dat");
66 print SCRIPT "(cd $tooldir ; $tool -l -f$locbkpdir/conrep.dat)\n";
67 print TOOLS "$tool.xml\n";
68 }
69 if ($tool =~ /\/.acuxebin$/) {
70 my $dir=basename($tool);
71 $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");
72 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";
73 print TOOLS "$tooldir/bld\n";
74 }
75 if ($tool =~ /\/.hpacucli$/) {
76 my $dir=basename($tool);
77 $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");
78 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";
79 print TOOLS "$tooldir/bld\n";
80 }
81 if ($tool =~ /\/hponcfg$/) {
82 $ret = system("$tool -w $bkpdir/hponcfg.dat");
83 print SCRIPT "$tool -r $locbkpdir/hponcfg.dat\n";
84 }
85 if ($tool =~ /\.scexe$/) {
86 print "Found $tool, that firmware will be applied at restore time on your HP Proliant\n";
87 print SCRIPT "./$tool\n";
88 }
89 if ($ret != 0) {
90 print "$tool returned an error. Hardware support may not be complete\n";
91 }
92 }
93 close(PROLIANT);
94 close(TOOLS);
95 close(SCRIPT);
96} else {
97 print "\nWARNING: No Hardware support for $productname.\nNot a big issue, just less features and risks ;-)\n";
98 print "You may ask your manufacturer to contribute to the mindi project\n";
99}
100rmdir $bkpdir if (-d $bkpdir) ;
Note: See TracBrowser for help on using the repository browser.