source: MondoRescue/branches/stable/mindi/mindi-bkphw@ 1467

Last change on this file since 1467 was 1467, checked in by Bruno Cornec, 17 years ago
  • QEMU on x86_64 should not use kqemu
  • bkphw documented and fixed (first step)
File size: 2.1 KB
Line 
1#!/usr/bin/perl -w
2#
3# Backup the hardware configuration on machine supporting it
4# (Bios configuration, Raid configuration, ...)
5#
6use strict;
7use AppConfig;
8
9# Handling Configuration files
10my $mindiconf=YYY
11my $file1 = "$mindiconf/mindi.conf.dist";
12my $file2 = "$mindiconf/mindi.conf";
13my $tool = "";
14my $ret = 0;
15
16my $config = AppConfig->new({
17 # Auto Create variables mentioned in Conf file
18 CREATE => 1,
19 DEBUG => 0,
20 GLOBAL => {
21 # Each conf item has one single parameter
22 ARGCOUNT => AppConfig::ARGCOUNT_ONE,
23 DEFAULT => '<undef>'
24 }
25 });
26$config->file($file1, $file2);
27
28open(SYSTEM,"dmidecode -s 'system-product-name' |") || die "You need dmidecode for mindi hardware support";
29my $productname = <SYSTEM>;
30close(SYSTEM);
31
32chomp($productname);
33if ($productname =~ /proliant/i) {
34 print "Detected an HP Hardware. Nice. Continue to support my job :-)\n";
35 print "Activating Proliant support for mindi\n";
36 open(PROLIANT,"$mindiconf/deplist.d/proliant.conf") || die "Unable to open $mindiconf/deplist.d/proliant.conf";
37 while($tool = <PROLIANT>) {
38 next if ($tool =~ /^#/);
39 chomp($tool);
40 if (! (-e $tool)) {
41 print "You should install the SmartStart Scripting toolkit tool $tool\nto benefit from mindi's enhanced hardware support\n";
42 print "Get it from http://www.hp.com/servers/sstoolkit\n";
43 next;
44 } else {
45 print "Found $tool, activating enhanced HP Proliant support in mindi\n";
46 }
47 if ($tool =~ /conrep/) {
48 $ret = system("$tool -s -f".$config->get("mindi_cache_dir")."/conrep.dat");
49 }
50 if ($tool =~ /cpqacuxe/) {
51 $ret = system("$tool -c ".$config->get("mindi_cache_dir")."/cpqacuxe.dat");
52 }
53 if ($tool =~ /hponcfg/) {
54 $ret = system("$tool -w ".$config->get("mindi_cache_dir")."/hponcfg.dat");
55 }
56 if ($ret != 0) {
57 print "$tool returned an error. Hardware support may not be complete\n";
58 }
59 }
60} else {
61 print "No Hardware support for $productname\n";
62 print "Ask your manufacturer to contribute to the mindi project\n";
63}
Note: See TracBrowser for help on using the repository browser.