diff options
| author | Rajarshi Das <drajarshi@in.ibm.com> | 2016-12-23 07:51:51 -0600 |
|---|---|---|
| committer | Rajarshi Das <drajarshi@in.ibm.com> | 2016-12-23 07:51:51 -0600 |
| commit | 46ca1e0eecc5d2fa2c3f45f507822d7988a543a0 (patch) | |
| tree | e6665c007be37805c78e76415820f5d08c6605d8 | |
| parent | 638c02952024d543fb1140d0ef53397618c93e67 (diff) | |
| download | ima-catalog-46ca1e0eecc5d2fa2c3f45f507822d7988a543a0.tar.gz ima-catalog-46ca1e0eecc5d2fa2c3f45f507822d7988a543a0.zip | |
Revert "Merge branch 'build_script_2'".
Older build.sh committed through 1st of 2 pull requests active.
This reverts commit 638c02952024d543fb1140d0ef53397618c93e67, reversing
changes made to d9a4c972ec5a49f9ba987a85874ab542c6c52fac.
| -rwxr-xr-x | build.sh | 128 |
1 files changed, 0 insertions, 128 deletions
diff --git a/build.sh b/build.sh deleted file mode 100755 index 03f9cd3..0000000 --- a/build.sh +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/bash -# -# Based on "openpower/capp-ucode" build.sh script. - -# -# #define PNOR_SUBPART_HEADER_SIZE 0x1000 -# struct pnor_hostboot_toc { -# be32 ec; -# be32 offset; /* from start of header. 4K aligned */ -# be32 size; /* */ -# }; -# #define PNOR_HOSTBOOT_TOC_MAX_ENTRIES ((PNOR_SUBPART_HEADER_SIZE - 8)/sizeof(struct pnor_hostboot_toc)) -# struct pnor_hostboot_header { -# char eyecatcher[4]; -# be32 version; -# struct pnor_hostboot_toc toc[PNOR_HOSTBOOT_TOC_MAX_ENTRIES]; -# }; - -# -# Two parameters are passed to this script -# 1)Path to host-tools -# 2)Platform to build -# - -declare -a ima_arr -declare -a ima_pvr -declare -a ima_file - -#Catalog files to pickup for a given platform -declare -a POWER8=('81E00610.4D0100.dts' '81E00610.4D0200.dts') -declare -a POWER8_PVR=(0x4d0100 0x4d0200) -declare -a POWER8_FILENAME=(0x4d0100.bin 0x4d0200.bin) - -declare -a POWER9=('81E00612.4E0100.dts') -declare -a POWER9_PVR=(0x4e0100) -declare -a POWER9_FILENAME=(0x4e0100.bin) - -align() { - echo $(( (($1 + ($alignment - 1))) & ~($alignment - 1) )) -} - -if [ "$2" == "POWER8" ]; then - ima_arr=("${POWER8[@]}") - ima_pvr=("${POWER8_PVR[@]}") - ima_file=("${POWER8_FILENAME[@]}") -elif [ "$2" == "POWER9" ]; then - ima_arr=("${POWER9[@]}") - ima_pvr=("${POWER9_PVR[@]}") - ima_file=("${POWER9_FILENAME[@]}") -fi - -entries=$((${#ima_arr[@]})) -debug=true -if [ -n "$DEBUG" ] ; then - debug=echo -fi - -#Generate the Device Tree Binary (DTB) files from DTS (text) -if [ $entries -gt 0 ]; then - for i in $(seq 0 $(($entries - 1)) ) ; do - $1/dtc -O dtb -I dts -o ${ima_file[${i}]} ${ima_arr[${i}]} - $1/xz -9 -C crc32 ${ima_file[${i}]} - mv ${ima_file[${i}]}.xz ${ima_file[${i}]} - - size=$( stat -c %s ${ima_file[${i}]} ) - pad=$(( 8000 - $(($size)))) - dd if=/dev/zero count=$pad bs=1 >> ${ima_file[${i}]} - done -fi - -#Create a tmp file for manipulation -TMPFILE=$(mktemp) - -EYECATCHER=$(( 0x494D4143 )) # ascii 'IMAC' -VERSION=1 -NUMBEROFTOCENTRIES=$entries - -printf "0: %.8x" $EYECATCHER | xxd -r -g0 >> $TMPFILE -printf "0: %.8x" $VERSION | xxd -r -g0 >> $TMPFILE - -sections=0 -alignment=$(( 0x1000 )) -offset=$alignment - - -for i in $(seq 0 $(($NUMBEROFTOCENTRIES - 1 ))) ; do - # Work out if we added this file already - matched=0 - for s in $(seq $sections); do - if cmp -s ${ima_file[$i]} ${sectionfile[$s]} ; then - $debug matched ${ima_file[$i]} ${sectionfile[$s]} - matched=1 - section=$s - break 1 - fi - done - if [ $matched == 0 ] ; then - sections=$(( $sections + 1 )) - sectionfile[$sections]=${ima_file[$i]} - sectionsize[$sections]=$( stat -c %s ${sectionfile[$sections]} ) - sectionoffset[$sections]=$(align $offset) - offset=$(( $offset + ${sectionsize[$sections]} )) - $debug Adding section ${ima_file[$i]} size: ${sectionsize[$sections]} offset: ${sectionoffset[$sections]} - section=$sections - fi - - # Add TOC entry for every PHB3 to - printf "0: %.8x" ${ima_pvr[$i]} | xxd -r -g0 >> $TMPFILE - printf "0: %.8x" ${sectionoffset[$section]} | xxd -r -g0 >> $TMPFILE - printf "0: %.8x" ${sectionsize[$section]} | xxd -r -g0 >> $TMPFILE -done - -# write zeros to alignment -bytes=$(( $alignment - 8 - ($NUMBEROFTOCENTRIES * 12) )) -dd if=/dev/zero count=$bytes bs=1 >> $TMPFILE - -# Add file sections -for i in $(seq $sections) ; do - cat ${sectionfile[$i]} >> $TMPFILE - - # write zeros to alignment - bytes=$(( $(align ${sectionsize[$i]}) - ${sectionsize[$i]} )) - dd if=/dev/zero count=$bytes bs=1 >> $TMPFILE -done - -mv $TMPFILE ima_catalog.bin -rm -rf $TMPFILE - |

