当前位置:网站首页>22 openwrt uses external kernel and kernel_ config
22 openwrt uses external kernel and kernel_ config
2022-07-28 04:19:00 【Creator_ Ly】
Because the kernel should be modified by typing patch The way will be more troublesome , Sometimes we will extract the kernel directly and modify the source code , At this time, you need to use external kernel This option of .openwrt The kernel of config It is saved according to the version , Such as config-4.19, When we have many and hardware platforms in one version , platform config It is very important to classify and save , At this time, we will choose to use external kernel_config The way .
1、 External use kernel
Using external kernel source code , We will compile it again openwrt, And then build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.81/ Copy source code to , Such as …/extkernel/4.4.198 Under the table of contents .
then make menuconfig Turn on Use external kernel tree Options can be .
[*] Advanced configuration options (for developers) ----
(../extkernel/4.4.198) Use external kernel tree
2、 External use kernel config
The kernel configuration to be modified is , We will use make kernel_menuconfig To configure .
2.1 The original way
First look at the original kernel .config The generative logic of ,make kernel_menuconfig When , Will pass kconfig.pl The script will generic and mediatek Under the config-4.19 Merge into one .config For kernel use .
/home/19.07/scripts/kconfig.pl + /home/19.07/target/linux/generic/config-4.19 /home/19.07/target/linux/mediatek/mt7622/config-4.19 > /home/19.07/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.81/.config
When we kernel_menuconfig After configuration , It will be saved and used when exiting kconfig.pl The script saves the configuration file again to config-4.19 In file .
/home/19.07/scripts/kconfig.pl '>' /home/19.07/target/linux/generic/config-4.19 /home/19.07/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.81/.config > /home/19.07/target/linux/mediatek/mt7622/config-4.19
So what we need to do is to report everywhere and import process , Change to our own configuration kernel_config file .
2.2 Use external customization kernel config The way
stay config/Config-devel.in Add inside KERNEL_CONFIG The option of supports external configuration
config EXTERNAL_KERNEL_TREE
string "Use external kernel tree" if DEVEL
default ""
+ config EXTERNAL_KERNEL_CONFIG
+ string "Use external kernel config" if DEVEL
+ default "
then make menuconfig Fill in the path name of the external configuration file we want to use
[*] Advanced configuration options (for developers) ----
(./userconfig/BOARD1-kernel.config) Use external kernel config
Here we need a copy of the kernel .config file , The first time is usually after we want to compile , Copy it and rename it as ours BOARD1-kernel.config
Modify the import process , stay 19.07/include/target.mk Add import external kernel config Content
#
#
# Support external kernel config
#
ifneq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_CONFIG)),)
EXT_KERNEL_CONFIG_FIRST_CHAR := $(shell path=$(CONFIG_EXTERNAL_KERNEL_CONFIG); echo $${path:0:1})
ifeq ($(EXT_KERNEL_CONFIG_FIRST_CHAR),/)
_EXT_KERNEL_CONFIG_PATH := $(CONFIG_EXTERNAL_KERNEL_CONFIG)
else
_EXT_KERNEL_CONFIG_PATH := $(TOPDIR)/$(CONFIG_EXTERNAL_KERNEL_CONFIG)
endif
LINUX_CONF_CMD := cat $(_EXT_KERNEL_CONFIG_PATH)
LINUX_RECONF_CMD := $(LINUX_CONF_CMD)
else
LINUX_CONF_CMD = $(call __linux_confcmd,$(LINUX_KCONFIG_LIST),)
LINUX_RECONF_CMD = $(call __linux_confcmd,$(LINUX_RECONFIG_LIST),)
LINUX_RECONF_DIFF = $(call __linux_confcmd,$(filter-out $(LINUX_RECONFIG_TARGET),$(LINUX_RECONFIG_LIST)),'>')
endif
Modify the saving process ,19.07/include/kernel-build.mk Add and save external kernel config Content
ifneq ($(strip $(CONFIG_EXTERNAL_KERNEL_CONFIG)),"")
cp -a $(LINUX_DIR)/.config $(_EXT_KERNEL_CONFIG_PATH)
else
$(LINUX_RECONF_DIFF) $(LINUX_DIR)/.config > $(LINUX_RECONFIG_TARGET)
endif
after , Again make kernel_menuconfig You can see that , The import process is as follows :
cat /home/19.07/"./zhconfig/BOARD1-kernel.config" > /home/19.07/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.81/.config
The preservation process is as follows :
cp -a /home/19.07/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.81/.config /home/19.07/"./zhconfig/BOARD1-kernel.config"
边栏推荐
- Experience sharing of automatic test for students with monthly salary of 28K
- Filters, interceptors, listeners
- security异常处理机制
- Work fishing clock simulator wechat applet source code
- Istio's Traffic Management API
- setup和hold timing分析不满足是解决方法
- C#跨线程刷新前台UI
- Kingbasees Security Guide for Jincang database -- 6.1 introduction to strong authentication
- 校园流浪猫信息记录和分享的小程序源码
- Fedformer MOE module
猜你喜欢
![[blood vessel detection] Based on MATLAB mom method, combined with Hessian and curve fitting, blood vessel diameter measurement [including Matlab source code, 1970]](/img/72/10bd8a292c3ee3445907795ebf2ae8.png)
[blood vessel detection] Based on MATLAB mom method, combined with Hessian and curve fitting, blood vessel diameter measurement [including Matlab source code, 1970]

月薪28K学员 自动化测试经验分享

【YOLOv5实战5】基于YOLOv5的交通标志识别系统-YOLOv5整合PyQt5

servlet使用

上班摸鱼打卡模拟器微信小程序源码

MySQL:数据类型和运算符

Adding DSP library to STM32F103 and its solution

XML file usage and parsing

Virtual machine class loading mechanism

H265/HEVC名词解释-- CTU,CTB,CU,CB,TU,PU,TB,PB,LCU,Slice,Tile,Chroma,Luma,I帧,B帧,P帧
随机推荐
企业数字化建设“三不五要”原则
security异常处理机制
Linux - MySQL advanced (day19)
[Niuke] find 1+2+3+... +n
Domestic high hidden free agent crawler code
[performance optimization methodology series] III. core idea of performance optimization (2)
高数_第4章__曲线积分_习题解法
The unsatisfied analysis of setup and hold timing is the solution
Cookies and session
The simulation test disconnects the server from the public network
How much does it cost to build a self built server for ark survival evolution?
一名合格的软件测试工程师,应该具备哪些技术能力?
ServletContext、request、response
Un7.27: how to successfully build a ruoyi framework project in idea?
numeric_ Limits the range and related attributes of each data type learned
21 days, fat brother personally takes you to play oauth2
Machine learning 06: Decision Tree Learning
Information system project manager (2022) - key content: information system integrated testing and management, project management maturity model, quantitative project management (21)
servlet使用
Istio's Traffic Management API