1 Star 0 Fork 0

Wangtake/brandy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
add_hash.sh 1.97 KB
一键复制 编辑 原始数据 按行查看 历史
Heweihong 提交于 2017-06-19 20:23 . r16 tina linux v2.1.2 release
#!/bin/bash
set -e
BUILD_FILE=u-boot.bin
BUILD_MODE=uboot
show_help()
{
printf "\n add_hash.sh - add git log hash value into uboot,boot0,sboot,fes \n"
echo " eg :"
echo " ./add_hash.sh -f input_file -m file_flag "
echo " file_flag = uboot or boot0 or sboot"
printf "\n\n"
}
build_uboot()
{
dd if=./${BUILD_FILE} of=./uboot_back bs=1280 count=1 status=noxfer 2> /dev/null
dd if=./cur.log of=./uboot_back ibs=64 conv=notrunc,sync oflag=append obs=64 count=1 status=noxfer 2> /dev/null
dd if=./${BUILD_FILE} of=./uboot_back ibs=1344 obs=1344 conv=notrunc oflag=append skip=1 status=noxfer 2> /dev/null
mv uboot_back ${BUILD_FILE}
}
build_boot0()
{
dd if=${BUILD_FILE} of=./boot0_back bs=760 count=1 status=noxfer 2> /dev/null
dd if=./cur.log of=./boot0_back ibs=64 conv=notrunc,sync oflag=append obs=64 count=1 status=noxfer 2> /dev/null
dd if=${BUILD_FILE} of=./boot0_back ibs=824 obs=824 conv=notrunc oflag=append skip=1 status=noxfer 2> /dev/null
mv boot0_back ${BUILD_FILE}
}
build_sboot()
{
dd if=${BUILD_FILE} of=./sboot_back bs=48 count=1 status=noxfer 2> /dev/null
dd if=./cur.log of=./sboot_back ibs=64 conv=notrunc,sync oflag=append obs=64 count=1 status=noxfer 2> /dev/null
dd if=${BUILD_FILE} of=./sboot_back ibs=112 obs=112 conv=notrunc oflag=append skip=1 status=noxfer 2> /dev/null
mv sboot_back ${BUILD_FILE}
}
do_common()
{
if [ -s ./cur.log ] ; then
if [ "x${BUILD_MODE}" = "xuboot" ] ; then
echo " build_uboot "
build_uboot
elif [ "x${BUILD_MODE}" = "xboot0" ] ; then
echo "build_boot0"
build_boot0
elif [ "x${BUILD_MODE}" = "xsboot" ] ; then
echo "build_sboot"
build_sboot
else
echo "build none"
fi
else
echo "not set commit log"
fi
}
while getopts f:m: OPTION
do
case $OPTION in
f)
BUILD_FILE=$OPTARG
;;
m)
BUILD_MODE=$OPTARG
;;
*)
show_help
exit
;;
esac
done
do_common
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangtake/brandy.git
git@gitee.com:wangtake/brandy.git
wangtake
brandy
brandy
r16-v2.1.y

搜索帮助