itop4412 uboot 學習詳細記錄三丶Exynos4412 編譯指令碼build_uboot.sh分析)
阿新 • • 發佈:2019-02-10
#!/bin/sh
option1="tc4_ubuntu" //編譯選項sec_path="../CodeSign4SecureBoot/" //安全檔案目錄名
CPU_JOB_NUM=$(grep processor /proc/cpuinfo | awk '{field=$NF};END{print field+1}') //cpu核心數
ROOT_DIR=$(pwd) //編譯環境根目錄
CUR_DIR=${ROOT_DIR##*/} //當前目錄
case "$1" in //判斷傳進來的引數1
clean) //如果是clean
echo make clean
make mrproper //執行清理
;;
*) //如果不是clean
if [ ! -d $sec_path ] //如果安全目錄名不是一個目錄
then
echo "**********************************************"
echo "[ERR]please get the CodeSign4SecureBoot first"
echo "**********************************************"
return
fi
#make itop_4412_android_config //該行已註釋掉
if [ -z $1 ] //引數1如果長度為0,即如果沒有引數1
then
make itop_4412_android_config
elif [ $1 = $option1 ] //如果引數1是tc4_ubuntu
then
make itop_4412_android_ubuntu_config
else
make itop_4412_android_config
fi
make -j$CPU_JOB_NUM
if [ ! -f checksum_bl2_14k.bin ] //如果checksum_bl2_14k.bin不是一個普通檔案
then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "There are some error(s) while building uboot, please use command make to check."
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 0
fi
cp -rf checksum_bl2_14k.bin $sec_path //將checksum_bl2_14k.bin複製到安全目錄
cp -rf u-boot.bin $sec_path //將生成的uboot.bin複製到安全目錄
rm checksum_bl2_14k.bin //刪除checksum_bl2_14k.bin
cd $sec_path //進入安全目錄
#./codesigner_v21 -v2.1 checksum_bl2_14k.bin BL2.bin.signed.4412 Exynos4412_V21.prv -STAGE2 //該行已註釋
# gernerate the uboot bin file support trust zone
cat E4412.S.BL1.SSCR.EVT1.1.bin E4412.BL2.TZ.SSCR.EVT1.1.bin all00_padding.bin u-boot.bin E4412.TZ.SSCR.EVT1.1.bin > u-boot-iTOP-4412.bin
mv u-boot-iTOP-4412.bin $ROOT_DIR //將u-boot-iTOP-4412.bin移動到編譯根目錄
rm checksum_bl2_14k.bin //刪除checksum_bl2_14k.bin
#rm BL2.bin.signed.4412 //該行已註釋掉
rm u-boot.bin //刪除u-boot.bin
echo
echo
;;
esac