当前位置:网站首页>Make config analysis of configuration commands before uboot compilation
Make config analysis of configuration commands before uboot compilation
2022-07-19 06:08:00 【Shining uncle】
Compiling uboot It should be implemented before make config, Here is provided by Baiwen uboot For example ( I have been learning with teacher Wei Dongshan's materials , Really good ), Compare the video of Mr. Wei Dongshan , Yes make config Talk about your understanding in the process .
First download u-boot-1.6.tar.bz2 as well as u-boot-1.6.patch
step :
1. decompression tar xjf u-boot-1.6.tar.bz2
2. Enter the source directory cd u-boot-1.6
3. patch up patch -p1 <…/u-boot-1.6.patch
4. To configure make 100ask24x0_config
Let's analyze make 100ask24x0_config
One 、make 100ask24x0_config analysis
stay Makefile You can find
original text :
100ask24x0_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm920t 100ask24x0 NULL s3c24x0
MKCONFIG := $(SRCTREE)/mkconfig
SRCTREE := $(CURDIR)
After variable expansion ·:
100ask24x0_config : unconfig
$(CURDIR)/mkconfig 100ask24x0 arm arm920t 100ask24x0 NULL s3c24x0
In the current path mkconfig Script run , Parameter is 100ask24x0 arm arm920t 100ask24x0 NULL s3c24x0
$0 $1 $2 ……$n Represents the parameters of the command line ,$0 It's the command itself ,$1 Is the first parameter ,$n It's No n Parameters
$# Indicates the number of parameters
Before this command is run , Execute before running unconfig:
unconfig:
@rm -f $(obj)include/config.h $(obj)include/config.mk \
$(obj)board/*/config.tmp $(obj)board/*/*/config.tmp
obj := $(OBJTREE)/
OBJTREE := $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
If you define BUILD_DIR Just use , If there is no definition, use CURDIR.
I.e. clearing $(CURDIR)/include/config.h $(CURDIR)/include/config.mk Etc
Two 、mkconfig Script analysis
#!/bin/sh -e
# Script to create header files and links to configure
# U-Boot for a specific board.
#
# Parameters: Target Architecture CPU Board [VENDOR] [SOC]
#
# (C) 2002-2006 DENX Software Engineering, Wolfgang Denk <[email protected]>
#
\
APPEND=no # Default: Create new config file
BOARD_NAME="" # Name to print in make output
while [ $# -gt 0 ] ; do
case "$1" in
--) shift ; break ;;
-a) shift ; APPEND=yes ;;
-n) shift ; BOARD_NAME="${1%%_config}" ; shift ;;
*) break ;;
esac
done
[ "${BOARD_NAME}" ] || BOARD_NAME="$1"
******************************************************************************
Undefined BOARD_NAME Is defined as $1, namely 100ask24x0
******************************************************************************
[ $# -lt 4 ] && exit 1
[ $# -gt 6 ] && exit 1
******************************************************************************
$# Indicates the number of parameters , by 6, The number of parameters is less than 4 Or greater than 6 All quit
******************************************************************************
echo "Configuring for ${BOARD_NAME} board..."
#
# Create link to architecture specific headers
#
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
******************************************************************************
command :ln -s asm-arm asm
use : Create a point to asm-arm Link file for asm;
reason :#include<asm-type.h>, compile arm when #include<asm-arm.h>, compile i386 when #include<asm-i386.h>,
After using this command, it is written directly as #include<asm.h> No need to change type.
******************************************************************************
fi
rm -f asm-$2/arch
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
******************************************************************************
take asm-arm/arch Point to arch-s3c24x0
******************************************************************************
if [ "$2" = "arm" ] ; then
rm -f asm-$2/proc
ln -s ${LNPREFIX}proc-armv asm-$2/proc
fi
******************************************************************************
take asm-arm/proc Point to proc-armv
******************************************************************************
#
# 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
******************************************************************************
establish config.mk, The content is
ARCH = arm
CPU = arm920t
BOARD = 100ask24x0
SOC = s3c24x0
******************************************************************************
#
# 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
******************************************************************************
establish config.h, The content is
/* Automatically generated - do not edit */
#include <configs/100ask24x0.h>
******************************************************************************
exit 0
边栏推荐
- 【力扣】环形链表 II
- Golang multi project workspace construction
- Conversion, isolation and transmission of international standard signals 0-5v/0-10v/1-5v, 0-10ma/0-20ma/4-20ma, etc
- vscode 使用技巧1
- 5V boost charging 8.4v chip
- busybox date 日期增加一天明天 网上都是减一天 昨天
- Qtss data type
- 2022/07/10 第五小组 丁帅 学习笔记 day03
- 处理中文分词 ik分词器以及拓展和停止字典
- HM agent multi section lithium battery charging IC
猜你喜欢

Fs5383a lithium battery 3.7V input power supply solar lawn lamp drive IC

Proportional valve amplifier 1a, 2a, 3a, 5A proportional valve drive module 0-10V to 0-24v

It4058a single lithium ion battery charging management

Hm9922 switching buck LED constant current driver IC

2022/07/14 学习笔记 (day07)数组

【力扣】复制带随机指针的链表

Introduction to easydarawin streaming media server

处理中文分词 ik分词器以及拓展和停止字典

MySQL Workbench基本使用 【创建一个数据表】

Dac7512n analog mixed signal IC converter
随机推荐
Ehab the xorcist (XOR property, construction)
Computational geometry (4.17)
【简单快速】启动后桌面正常下方任务栏无反应/鼠标一直转圈
c语言 指定日期开始多少天 显示
MySQL Workbench基本使用 【创建一个数据表】
4-20mA to 0-5khz, 5V pulse converter
处理中文分词 ik分词器以及拓展和停止字典
绝世好题(位运算优化dp)
2022/07/10 第五小组 丁帅 学习笔记 day03
嵌入式C语言重点(const、static、voliatile、位运算)
Simple chrome script automatically skips the charging acknowledgment page after the video playback of station B ends
自动补全 & (自定义)拼音分词器 & 搜索时注意事项
4-channel encoder pulse counter, speed measurement, 8-Channel do, Modbus TCP data acquisition module
2022 robocom world robot developer competition - undergraduate group (provincial competition)
【力扣】相同的树
HRA isolation series wide voltage input positive and negative high voltage regulated output
[usaco06dec]the fewest coins g (hybrid backpack)
Qtss data type
你的企业最适合哪种深度学习?
Baby Ehab Partitions Again(dp,构造,位运算)