HP Insight Control server provisioning Adding Drivers to OS Build Plans

8
warn ($help_info);
exit 0;
}
die ("Invalid parameter! \n" . $help_info) unless ($#ARGV == 0);
$file = $ARGV[0];
$module=basename($file,".ko");
open(MODINFO, "modinfo $file |" );
my @pci;
while (<MODINFO>) {
if (/description:\s+(.*)$/) {
$description = $1;
next;
}
if (/alias:\s+pci:v.{4}(....).{5}(....)/) {
push @pci, "0x" . lc($1) . "\t0x" .lc($2) .
"\t\"$module\"\t" . "\"$description\"";
next;
}
if (/depends:\s+(.*)\s*$/) {
if (length $1) {
push @depends, $1;
next;
}
}
}
close MODINFO;
# Now write out the files
print "Writing $outputDir/pcitable..\n";
open PCI, "> $outputDir/pcitable" or die $!;
foreach (@pci) {
print PCI "$_\n";
}
close PCI;
print "Writing $outputDir/modules.dep..\n";
open DEP, "> $outputDir/modules.dep" or die $!;
if (@depends > 0) {
print Dumper(@depends);
print DEP "$module: ";
foreach (@depends) {
print DEP "$_ ";
}
print DEP "\n";
}
close DEP;
### Static hash of driver types
%modType = ( "be2iscsi", "scsi",
"be2net", "eth",
"bnx2", "eth",
"bnx2i", "scsi",
"bnx2x", "eth",
"cciss", "scsi",
"e1000", "eth",
"e1000e", "eth",
"hpahcisr", "scsi",
"hpvsa", "scsi",