很久以前使用的編譯並燒錄uboot的腳本,最後一個應該不是我寫的。
#!/bin/sh
#build.sh
set -e
CPU_NUM=$(grep processor /proc/cpuinfo | awk '{field=$NF};END{print field+1}')
ROOT_DIR=$PWD
U_BOOT_DIR=$ROOT_DIR/u-boot-2013.01
SEC_DIR=$ROOT_DIR/CodeSign4SecureBoot
SDQ_DIR=$ROOT_DIR/sdfuse_q
export ARCH=arm
export CROSS_COMPILE=/opt/arm-linux-gcc-4.6.4/bin/arm-linux-
cd $U_BOOT_DIR
case "$1" in
clean)
echo make clean
make mrproper
rm -rf $U_BOOT_DIR/CodeSign4SecureBoot
rm -rf $U_BOOT_DIR/sdfuse_q
;;
tags)
echo $PWD
ctags -R *
;;
config)
if [ ! -d $SEC_DIR ] ; then
echo "**********************************************"
echo "[ERR]please get the CodeSign4SecureBoot first"
echo "**********************************************"
exit 0
elif [ ! -d $SDQ_DIR ] ; then
echo "**********************************************"
echo "[ERR]please get the sdfuse_q first"
echo "**********************************************"
exit 0
fi
cp -a $SEC_DIR $U_BOOT_DIR
cp -a $SDQ_DIR $U_BOOT_DIR
make origen_config
;;
*)
make -j$CPU_NUM
split -b 14336 u-boot.bin bl2
make -C $U_BOOT_DIR/sdfuse_q
$U_BOOT_DIR/sdfuse_q/chksum
$U_BOOT_DIR/sdfuse_q/add_padding
rm bl2a*
if [ ! -f 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 $U_BOOT_DIR/CodeSign4SecureBoot
cp -rf u-boot.bin $U_BOOT_DIR/CodeSign4SecureBoot
rm checksum_bl2_14k.bin
cd $U_BOOT_DIR/CodeSign4SecureBoot
cat E4412_N.bl1.SCP2G.bin bl2.bin all00_padding.bin u-boot.bin tzsw_SMDK4412_SCP_2GB.bin > u-boot-4412.bin
cp -a u-boot-4412.bin /home/tftpdir
mv u-boot-4412.bin $ROOT_DIR/mk_sdboot
rm checksum_bl2_14k.bin
rm u-boot.bin
echo
echo
;;
esac
#!/bin/bash
#
# This script will create a u-boot binary for movinand/mmc boot
#
#mkuboot.sh
echo "Fuse 4412 trustzone uboot file into SD card"
if [ -z $1 ]
then
./sd_fusing_exynos4x12.sh /dev/sdb u-boot-4412.bin
else
./sd_fusing_exynos4x12.sh $1 u-boot-4412.bin
fi
#!/bin/sh
#
# Copyright (C) 2010 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_fuse_exynos4x12.sh
reader_type1="/dev/sd"
reader_type2="/dev/mmcblk0"
if [ -z $2 ]
then
echo "usage: ./sd_fusing.sh <SD Reader's device file> <filename>"
exit 0
fi
param1=`echo "$1" | awk '{print substr($1,1,7)}'`
if [ "$param1" = "$reader_type1" ]
then
partition=$1"1"
elif [ "$1" = "$reader_type2" ]
then
partition=$1"p1"
else
echo "Unsupported SD reader"
exit 0
fi
if [ -b $1 ]
then
echo "$1 reader is identified."
else
echo "$1 is NOT identified."
exit 0
fi
####################################
echo "----------------------------------"
echo $partition
echo "----------------------------------"
# format
umount $partition 2> /dev/null
echo "$2 fusing..."
dd iflag=dsync oflag=dsync if=./$2 of=$1 seek=1 && \
echo "$2 image has been fused successfully."
####################################
#<Message Display>
echo "Eject SD card"