diff options
author | Elizabeth Liner <eliner@us.ibm.com> | 2017-05-11 14:34:44 -0500 |
---|---|---|
committer | Elizabeth Liner <eliner@us.ibm.com> | 2017-05-17 21:41:50 -0500 |
commit | a8ecafe9922ffbefdce940e5ecdd1fdb85046eca (patch) | |
tree | bff5895892cc968ed43a0f5325273063764c1dde /update_image.pl | |
parent | 86474de814334341cc6146174b6aee9afe0e5547 (diff) | |
download | pnor-a8ecafe9922ffbefdce940e5ecdd1fdb85046eca.tar.gz pnor-a8ecafe9922ffbefdce940e5ecdd1fdb85046eca.zip |
Adding WOFDATA support for the actual image
Diffstat (limited to 'update_image.pl')
-rwxr-xr-x | update_image.pl | 17 |
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"); } |