当前位置:网站首页>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
边栏推荐
- HM agent multi section lithium battery charging IC
- High voltage module isolation module hra2460d-2w
- Peerless good problem (bit operation optimization DP)
- 量子三体问题: 数值计算概述
- Complete scheme diagram of lth7 five pin chip fs4054 charging circuit principle
- 三角形牧场 (0/1背包)
- mapping索引属性 & 创建索的操作
- Computational geometry (4.17)
- 设置索引库结构,给用户添加可自动补全的suggestion,并将一些字段变成集合放到suggestion里面去
- HRA isolation series wide voltage input positive and negative high voltage regulated output
猜你喜欢

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

4-channel encoder pulse counter, 8-Channel do, Modbus TCP module
![[simple and fast] after startup, the desktop is normal, and the taskbar below is unresponsive / the mouse keeps turning](/img/65/fbb975491d4abd5d1babdf000513e2.png)
[simple and fast] after startup, the desktop is normal, and the taskbar below is unresponsive / the mouse keeps turning

2021-09-15

2021-11-17 esp32 pin reference

你的企业最适合哪种深度学习?

2021-09-15

面试复习第N次

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

2022/07/11 第五小组 丁帅 学习笔记 day04
随机推荐
三角形牧场 (0/1背包)
busybox date 日期增加一天明天 网上都是减一天 昨天
HM agent multi section lithium battery charging IC
Low power LDO linear regulator IC
XOR gun (bit operation, thinking, interval violence)
MEX and Increments
2021-09-15
MySQL workbench basically uses [create a data table]
Tips for using tp4054 charging IC -- used in conjunction with Zhongke Lanxun ab5365b
【力扣】复制带随机指针的链表
[antdv: Each record in table should have a unique `key` prop,or set `rowKey` to an unique.....
Longest bracket match (linear DP)
【力扣】用队列实现栈
Acwing game 57 (AK)
Peerless good problem (bit operation optimization DP)
Material and application circuit diagram of 0-10V, 4-20mA current voltage to PWM isolation converter
MCU single chip OTP
Ht7727 ht7730 ht7733 ht7737 ht7750 asynchronous DCDC boost IC
【力扣】相同的树
[bjoi2019] platoon formation (Group backpack)