Create gen_settings.pl

Created gen_settings.pl, to be used to get settings boundary and
default values like OPEN_POWER_N_PLUS_ONE_BULK_POWER_LIMIT_WATTS
from the MRW. Just the base commit for gen_settings.pl, more to
come.

Change-Id: Iea68db8e588c114fa600c0d3e87f4d763f783c01
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/Build.PL b/Build.PL
old mode 100644
new mode 100755
index 1db4367..eee4b60
--- a/Build.PL
+++ b/Build.PL
@@ -15,6 +15,7 @@
                      'gen_openpower_fru.pl',
                      'gen_presence_yaml.pl',
                      'gen_occ_map.pl',
+                     'gen_settings.pl',
                      'hwmon.pl'],
     pm_files => {'Inventory.pm' => 'lib/mrw/Inventory.pm',
                  'Util.pm' => 'lib/mrw/Util.pm'},
diff --git a/gen_settings.pl b/gen_settings.pl
new file mode 100755
index 0000000..06794ff
--- /dev/null
+++ b/gen_settings.pl
@@ -0,0 +1,56 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+use mrw::Targets; # Set of APIs allowing access to parsed ServerWiz2 XML output
+use Getopt::Long; # For parsing command line arguments
+
+# Globals
+my $force           = 0;
+my $serverwizFile  = "";
+my $debug           = 0;
+my $outputFile     = "";
+
+# Command line argument parsing
+GetOptions(
+"f"   => \$force,            # numeric
+"i=s" => \$serverwizFile,    # string
+"o=s" => \$outputFile,       # string
+"d"   => \$debug,
+)
+or printUsage();
+
+if (($serverwizFile eq "") or ($outputFile eq ""))
+{
+    printUsage();
+}
+
+# API used to access parsed XML data
+my $targetObj = Targets->new;
+if($debug == 1)
+{
+    $targetObj->{debug} = 1;
+}
+
+if($force == 1)
+{
+    $targetObj->{force} = 1;
+}
+
+$targetObj->loadXML($serverwizFile);
+print "Loaded MRW XML: $serverwizFile \n";
+
+# Usage
+sub printUsage
+{
+    print "
+    $0 -i [XML filename] -o [Output filename] [OPTIONS]
+Options:
+    -f = force output file creation even when errors
+    -d = debug mode
+
+PS: mrw::Targets can be found in https://github.com/open-power/serverwiz/
+    mrw::Inventory can be found in https://github.com/openbmc/phosphor-mrw-tools/
+    \n";
+    exit(1);
+}