From 814f44ddaa4614172ffdc41d297291cc08be31ab Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Thu, 27 Feb 2014 17:37:30 -0600 Subject: Speed up buildpnor. Change-Id: Id213a80e01e8a4a05e5cbe7c619393cfc1a9e1c7 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/9224 Tested-by: Jenkins Server Reviewed-by: STEPHEN M. CPREK Reviewed-by: A. Patrick Williams III --- src/build/buildpnor/buildpnor.pl | 17 ++++++++++++++--- src/build/mkrules/hbfw/img/makefile | 18 +++++++++--------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/build/buildpnor/buildpnor.pl b/src/build/buildpnor/buildpnor.pl index a476f5d8c..0f89bc2c5 100755 --- a/src/build/buildpnor/buildpnor.pl +++ b/src/build/buildpnor/buildpnor.pl @@ -6,7 +6,7 @@ # # IBM CONFIDENTIAL # -# COPYRIGHT International Business Machines Corp. 2012,2013 +# COPYRIGHT International Business Machines Corp. 2012,2014 # # p1 # @@ -33,7 +33,18 @@ use strict; use XML::Simple; use Data::Dumper; use File::Basename; -use Digest::SHA1; + +# Digest::SHA1 module is now Digest::SHA in newer version of perl. Need to +# do the below eval blocks to support both modules. +BEGIN +{ + eval "use Digest::SHA;"; + if ($@) + { + eval "use Digest::SHA1;"; + die $@ if $@; + } +} ################################################################################ # Set PREFERRED_PARSER to XML::Parser. Otherwise it uses XML::SAX which contains @@ -567,7 +578,7 @@ sub fillPnorImage #fcp --target tuleta.pnor --partition-offset 0 --name HBI --write hostboot_extended.bin if ($g_ffsCmd eq "") { - my $Out = `$g_fcpCmd $inputFile $i_pnorBinName:$eyeCatch --offset $offset --write`; + my $Out = `$g_fcpCmd $inputFile $i_pnorBinName:$eyeCatch --offset $offset --write --buffer 0x40000000`; } else { my $Out = `$g_ffsCmd --target $i_pnorBinName --partition-offset $offset --name $eyeCatch --write $inputFile`; } diff --git a/src/build/mkrules/hbfw/img/makefile b/src/build/mkrules/hbfw/img/makefile index 021493ad4..a680cf4cf 100755 --- a/src/build/mkrules/hbfw/img/makefile +++ b/src/build/mkrules/hbfw/img/makefile @@ -98,7 +98,7 @@ cp_hbfiles: .SPECTARG echo -en VERSION\\0 > ${BASE_SHA_IMAGE} sha512sum ${BASE_IMAGE} | awk '{print $$1}' | xxd -pr -r >> ${BASE_SHA_IMAGE} dd if=${BASE_SHA_IMAGE} of=secureboot.header ibs=4k conv=sync - dd if=/dev/zero of=hbb.footer bs=1 count=128K + dd if=/dev/zero of=hbb.footer count=1 bs=128K cat sbe.header secureboot.header ${BASE_IMAGE} hbb.footer > hostboot.stage.bin head -c 524288 hostboot.stage.bin > ${BASE_W_HEADER_IMAGE} currentsb -chain @@ -124,28 +124,28 @@ cp_hbfiles: .SPECTARG dd if=${TEMP_IMAGE} of=${EXT_HEADER_IMAGE} ibs=5120k conv=sync ecc --inject ${EXT_HEADER_IMAGE} --output ${EXT_ECC_HEADER_IMAGE} --p8 # create data for a test partition in pnor - dd if=/dev/urandom of=${TESTDATA} bs=1 count=28K + dd if=/dev/urandom of=${TESTDATA} count=1 bs=28K ecc --inject ${TESTDATA} --output ${TESTDATA_ECC} --p8 # Fill the following partitions with FF's and then ECC them - dd if=/dev/zero count=128K bs=1 | tr "\000" "\377" > ${TEMP_IMAGE} + dd if=/dev/zero bs=128K count=1 | tr "\000" "\377" > ${TEMP_IMAGE} ecc --inject ${TEMP_IMAGE} --output ${HBEL_ECC_IMAGE} --p8 # GUARD partition - dd if=/dev/zero count=16K bs=1 | tr "\000" "\377" > ${TEMP_IMAGE} + dd if=/dev/zero bs=16K count=1 | tr "\000" "\377" > ${TEMP_IMAGE} ecc --inject ${TEMP_IMAGE} --output ${GUARD_ECC_IMAGE} --p8 # GLOBAL partition - dd if=/dev/zero count=32K bs=1 | tr "\000" "\377" > ${TEMP_IMAGE} + dd if=/dev/zero bs=32K count=1 | tr "\000" "\377" > ${TEMP_IMAGE} ecc --inject ${TEMP_IMAGE} --output ${GLOBAL_ECC_IMAGE} --p8 # DJVPD partition - dd if=/dev/zero count=256K bs=1 | tr "\000" "\377" > ${TEMP_IMAGE} + dd if=/dev/zero bs=256K count=1 | tr "\000" "\377" > ${TEMP_IMAGE} ecc --inject ${TEMP_IMAGE} --output ${DJVPD_ECC_IMAGE} --p8 # MVPD partition - dd if=/dev/zero count=512K bs=1 | tr "\000" "\377" > ${TEMP_IMAGE} + dd if=/dev/zero bs=512K count=1 | tr "\000" "\377" > ${TEMP_IMAGE} ecc --inject ${TEMP_IMAGE} --output ${MVPD_ECC_IMAGE} --p8 # CVPD partition - dd if=/dev/zero count=256K bs=1 | tr "\000" "\377" > ${TEMP_IMAGE} + dd if=/dev/zero bs=256K count=1 | tr "\000" "\377" > ${TEMP_IMAGE} ecc --inject ${TEMP_IMAGE} --output ${CVPD_ECC_IMAGE} --p8 # PAYLOAD partition - dd if=/dev/zero count=20480K bs=1 | tr "\000" "\377" > ${TEMP_IMAGE} + dd if=/dev/zero bs=20480K count=1 | tr "\000" "\377" > ${TEMP_IMAGE} ecc --inject ${TEMP_IMAGE} --output ${PAYLOAD_ECC_IMAGE} --p8 rm ${TEMP_IMAGE} -- cgit v1.2.1