diff options
author | Deepak Kodihalli <dkodihal@in.ibm.com> | 2017-02-07 12:14:55 -0600 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-02-14 16:34:01 +0000 |
commit | 6225e93d37644774aaecc30cb0161d0eaf0f570d (patch) | |
tree | 1a57b04c2b0d0fa53e7e2c32d642008d4523e3d4 /gen_ipmi_fru.pl | |
parent | e3e0b720a06ed8fa8bfec834d597d2010412fbe7 (diff) | |
download | phosphor-mrw-tools-6225e93d37644774aaecc30cb0161d0eaf0f570d.tar.gz phosphor-mrw-tools-6225e93d37644774aaecc30cb0161d0eaf0f570d.zip |
gen_openpower_fru.pl : Fetch inventory paths
In preparation for the openpower-vpd-parser recipe, this script will,
from an input openpower vpd-config YAML file, determine which
inventory objects we're interested in, and will fetch from the MRW
pathnames these objects should have.
The script will output a file in a format that can serve as an
environment file for a systemd service, which in turn will launch the
openpower-vpd-parser application with this information.
Change-Id: I7c4fa70af002f63bd5501093802c1d41bd503e88
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Diffstat (limited to 'gen_ipmi_fru.pl')
-rwxr-xr-x | gen_ipmi_fru.pl | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/gen_ipmi_fru.pl b/gen_ipmi_fru.pl index 99884d9..5465d84 100755 --- a/gen_ipmi_fru.pl +++ b/gen_ipmi_fru.pl @@ -4,6 +4,7 @@ use warnings; use mrw::Targets; use mrw::Inventory; +use mrw::Util; use Getopt::Long; # For parsing command line arguments use YAML::Tiny qw(LoadFile); @@ -106,7 +107,7 @@ for my $item (@inventory) { printDebug(" ".$child); printDebug(" Type:".$fruType ); - my $childObmcName = getObmcName(\@inventory, $child); + my $childObmcName = Util::getObmcName(\@inventory, $child); writeToFile($fruType, $childObmcName, $fruTypeConfig, $fh); } } @@ -114,22 +115,6 @@ close $fh; #------------------------------------END OF MAIN----------------------- -# Map an MRW name to corresponding OBMC name -sub getObmcName -{ - my $inventory = $_[0]; # Inventory items - my $target = $_[1]; # MRW Target name - for my $item (@inventory) - { - if($item->{TARGET} eq $target) - { - return $item->{OBMC_NAME}; - } - } - return undef; -} - - #Get the metdata for the incoming frutype from the loaded config file. #Write the FRU data into the output file |