1*4882a593Smuzhiyun#!/bin/sh 2*4882a593Smuzhiyun 3*4882a593SmuzhiyunBOARD_DIR="$(dirname $0)" 4*4882a593SmuzhiyunGENIMAGE_CFG="${BOARD_DIR}/genimage.cfg" 5*4882a593SmuzhiyunGENIMAGE_TMP="${BUILD_DIR}/genimage.tmp" 6*4882a593Smuzhiyun 7*4882a593Smuzhiyuncp ${BOARD_DIR}/boot.ini ${BINARIES_DIR}/ 8*4882a593Smuzhiyun 9*4882a593Smuzhiyun# The bl1.bin.hardkernel file provided by the uboot hardkernel repository is overwritten 10*4882a593Smuzhiyun# by the bl2.bin.hardkernel in the sd_fusing.sh script because it is too big. 11*4882a593Smuzhiyun# In order to implement this in genimage, we need to truncate the bl1.bin file 12*4882a593Smuzhiyun# so that it does not exceed the available place. 13*4882a593Smuzhiyun# An issue has been filled about this: https://github.com/hardkernel/u-boot/issues/45 14*4882a593Smuzhiyuntruncate -s 15360 ${BINARIES_DIR}/bl1.bin.hardkernel 15*4882a593Smuzhiyun 16*4882a593Smuzhiyunrm -rf "${GENIMAGE_TMP}" 17*4882a593Smuzhiyun 18*4882a593Smuzhiyungenimage \ 19*4882a593Smuzhiyun --rootpath "${TARGET_DIR}" \ 20*4882a593Smuzhiyun --tmppath "${GENIMAGE_TMP}" \ 21*4882a593Smuzhiyun --inputpath "${BINARIES_DIR}" \ 22*4882a593Smuzhiyun --outputpath "${BINARIES_DIR}" \ 23*4882a593Smuzhiyun --config "${GENIMAGE_CFG}" 24*4882a593Smuzhiyun 25