summaryrefslogtreecommitdiffstats
path: root/Util.pm
diff options
context:
space:
mode:
authorDeepak Kodihalli <dkodihal@in.ibm.com>2017-02-07 12:14:55 -0600
committerPatrick Williams <patrick@stwcx.xyz>2017-02-14 16:34:01 +0000
commit6225e93d37644774aaecc30cb0161d0eaf0f570d (patch)
tree1a57b04c2b0d0fa53e7e2c32d642008d4523e3d4 /Util.pm
parente3e0b720a06ed8fa8bfec834d597d2010412fbe7 (diff)
downloadphosphor-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 'Util.pm')
-rw-r--r--Util.pm23
1 files changed, 23 insertions, 0 deletions
diff --git a/Util.pm b/Util.pm
index d85726a..aa98b56 100644
--- a/Util.pm
+++ b/Util.pm
@@ -43,6 +43,24 @@ sub getChildUnitsWithTargetType
return @units;
}
+# Returns OBMC name corresponding to a Target name
+# param[in] \@inventory = reference to array of inventory items
+# param[in] $targetName = A Target name
+sub getObmcName
+{
+ my ($inventory_ref, $targetName) = @_;
+ my @inventory = @{ $inventory_ref };
+
+ for my $item (@inventory)
+ {
+ if($item->{TARGET} eq $targetName)
+ {
+ return $item->{OBMC_NAME};
+ }
+ }
+ return undef;
+}
+
1;
=head1 NAME
@@ -67,6 +85,11 @@ it will die. Currently supports single BMC systems.
Returns an array of targets that have target-type C<TargetType>
and are children (any level) of target C<ChipTarget>.
+=item getObmcName(C<InventoryItems>, C<TargetName>)
+
+Returns an OBMC name corresponding to a Target name. Returns
+undef if the Target name is not found.
+
=back
=cut
OpenPOWER on IntegriCloud