summaryrefslogtreecommitdiffstats
path: root/src/build/buildpnor/PnorUtils.pm
diff options
context:
space:
mode:
authorLuis Fernandez <Luis.Fernandez@ibm.com>2019-10-18 15:53:23 -0500
committerDaniel M Crowell <dcrowell@us.ibm.com>2019-10-29 11:27:59 -0500
commit5dd26a01eed5ee4c177c83fe0d811ffbde902a37 (patch)
tree28028ff9cf354d29466652f6d79f7dd17b7f76ed /src/build/buildpnor/PnorUtils.pm
parentf41f71705385741c2b3e63412796e741ef44c55a (diff)
downloadtalos-hostboot-5dd26a01eed5ee4c177c83fe0d811ffbde902a37.tar.gz
talos-hostboot-5dd26a01eed5ee4c177c83fe0d811ffbde902a37.zip
New Optional Argument to PnorUtils.pm’s loadPnorLayout
New Optional Argument to PnorUtils.pm’s loadPnorLayout to declare where to place the newly created layout file. If argument is not given, file will not be saved. Edited scripts and makefiles that use this function. Change-Id: I7b9ee0f7ad33ad88be58598ddf594765eabe29ea Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/85916 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E Bofferding <bofferdn@us.ibm.com> Reviewed-by: Christian R Geddes <crgeddes@us.ibm.com> Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com> Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/build/buildpnor/PnorUtils.pm')
-rw-r--r--src/build/buildpnor/PnorUtils.pm33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/build/buildpnor/PnorUtils.pm b/src/build/buildpnor/PnorUtils.pm
index 7011910f9..c889893e2 100644
--- a/src/build/buildpnor/PnorUtils.pm
+++ b/src/build/buildpnor/PnorUtils.pm
@@ -54,7 +54,8 @@ use constant PAGE_SIZE => 4096;
################################################################################
sub loadPnorLayout
{
- my ($i_pnorFile, $i_pnorLayoutRef, $i_physicalOffsets, $i_testRun) = @_;
+ my ($i_pnorFile, $i_pnorLayoutRef, $i_physicalOffsets, $i_testRun,
+ $i_outputLayoutLocation) = @_;
my $this_func = (caller(0))[3];
unless(-e $i_pnorFile)
@@ -255,21 +256,25 @@ sub loadPnorLayout
checkForOverlap($i_pnorLayoutRef);
}
- # write xml with offsets to new file
- my $filename = basename($i_pnorFile, ".xml");
- $filename = "${filename}WithOffsets.xml";
-
- # writing to new file with error handling
- eval
+ # Write xml with offsets to new file if $i_outputLayoutLocation
+ # argument is supplied
+ if (defined $i_outputLayoutLocation && $i_outputLayoutLocation ne "")
{
- print XMLout($xml, RootName => "pnor", OutputFile => $filename);
- 1;
+ my $filename = basename($i_pnorFile, ".xml");
+ $filename = "${i_outputLayoutLocation}/${filename}WithOffsets.xml";
+
+ # writing to new file with error handling
+ eval
+ {
+ print XMLout($xml, RootName => "pnor", OutputFile => $filename);
+ 1;
+ }
+ or do
+ {
+ my $err = $@;
+ die "ERROR: $this_func: Failed to create new XML file with corrected offsets, error = $err";
+ };
}
- or do
- {
- my $err = $@;
- die "ERROR: $this_func: Failed to create new XML file with corrected offsets, error = $err";
- };
return 0;
}
OpenPOWER on IntegriCloud