现在的位置: 首页 > 操作系统 > 正文

编译uboot的小脚本

2020年02月10日 操作系统 ⁄ 共 3062字 ⁄ 字号 评论关闭

很久以前使用的编译并烧录uboot的脚本,最后一个应该不是我写的。

#!/bin/sh#build.shset -eCPU_NUM=$(grep processor /proc/cpuinfo | awk '{field=$NF};END{print field+1}')ROOT_DIR=$PWDU_BOOT_DIR=$ROOT_DIR/u-boot-2013.01SEC_DIR=$ROOT_DIR/CodeSign4SecureBootSDQ_DIR=$ROOT_DIR/sdfuse_qexport ARCH=armexport CROSS_COMPILE=/opt/arm-linux-gcc-4.6.4/bin/arm-linux-cd $U_BOOT_DIRcase "$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.shecho "Fuse 4412 trustzone uboot file into SD card"if [ -z $1 ]then ./sd_fusing_exynos4x12.sh /dev/sdb u-boot-4412.binelse ./sd_fusing_exynos4x12.sh $1 u-boot-4412.binfi

#!/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.shreader_type1="/dev/sd"reader_type2="/dev/mmcblk0"if [ -z $2 ]then echo "usage: ./sd_fusing.sh <SD Reader's device file> <filename>" exit 0fiparam1=`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 0fiif [ -b $1 ]then echo "$1 reader is identified."else echo "$1 is NOT identified." exit 0fi####################################echo "----------------------------------"echo $partitionecho "----------------------------------"# formatumount $partition 2> /dev/nullecho "$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"

本文永久更新链接地址:http://www.xuebuyuan.com/Linux/2017-01/139704.htm

以上就上有关编译uboot的小脚本的相关介绍,要了解更多编译uboot,uboot,编译uboot的小脚本,编程,Linux编程,Linux Shell,Android,Android教程,JAVA,C语言,Python,HTML5内容请登录学步园。

抱歉!评论已关闭.