【Tiny4412】Tiny4412烧写uboot脚本分析
生活随笔
收集整理的這篇文章主要介紹了
【Tiny4412】Tiny4412烧写uboot脚本分析
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
00. 目錄
文章目錄
- 00. 目錄
- 01. sd_fusing.sh腳本分析
- 02. 附錄
01. sd_fusing.sh腳本分析
# # Copyright (C) 2011 Samsung Electronics Co., Ltd. # http://www.samsung.com/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # #####################################./sd_fusing.sh /dev/sdb #-z 判斷參數(shù)是否為空 if [ -z $1 ] thenecho "usage: ./sd_fusing.sh <SD Reader's device file>"exit 0 fi#-b 判斷傳遞的第一個參數(shù)是否為塊設(shè)備 if [ -b $1 ] thenecho "$1 reader is identified." elseecho "$1 is NOT identified."exit 0 fi#################################### #<verify device> #basename /dev/sdb ---> sdb BDEV_NAME=`basename $1` #獲取磁盤的大小 BDEV_SIZE=`cat /sys/block/${BDEV_NAME}/size`#表示沒有插入SD卡 if [ ${BDEV_SIZE} -le 0 ]; thenecho "Error: NO media found in card reader."exit 1 fi#SD卡的大小不能超過32000000 if [ ${BDEV_SIZE} -gt 32000000 ]; thenecho "Error: Block device size (${BDEV_SIZE}) is too large"exit 1 fi#################################### # check files#u-boot.bin的文件 E4412_UBOOT=../../u-boot.bin #工具 MKBL2=../mkbl2#判斷u-boot.bin是否存在 if [ ! -f ${E4412_UBOOT} ]; thenecho "Error: u-boot.bin NOT found, please build it & try again."exit -1 fi#判斷mkbl2工具是否存在 if [ ! -f ${MKBL2} ]; thenecho "Error: can not find host tool - mkbl2, stop."exit -1 fi#生成bl2 #<make bl2> ${MKBL2} ${E4412_UBOOT} bl2.bin 14336#################################### # fusing imagessigned_bl1_position=1 bl2_position=17 uboot_position=49 tzsw_position=705#燒寫bl1 #<BL1 fusing> echo "---------------------------------------" echo "BL1 fusing" #dsync表示同步 dd iflag=dsync oflag=dsync if=./E4412_N.bl1.bin of=$1 seek=$signed_bl1_position#燒寫bl2 #<BL2 fusing> echo "---------------------------------------" echo "BL2 fusing" #dsync表示同步 dd iflag=dsync oflag=dsync if=./bl2.bin of=$1 seek=$bl2_position#燒寫uboot #<u-boot fusing> echo "---------------------------------------" echo "u-boot fusing" dd iflag=dsync oflag=dsync if=${E4412_UBOOT} of=$1 seek=$uboot_position#燒寫信任區(qū)域 #<TrustZone S/W fusing> echo "---------------------------------------" echo "TrustZone S/W fusing" dd iflag=dsync oflag=dsync if=./E4412_tzsw.bin of=$1 seek=$tzsw_position#同步 #<flush to disk> sync#################################### #<Message Display> echo "---------------------------------------" echo "U-boot image is fused successfully." echo "Eject SD card and insert it again."02. 附錄
sd_fusing.sh在uboot目錄中。
總結(jié)
以上是生活随笔為你收集整理的【Tiny4412】Tiny4412烧写uboot脚本分析的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【Tiny4412】Tiny4412编译
- 下一篇: 【Tiny4412】设置Uboot提示符