Welcome 微信登录

首页 / 操作系统 / Linux / 编译uboot的小脚本

很久以前使用的编译并烧录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" inclean)echo make cleanmake mrproperrm -rf $U_BOOT_DIR/CodeSign4SecureBootrm -rf $U_BOOT_DIR/sdfuse_q;;tags)echo $PWDctags -R *;;config)if [ ! -d $SEC_DIR ] ; thenecho "**********************************************"echo "[ERR]please get the CodeSign4SecureBoot first"echo "**********************************************"exit 0elif [ ! -d $SDQ_DIR ] ; thenecho "**********************************************"echo "[ERR]please get the sdfuse_q first"echo "**********************************************"exit 0ficp -a $SEC_DIR $U_BOOT_DIRcp -a $SDQ_DIR $U_BOOT_DIRmake origen_config;;*)make -j$CPU_NUMsplit -b 14336 u-boot.bin bl2make -C $U_BOOT_DIR/sdfuse_q$U_BOOT_DIR/sdfuse_q/chksum$U_BOOT_DIR/sdfuse_q/add_paddingrm bl2a*if [ ! -f checksum_bl2_14k.bin ]thenecho "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"echo "There are some error(s) while building uboot, please use command make to check."echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"exit 0ficp -rf checksum_bl2_14k.bin $U_BOOT_DIR/CodeSign4SecureBootcp -rf u-boot.bin $U_BOOT_DIR/CodeSign4SecureBootrm checksum_bl2_14k.bincd $U_BOOT_DIR/CodeSign4SecureBootcat E4412_N.bl1.SCP2G.bin bl2.bin all00_padding.bin u-boot.bin tzsw_SMDK4412_SCP_2GB.bin > u-boot-4412.bincp -a u-boot-4412.bin /home/tftpdirmv u-boot-4412.bin $ROOT_DIR/mk_sdbootrm checksum_bl2_14k.binrm u-boot.binecho 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 ]thenecho "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"elseecho "Unsupported SD reader"exit 0fiif [ -b $1 ]thenecho "$1 reader is identified."elseecho "$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.linuxidc.com/Linux/2017-01/139704.htm