• Home
Name
Date
Size
#Lines
LOC

..--

linux-4.19/arch/arm/configs/12-May-2024-12,90812,184

linux-5.10/arch/12-May-2024-47,44144,901

.gitattributesD12-May-2024631 1615

LICENSED12-May-202417.6 KiB341281

OAT.xmlD12-May-20244.4 KiB7519

README.mdD12-May-20245 KiB10372

README_zh.mdD12-May-20244.8 KiB10472

README.md

1# Config<a name="EN-US_TOPIC_0000001102487950"></a>
2
3-   [Introduction](#section11660541593)
4-   [Composition of Config](#section28381947133910)
5-   [Directory Structure](#section161941989596)
6-   [Usage](#section1393789267)
7-   [Build](#section19369206113115)
8-   [Repositories Involved](#section1371113476307)
9
10## Introduction<a name="section11660541593"></a>
11
12Evolved from the open-source Linux kernel LTS 4.19.y and 5.10.y, the OpenHarmony Linux kernel has incorporated CVE patches and OpenHarmony features as the OpenHarmony common kernel baseline. Vendors can complete the kernel adaptation by applying the driver patches for boards.
13
14For more information about Linux LTS 4.19.y, visit the [official kernel website](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/log/?h=linux-4.19.y).
15
16For more information about Linux LTS 5.10.y, visit the [official kernel website](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/log/?h=linux-5.10.y).
17
18## Composition of Config<a name="section28381947133910"></a>
19
201. Common configuration file
21
22	Config provides common configuration files for different systems:
23
24	Standard system: **standard\_common\_defconfig**
25
26	Small system: **small\_common\_defconfig**
27
282. Configuration files for open-source development boards
29
30	Configuration file for the open-source development board Hi3516D V300 used in the standard system
31
32## Directory Structure<a name="section161941989596"></a>
33
34```
35kernel/linux/config
36├── linux-4.19
37│   └── arch
38│       └── arm
39│           └── configs
40│               ├── hi3516dv300_small_defconfig       # Small-system defconfig of the open-source Hi3516D V300 development board from HiSilicon
41│               ├── hi3516dv300_standard_defconfig    # Standard-system defconfig of the open-source Hi3516D V300 development board from HiSilicon
42│               ├── small_common_defconfig            # Common defconfig of the small-system kernel
43│               └── standard_common_defconfig         # Common defconfig of the standard-system kernel
44└── linux-5.10
45    └── arch
46        └── arm
47            └── configs
48                ├── hi3516dv300_small_defconfig       # Small-system defconfig of the open-source Hi3516D V300 development board from HiSilicon
49                ├── hi3516dv300_standard_defconfig    # Standard-system defconfig of the open-source Hi3516D V300 development board from HiSilicon
50                ├── small_common_defconfig            # Common defconfig of the small-system kernel
51                └── standard_common_defconfig         # Common defconfig of the standard-system kernel
52```
53
54## Usage<a name="section1393789267"></a>
55
561. Apply HDF patches.
57
58	Apply the HDF kernel patches matching your kernel version. For details, see the method in **kernel.mk** in the **kernel/linux/build** repository.
59
60	```
61	$(OHOS_BUILD_HOME)/drivers/hdf_core/adapter/khdf/linux/patch_hdf.sh $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(KERNEL_PATCH_PATH) $(DEVICE_NAME)
62	```
63
642. Apply the chip driver patches.
65
66	The following uses Hi3516D V300 as an example.
67
68	Place the patches for the chip component in the corresponding path based on the path and naming rules for the patches of the chip component in **kernel.mk** in the **kernel/linux/build** repository.
69
70	```
71	DEVICE_PATCH_DIR := $(OHOS_BUILD_HOME)/kernel/linux/patches/${KERNEL_VERSION}/$(DEVICE_NAME)_patch
72	DEVICE_PATCH_FILE := $(DEVICE_PATCH_DIR)/$(DEVICE_NAME).patch
73	```
74
753. Modify the **config** file to build.
76
77	Place the **config** file for the chip component in the corresponding path based on the path and naming rules of the chip component in **kernel.mk** in the **kernel/linux/build** repository.
78
79	```
80	KERNEL_CONFIG_PATH := $(OHOS_BUILD_HOME)/kernel/linux/config/${KERNEL_VERSION}
81	DEFCONFIG_FILE := $(DEVICE_NAME)_$(BUILD_TYPE)_defconfig
82	```
83
84	> **Note**:
85	>
86	>In the OpenHarmony project build process, patches are installed after **kernel/linux/linux-\*\.\*** is copied. Before using the version-level build command of OpenHarmony, ensure that the **kernel/linux/linux-\*\.\*** source code is available.
87	>
88	>The kernel built is generated in the **kernel** directory under the **out** directory. Modify the **config** file based on the kernel built, and copy the generated **.config** file to the corresponding path in the **config** repository. Then, the configuration takes effect.
89
90## Build<a name="section19369206113115"></a>
91The following uses the Hi3516D V300 development board and Ubuntu x86 server as an example.
92
93Perform a full build for the project to generate the **uImage** kernel image.
94
95```
96./build.sh --product-name Hi3516DV300              # Build the Hi3516D V300 image.
97    --build-target build_kernel                    # Build the uImage kernel image of Hi3516D V300.
98    --gn-args linux_kernel_version=\"linux-5.10\"  # Build the specified kernel version.
99```
100
101## Repositories Involved<a name="section1371113476307"></a>
102<u>kernel\_linux\_config</u>
103

README_zh.md

1# Config组件<a name="ZH-CN_TOPIC_0000001102487950"></a>
2
3-   [简介](#section11660541593)
4-   [内核的Config组成模块](#section28381947133910)
5-   [目录](#section161941989596)
6-   [使用说明](#section1393789267)
7-   [构建说明](#section19369206113115)
8-   [相关仓](#section1371113476307)
9
10## 简介<a name="section11660541593"></a>
11
12OpenHarmony的Linux内核基于开源Linux内核LTS **4.19.y / 5.10.y** 分支演进,在此基线基础上,回合CVE补丁及OpenHarmony特性,作为OpenHarmony Common Kernel基线。针对不同的芯片,各厂商合入对应的板级驱动补丁,完成对OpenHarmony的基线适配。
13
14Linux社区LTS 4.19.y分支信息请查看[kernel官网](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/log/?h=linux-4.19.y)15
16Linux社区LTS 5.10.y分支信息请查看[kernel官网](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/log/?h=linux-5.10.y)17
18## 内核的Config组成模块<a name="section28381947133910"></a>
19
201. 通用配置文件
21
22	针对不同的内核版本,config将给出不同内核版本的对应不同的系统的参考通用配置文件,如下:
23
24	针对标准系统给出对应的参考通用配置文件:standard\_common\_defconfig;
25
26	针对小型系统给出对应的参考通用配置文件:small\_common\_defconfig。
27
282. 开源开发板配置文件
29
30	针对于标准系统开源开发板Hi3516DV300,给出对应的配置文件。
31
32## 目录<a name="section161941989596"></a>
33
34```
35kernel/linux/config
36├── linux-4.19
37│   └── arch
38│       └── arm
39│           └── configs
40│               ├── hi3516dv300_small_defconfig       # 厂商Hisilicon对应的开源开发板Hi3516dv300小型系统的defconfig
41│               ├── hi3516dv300_standard_defconfig    # 厂商Hisilicon对应的开源开发板Hi3516dv300标准系统的defconfig
42│               ├── small_common_defconfig            # 小型系统的内核的common defconfig
43│               └── standard_common_defconfig         # 标准系统的内核的common defconfig
44└── linux-5.10
45    └── arch
46        └── arm
47            └── configs
48                ├── hi3516dv300_small_defconfig       # 厂商Hisilicon对应的开源开发板Hi3516dv300小型系统的defconfig
49                ├── hi3516dv300_standard_defconfig    # 厂商Hisilicon对应的开源开发板Hi3516dv300标准系统的defconfig
50                ├── small_common_defconfig            # 小型系统的内核的common defconfig
51                └── standard_common_defconfig         # 标准系统的内核的common defconfig
52```
53
54## 使用说明<a name="section1393789267"></a>
55
561. 合入HDF补丁
57
58kernel/linux/build仓中,按照kernel.mk中HDF的补丁合入方法,合入不同内核版本对应的HDF内核补丁:
59
60	```
61	$(OHOS_BUILD_HOME)/drivers/hdf_core/adapter/khdf/linux/patch_hdf.sh $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(KERNEL_PATCH_PATH) $(DEVICE_NAME)
62	```
63
642. 合入芯片平台驱动补丁
65
66	以Hi3516DV300为例:
67
68kernel/linux/build仓中,按照kernel.mk中的芯片组件所对应的patch路径规则及命名规则,将对应的芯片组件patch放到对应路径下:
69
70	```
71	DEVICE_PATCH_DIR := $(OHOS_BUILD_HOME)/kernel/linux/patches/${KERNEL_VERSION}/$(DEVICE_NAME)_patch
72	DEVICE_PATCH_FILE := $(DEVICE_PATCH_DIR)/$(DEVICE_NAME).patch
73	```
74
753. 修改自己所需要编译的config
76
77kernel/linux/build仓中,按照kernel.mk中的芯片组件所对应的patch路径规则及命名规则,将对应的芯片组件config放到对应路径下:
78
79	```
80	KERNEL_CONFIG_PATH := $(OHOS_BUILD_HOME)/kernel/linux/config/${KERNEL_VERSION}
81	DEFCONFIG_FILE := $(DEVICE_NAME)_$(BUILD_TYPE)_defconfig
82	```
83
84	> **须知:**
85	>
86	>由于OpenHarmony工程的编译构建流程中会拷贝kernel/linux/linux-\*\.\*的代码环境后进行打补丁动作,在使用OpenHarmony的版本级编译命令前,需要kernel/linux/linux-\*\.\*原代码环境。
87	>
88	>根据不同系统工程,编译完成后会在out目录下的kernel目录中生成对应实际编译的内核,基于此目录的内核,进行对应的config修改,将最后生成的\.config文件cp到config仓对应的路径文件里,即可生效。
89
90## 构建说明<a name="section19369206113115"></a>
91以hi3516dv300开源开发板+ubuntu x86主机开发环境为例
92
93使用工程的全量编译命令,编译生成uImage内核镜像
94
95```
96./build.sh --product-name Hi3516DV300              # 编译hi3516dv300镜像
97    --build-target build_kernel                    # 编译hi3516dv300的uImage内核镜像
98    --gn-args linux_kernel_version=\"linux-5.10\"  # 编译指定内核版本
99```
100
101## 相关仓<a name="section1371113476307"></a>
102<u>kernel\_linux\_config</u>
103
104