yonzuge学习总结
uboot配置分析解压 tar xvf u-boot-1.1.6.tar.bz2
打补丁patch -p1<../u-boot-1.1.6_jz2440.patch
配置 make 100ask24x0_config
编译 make
1、查看Makefile
1.0 100ask24x0_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm920t 100ask24x0 NULL s3c24x0
mkconfig 100ask24x0 arm arm920t 100ask24x0 NULL s3c24x0
参数: S0 S1 S2 S3 S4 S5 S6
1.1、MKCONFIG := $(SRCTREE)/mkconfig
1.2、SRCTREE := $(CURDIR)
2、查看mkconfig
1.1 APPEND=no # Default: Create new config file
BOARD_NAME="" # Name to print in make output
while [ $# -gt 0 ] ; do //$#表示参数的个数,-gt表示大于,-lt表示小于
case "$1" in
--) shift ; break ;;
-a) shift ; APPEND=yes ;;
-n) shift ; BOARD_NAME="${1%%_config}" ; shift ;;
*) break ;;
esac
done
[ "${BOARD_NAME}" ] || BOARD_NAME="$1"
[ $# -lt 4 ] && exit 1
[ $# -gt 6 ] && exit 1
echo "Configuring for ${BOARD_NAME} board..."
分析完结果: //打印下面这句话
Configuring for 100ASK24X0 board...
3、创建软链接
3.0 if [ "$SRCTREE" != "$OBJTREE" ] ; then
mkdir -p ${OBJTREE}/include
mkdir -p ${OBJTREE}/include2
cd ${OBJTREE}/include2
rm -f asm
ln -s ${SRCTREE}/include/asm-$2 asm
LNPREFIX="../../include2/asm/"
cd ../include
rm -rf asm-$2
rm -f asm
mkdir asm-$2
ln -s asm-$2 asm
else
cd ./include
rm -f asm
ln -s asm-$2 asm
fi
rm -f asm-$2/arch //创建软链接
分析完走else分支:
cd ./include
rm -f asm
ln -s asm-arm asm
命令查看结果:
#book@book-desktop:/work/system/u-boot-1.1.6/include$ ls asm -l
#lrwxrwxrwx 1 book book 7 2014-08-13 15:42 asm -> asm-arm
rm -f asm-arm/arch
3.1 if [ -z "$6" -o "$6" = "NULL" ] ; then
ln -s ${LNPREFIX}arch-$3 asm-$2/arch
else
ln -s ${LNPREFIX}arch-$6 asm-$2/arch
fi
分析结果:
走else分支
ln -s arch-s3c24x0 asm-arm/arch
命令查看结果:
#book@book-desktop:/work/system/u-boot-1.1.6/include$ ls asm-arm/arch -l
#lrwxrwxrwx 1 book book 12 2014-08-13 15:42 asm-arm/arch -> arch-s3c24x0
3.2 if [ "$2" = "arm" ] ; then
rm -f asm-$2/proc
ln -s ${LNPREFIX}proc-armv asm-$2/proc
fi
分析结果:
rm -f asm-arm/proc
ln -s proc-armv asm-arm/proc
4、创建config.mk文件
# Create include file for Make
#
echo "ARCH = $2" > config.mk
echo "CPU = $3" >> config.mk
echo "BOARD = $4" >> config.mk
[ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk
[ "$6" ] && [ "$6" != "NULL" ] && echo "SOC = $6" >> config.mk
分析结果
在./include创建下config.mk
ARCH = arm
CPU = arm920t
BOARD = 100ask24x0
SOC =s3c24x0
5、创建config.h文件
# Create board specific header file
#
if [ "$APPEND" = "yes" ] # Append to existing config file
then
echo >> config.h
else
> config.h # Create new config file
fi
echo "/* Automatically generated - do not edit */" >>config.h
echo "#include <configs/$1.h>" >>config.h
分析APPEND=no
分析结果:
> config.h # Create new config file
/* Automatically generated - do not edit */"
#include <configs/100ask24x0.h>
/**************************************config.mk配置分析结果****************************************/
!/bin/sh -e
# (C) 2002-2006 DENX Software Engineering, Wolfgang Denk <wd@denx.de>
#
APPEND=no # Default: Create new config file
BOARD_NAME="" # Name to print in make output
BOARD_NAME=100ask24x0
Configuring for 100ASK24X0 board...
#
# Create link to architecture specific headers
#
cd ./include
rm -f asm
ln -s asm-arm asm
rm -f asm-arm/arch
ln -s arch-s3c24x0 asm-arm/arch
rm -f asm-arm/proc
ln -s proc-armv asm-arm/proc
#
# Create include file for Make
#
ARCH =arm
CPU =arm920t
BOARD =100ask24x0
SOC =s3c24x0
#
# Create board specific header file
#
config.h # Create new config file
/* Automatically generated - do not edit */
#include <configs/100ask24x0.h>