您的位置:首页 > 产品设计 > UI/UE

itop4412 uboot 学习详细记录三丶Exynos4412 编译脚本build_uboot.sh分析)

2017-12-06 14:44 507 查看
#!/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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息