提交 b7106f29 编写于 作者: Z zhujiaxin

kernel common patch

Signed-off-by: Nzhujiaxin <zhujiaxin@huawei.com>
上级 b38cab68
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
Apply the HDF patches based on the kernel version in the **kernel/linux/build** repository. For details, see the method for applying the HDF patch in **kernel.mk**. Apply the HDF patches based on the kernel version in the **kernel/linux/build** repository. For details, see the method for applying the HDF patch in **kernel.mk**.
``` ```
$(OHOS_BUILD_HOME)/drivers/adapter/khdf/linux/patch_hdf.sh $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(HDF_PATCH_FILE) $(OHOS_BUILD_HOME)/drivers/hdf_core/adapter/khdf/linux/patch_hdf.sh $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(KERNEL_PATCH_PATH) $(DEVICE_NAME)
``` ```
2. Apply the chip driver patches. 2. Apply the chip driver patches.
......
...@@ -131,14 +131,14 @@ For details about how to use the logs, see [Hilog\_lite](https://gitee.com/openh ...@@ -131,14 +131,14 @@ For details about how to use the logs, see [Hilog\_lite](https://gitee.com/openh
Run the shell script to apply HDF patches. Run the shell script to apply HDF patches.
1. Set the three variables in the **patch\_hdf.sh** script. 1. Set the four variables in the **patch\_hdf.sh** script.
2. Obtain the **patch\_hdf.sh** script. 2. Obtain the **patch\_hdf.sh** script.
3. Run the **patch\_hdf.sh** script to pass the three variables in sequence. 3. Run the **patch\_hdf.sh** script to pass the four variables in sequence.
Run the following command: Run the following command:
``` ```
./patch_hdf.sh [Project root directory path] [Kernel directory path] [HDF patch file] ./patch_hdf.sh [Project root directory path] [Kernel directory path] [Kernel patch path] [Device name]
``` ```
The following uses Raspberry Pi 3b as an example: The following uses Raspberry Pi 3b as an example:
...@@ -148,7 +148,8 @@ For details about how to use the logs, see [Hilog\_lite](https://gitee.com/openh ...@@ -148,7 +148,8 @@ For details about how to use the logs, see [Hilog\_lite](https://gitee.com/openh
PROJ_ROOT/drivers/adapter/khdf/linux/patch_hdf.sh \ PROJ_ROOT/drivers/adapter/khdf/linux/patch_hdf.sh \
PROJ_ROOT # Specify the path of the project root directory.\ PROJ_ROOT # Specify the path of the project root directory.\
PROJ_ROOT/out/KERNEL_OBJ/kernel/src_tmp/linux-rpi3b # Specify the kernel directory for applying the patch.\ PROJ_ROOT/out/KERNEL_OBJ/kernel/src_tmp/linux-rpi3b # Specify the kernel directory for applying the patch.\
PROJ_ROOT/kernel/linux/patches/linux-4.19/hi3516dv300_patch/hdf.patch # HDF patch file. PROJ_ROOT/kernel/linux/patches/linux-4.19 # Kernel patch patch.\
hi3516dv300 # Device name.
``` ```
2. Configure the **config** file. 2. Configure the **config** file.
......
...@@ -64,18 +64,23 @@ kernel/ ...@@ -64,18 +64,23 @@ kernel/
│ ├── linux-4.19 # OpenHarmony linux-4.19 common kernel │ ├── linux-4.19 # OpenHarmony linux-4.19 common kernel
│ ├── linux-5.10 # OpenHarmony linux-5.10 common kernel │ ├── linux-5.10 # OpenHarmony linux-5.10 common kernel
│ ├── build │ ├── build
│ │ ├── BUILD.gn # GN file of the build framework │ │ ├── BUILD.gn # GN file of the build framework
│ │ ├── kernel.mk # Kernel build file │ │ ├── kernel.mk # Kernel build file
│ │ └── ohos.build # Kernel build component file │ │ └── ohos.build # Kernel build component file
│ ├── patches │ ├── patches
│ │ ├── linux-4.19 # linux-4.19 patches │ │ ├── linux-4.19 # linux-4.19 patches
│ │ │   ├── common_patch
│ │ │   │ └── hdf.patch # linux-4.19 HDF patches
│ │ │   └── hi3516dv300_patch │ │ │   └── hi3516dv300_patch
│ │ │   ├── hi3516dv300.patch # linux-4.19 Hi3516D V300 SOC patches │ │ │   └── hi3516dv300.patch # linux-4.19 Hi3516D V300 SOC patches
│ │ │   └── hdf.patch # linux-4.19 Hi3516D V300 HDF patches
│ │ └── linux-5.10 │ │ └── linux-5.10
│ │    ├── common_patch
│ │    │ └── hdf.patch # linux-5.10 HDF patches
│ │    └── hi3516dv300_patch │ │    └── hi3516dv300_patch
│ │    ├── hi3516dv300.patch # linux-5.10 Hi3516D V300 SOC patches │ │    │ └── hi3516dv300.patch # linux-5.10 Hi3516D V300 SOC patches
│ │    └── hdf.patch # linux-5.10 Hi3516D V300 HDF patches │ │    └── rkrk3568_patch
│ │    ├── kernel.patch # linux-5.10 rk3568 SOC patches
│ │    └── hdf.patch # linux-5.10 rk3568 customized HDF patches
│ └── config │ └── config
│ ├── linux-4.19 │ ├── linux-4.19
│ │   └── arch │ │   └── arch
...@@ -151,7 +156,7 @@ For details, see "Usage" in LiteOS-A Kernel [README](https://gitee.com/openharmo ...@@ -151,7 +156,7 @@ For details, see "Usage" in LiteOS-A Kernel [README](https://gitee.com/openharmo
Apply the HDF kernel patches matching your kernel version. For details, see the method in **kernel.mk** in the **kernel/linux/build** repository. Apply the HDF kernel patches matching your kernel version. For details, see the method in **kernel.mk** in the **kernel/linux/build** repository.
``` ```
$(OHOS_BUILD_HOME)/drivers/adapter/khdf/linux/patch_hdf.sh $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(HDF_PATCH_FILE) $(OHOS_BUILD_HOME)/drivers/hdf_core/adapter/khdf/linux/patch_hdf.sh $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(KERNEL_PATCH_PATH) $(DEVICE_NAME)
``` ```
2. Apply the chip driver patches. 2. Apply the chip driver patches.
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
1. 合入HDF补丁 1. 合入HDF补丁
在kernel/linux/build仓中,按照kernel.mk中HDF的补丁合入方法,合入不同内核版本对应的HDF内核补丁: 在kernel/linux/build仓中,按照kernel.mk中HDF的补丁合入方法,合入不同内核版本对应的HDF内核补丁:
``` ```
$(OHOS_BUILD_HOME)/drivers/adapter/khdf/linux/patch_hdf.sh $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(HDF_PATCH_FILE) $(OHOS_BUILD_HOME)/drivers/hdf_core/adapter/khdf/linux/patch_hdf.sh $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(KERNEL_PATCH_PATH) $(DEVICE_NAME)
``` ```
2. 合入芯片平台驱动补丁 2. 合入芯片平台驱动补丁
......
...@@ -144,15 +144,15 @@ obj-$(CONFIG_HIEVENT) += hievent/ ...@@ -144,15 +144,15 @@ obj-$(CONFIG_HIEVENT) += hievent/
1. 打HDF补丁。 1. 打HDF补丁。
在Linux内核打HDF补丁时,执行补丁shell脚本合入HDF补丁。 在Linux内核打HDF补丁时,执行补丁shell脚本合入HDF补丁。
1. 配置HDF补丁脚本的个变量参数。 1. 配置HDF补丁脚本的个变量参数。
2. 获取patch_hdf.sh脚本。 2. 获取patch_hdf.sh脚本。
3. 执行patch_hdf.sh脚本依次传入个变量参数。 3. 执行patch_hdf.sh脚本依次传入个变量参数。
patch_hdf.sh脚本三个参数含义为:第一个入参为工程根目录路径,第二入参为内核目录路径,第三个入参为hdf补丁文件 patch_hdf.sh脚本四个参数含义为:第一个入参为工程根目录路径,第二入参为内核目录路径,第三个入参为内核版本路径,第四个参数是当前设备名
``` ```
./patch_hdf.sh [工程根目录路径] [内核目录路径] [hdf补丁文件] ./patch_hdf.sh [工程根目录路径] [内核目录路径] [内核补丁路径] [设备名]
``` ```
以树莓派3b为示例介绍: 以树莓派3b为示例介绍:
...@@ -163,7 +163,8 @@ obj-$(CONFIG_HIEVENT) += hievent/ ...@@ -163,7 +163,8 @@ obj-$(CONFIG_HIEVENT) += hievent/
PROJ_ROOT/drivers/adapter/khdf/linux/patch_hdf.sh \ PROJ_ROOT/drivers/adapter/khdf/linux/patch_hdf.sh \
PROJ_ROOT # 指定工程根目录路径 \ PROJ_ROOT # 指定工程根目录路径 \
PROJ_ROOT/out/KERNEL_OBJ/kernel/src_tmp/linux-rpi3b # 打补丁的内核目录路径 \ PROJ_ROOT/out/KERNEL_OBJ/kernel/src_tmp/linux-rpi3b # 打补丁的内核目录路径 \
PROJ_ROOT/kernel/linux/patches/linux-4.19/hi3516dv300_patch/hdf.patch # HDF补丁文件 PROJ_ROOT/kernel/linux/patches/linux-4.19 # 内核补丁路径.\
hi3516dv300 # 设备名.
``` ```
2. 配置config。 2. 配置config。
......
...@@ -75,18 +75,23 @@ kernel/ ...@@ -75,18 +75,23 @@ kernel/
│ ├── linux-4.19 # OpenHarmony linux-4.19 Common kernel │ ├── linux-4.19 # OpenHarmony linux-4.19 Common kernel
│ ├── linux-5.10 # OpenHarmony linux-5.10 Common kernel │ ├── linux-5.10 # OpenHarmony linux-5.10 Common kernel
│ ├── build │ ├── build
│ │ ├── BUILD.gn # 编译框架GN文件 │ │ ├── BUILD.gn # 编译框架GN文件
│ │ ├── kernel.mk # 内核编译文件 │ │ ├── kernel.mk # 内核编译文件
│ │ └── ohos.build # 内核编译组件文件 │ │ └── ohos.build # 内核编译组件文件
│ ├── patches │ ├── patches
│ │ ├── linux-4.19 # linux-4.19 相关patch │ │ ├── linux-4.19 # linux-4.19 相关patch
│ │ │   ├── common_patch
│ │ │   │ └── hdf.patch # linux-4.19 HDF patches
│ │ │   └── hi3516dv300_patch │ │ │   └── hi3516dv300_patch
│ │ │   ├── hi3516dv300.patch # linux-4.19 hi3516dv300 SOC patch │ │ │   └── hi3516dv300.patch # linux-4.19 Hi3516D V300 SOC patches
│ │ │   └── hdf.patch # linux-4.19 hi3516dv300 hdf patch
│ │ └── linux-5.10 │ │ └── linux-5.10
│ │    ├── common_patch
│ │    │ └── hdf.patch # linux-5.10 HDF patches
│ │    └── hi3516dv300_patch │ │    └── hi3516dv300_patch
│ │    ├── hi3516dv300.patch # linux-5.10 hi3516dv300 SOC patch │ │    │ └── hi3516dv300.patch # linux-5.10 Hi3516D V300 SOC patches
│ │    └── hdf.patch # linux-5.10 hi3516dv300 hdf patch │ │    └── rkrk3568_patch
│ │    ├── kernel.patch # linux-5.10 rk3568 SOC patches
│ │    └── hdf.patch # linux-5.10 rk3568 定制 HDF patches
│ └── config │ └── config
│ ├── linux-4.19 │ ├── linux-4.19
│ │   └── arch │ │   └── arch
...@@ -162,7 +167,7 @@ Hi3518EV300默认使用jffs2文件系统,Hi3516DV300默认使用FAT文件系 ...@@ -162,7 +167,7 @@ Hi3518EV300默认使用jffs2文件系统,Hi3516DV300默认使用FAT文件系
在kernel/linux/build仓中,按照kernel.mk中HDF的补丁合入方法,合入不同内核版本对应的HDF内核补丁: 在kernel/linux/build仓中,按照kernel.mk中HDF的补丁合入方法,合入不同内核版本对应的HDF内核补丁:
``` ```
$(OHOS_BUILD_HOME)/drivers/adapter/khdf/linux/patch_hdf.sh $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(HDF_PATCH_FILE) $(OHOS_BUILD_HOME)/drivers/hdf_core/adapter/khdf/linux/patch_hdf.sh $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(KERNEL_PATCH_PATH) $(DEVICE_NAME)
``` ```
2. 合入芯片平台驱动补丁 2. 合入芯片平台驱动补丁
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册