IPMI Parser Script Updates

This commit adds a new option to the IPMI MRW
parsing scripts (--skip-broken-mrw).

When specified, the option will cause the scripts
to ignore broken MRW targets such as IPMI sensor
targets without a valid SENSOR_ID attribute
or a FRU without a valid FRU_ID.

This allows us to pull in an in-progress MRW without
it breaking our builds.

Tested:
I tested the scripts against an incomplete MRW and made
sure that the scripts ignored broken targets and generated
output config files for whatever targets were valid.

Signed-off-by: Santosh Puranik <santosh.puranik@in.ibm.com>
Change-Id: Ibf2ca3769e6030d62e73fb362d73a775433273bc
diff --git a/gen_ipmi_fru.pl b/gen_ipmi_fru.pl
index dab5e41..1f13584 100644
--- a/gen_ipmi_fru.pl
+++ b/gen_ipmi_fru.pl
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#!/usr/bin/perl
 use strict;
 use warnings;
 
@@ -12,12 +12,14 @@
 my $debug           = 0;
 my $outputFile     = "";
 my $metaDataFile   = "";
+my $skipBrokenMrw  = 0;
 
 # Command line argument parsing
 GetOptions(
 "i=s" => \$serverwizFile,    # string
 "m=s" => \$metaDataFile,     # string
 "o=s" => \$outputFile,       # string
+"skip-broken-mrw" => \$skipBrokenMrw,
 "d"   => \$debug,
 )
 or printUsage();
@@ -67,6 +69,10 @@
     #1) If not fru
     #2) if the fru type is not there in the config file.
     #3) if the fru type is in associated types.
+    #4) if FRU_ID is not defined for the target and we are asked to ignore such
+    #   targets.
+
+    next if ($skipBrokenMrw and ($fruID eq ""));
 
     next if (not $isFru or not exists $types{$fruType} or exists $allAssoTypesHash{$fruType});
 
@@ -173,6 +179,7 @@
     $0 -i [MRW filename] -m [MetaData filename] -o [Output filename] [OPTIONS]
 Options:
     -d = debug mode
+    --skip-broken-mrw = Skip broken MRW targets
         \n";
     exit(1);
 }