summaryrefslogtreecommitdiffstats
path: root/update_image.pl
diff options
context:
space:
mode:
Diffstat (limited to 'update_image.pl')
-rwxr-xr-xupdate_image.pl17
1 files changed, 15 insertions, 2 deletions
diff --git a/update_image.pl b/update_image.pl
index 3bf3671..d4eb12b 100755
--- a/update_image.pl
+++ b/update_image.pl
@@ -22,6 +22,7 @@ my $ima_catalog_binary_filename = "";
my $openpower_version_filename = "";
my $payload = "";
my $xz_compression = 0;
+my $wof_binary_filename = "";
while (@ARGV > 0){
$_ = $ARGV[0];
@@ -98,6 +99,11 @@ while (@ARGV > 0){
elsif (/^-xz_compression/i){
$xz_compression = 1;
}
+ elsif (/^-wof_binary_filename/i){
+ #This filename is necessary if the file exists, but if it's not given, we add a blank partition
+ $wof_binary_filename = $ARGV[1];
+ shift;
+ }
else {
print "Unrecognized command line arg: $_ \n";
#print "To view all the options and help text run \'$program_name -h\' \n";
@@ -264,8 +270,15 @@ else
run_command("ecc --inject $scratch_dir/hostboot.temp.bin --output $scratch_dir/ima_catalog.bin.ecc --p8");
-#Create blank binary file for WOF/VFRT (WOFDATA) Partition (for now)
-if ($release eq "p9") {
+#Encode ECC into WOF/VFRT (WOFDATA) Partition
+if ($release eq "p9" && -e $wof_binary_filename) {
+ run_command("dd if=$wof_binary_filename > $scratch_dir/hostboot.temp.bin");
+ run_command("ecc --inject $scratch_dir/hostboot.temp.bin --output $scratch_dir/wofdata.bin.ecc");
+}
+#Print error and blank binary if wof file does not exist
+elsif ($release eq "p9")
+{
+ print "ERROR: WOFDATA partition is not found, including blank binary instead\n";
run_command("dd if=/dev/zero bs=2730K count=1 | tr \"\\000\" \"\\377\" > $scratch_dir/hostboot.temp.bin");
run_command("ecc --inject $scratch_dir/hostboot.temp.bin --output $scratch_dir/wofdata.bin.ecc --p8");
}
OpenPOWER on IntegriCloud