未验证 提交 b4e18ea1 编写于 作者: O openharmony_ci 提交者: Gitee

!3936 把指向productdefine目录下的修改调整为vendor目录下

Merge pull request !3936 from xiyue5/master
......@@ -6,51 +6,60 @@ This document describes the general process for porting a development board, rat
This document uses the process of porting a development board named **MyProduct** as an example. This development board is provided by **MyProductVendor** and uses the SoC **MySOC** produced by **MySoCVendor**.
### Defining an SoC<a name="section135mcpsimp"></a>
Create a JSON file named after the SoC name in the **//productdefine/common/device** directory and specify the CPU architecture.
### Defining a Product<a name="section145mcpsimp"></a>
For example, to port **MySOC**, which uses a 32-bit ARM kernel, configure the file as follows:
Create a config.json file in the directory with the name "//vendor/MyProductVendor/{product_name}. This file is used to describe the SoC used by the product and the required subsystems. configure the file as follows:
//productdefine/common/device/MySOC.json
//vendor/MyProductVendor/MyProduct/config.json
```
{
"target_os": "ohos",
"target_cpu": "arm"
"product_name": "MyProduct",
"version": "3.0",
"type": "standard",
"target_cpu": "arm",
"ohos_version": "OpenHarmony 1.0",
"device_company": "MyProductVendor",
"board": "MySOC",
"enable_ramdisk": true,
"subsystems": [
{
"subsystem": "ace",
"components": [
{ "component": "ace_engine_lite", "features":[""] }
]
},
]
}
```
Currently, **target\_cpu** can be set to **arm** only. In the future, you can set the value depending on the CPU architecture, such as **arm64**, **riscv**, or **x86**.
The main configurations are as follows:
### Defining a Product<a name="section145mcpsimp"></a>
product_name:The product name.Required
Create a JSON file named after the product name in the **//productdefine/common/products** directory. This file is used to describe the SoC used by the product and the required subsystems. Configure the file as follows:
version:version.Required
//productdefine/common/products/MyProduct.json
type:Configured at the system level, select from (mini, small, standard).Required
```
{
"product_name": "MyProduct",
"product_company" : "MyProductVendor",
"product_device": "MySOC",
"version": "2.0",
"type": "standard",
"parts":{
"ace:ace_engine_standard":{},
"ace:napi":{},
...
"xts:phone_tests":{}
}
}
target_cpu :The CPU type of the device (depending on the actual situation, the target_cpu here may also be arm64, riscv, x86, etc..).Required
```
ohos_version:Operating system version.Optional
The main configurations are as follows:
device_company:device manufacturer name.Required
board:Board name.Required
enable_ramdisk:Whether to start ramdisk.Required
kernel_type and kernel_version: kernel_type with kernel_version is fixed in the standard and does not need to be written.Optional
subsystems:The subsystem that the system needs to be enabled. Subsystems can simply understand a piece of function that is built independently. Required
1. **product\_device**: SoC used by the product.
2. **type**: system level. In this example, set it to **standard**.
3. **parts**: subsystem to enable. A subsystem can be treated as an independently built functional block.
product_company:Not reflected in the configuration, but in the directory name, the next directory of the vendor is product_company, build.gn script can still be accessed.
You can find available subsystems in **//build/subsystem\_config.json**. You can also customize subsystems.
......@@ -83,7 +92,7 @@ Add the following subsystem configuration to the **//build/subsystem\_config.js
},
```
Then, open the configuration file **//productdefine/common/products/MyProduct.json**, which is used to define the product, and add the new subsystem to the product.
Then, open the configuration file **//vendor/MyProductVendor/MyProduct/config.json**, which is used to define the product, and add the new subsystem to the product.
### 2. Building the Kernel<a name="section182mcpsimp"></a>
......
......@@ -19,9 +19,9 @@ applications/sample/hello
├── bundle.json
build
└── subsystem_config.json
productdefine/common
└── products
└── Hi3516DV300.json
vendor/hisilicon
└── Hi3516DV300
└── config.json
```
......
......@@ -19,9 +19,9 @@ applications/sample/hello
├── bundle.json
build
└── subsystem_config.json
productdefine/common
└── products
└── rk3568.json
vendor/hihope
└── rk3568
└── config.json
```
......@@ -150,7 +150,7 @@ Perform the steps below in the source code directory:
4. Modify the product configuration file.
In the vendor\hisilicon\rk3568\config.json file, add the hello part after the existing part.
In the vendor\hihope\rk3568\config.json file, add the hello part after the existing part.
```
"usb:usb_manager_native":{},
......
......@@ -19,9 +19,9 @@ applications/sample/hello
│ └── bundle.json
build
└── subsystem_config.json
productdefine/common
└── products
└── Hi3568DV300.json
vendor/hisilicon
└── Hi3516DV300
└── config.json
```
......@@ -151,7 +151,7 @@ Perform the steps below in the source code directory:
4. Modify the product configuration file.
In the **productdefine/common/products/Hi3516DV300.json** file, add the **hello** part after the existing part.
In the **vendor\hisilicon\Hi3516DV300\config.json** file, add the **hello** part after the existing part.
```
......
......@@ -18,9 +18,9 @@ applications/sample/hello
│ └── bundle.json
build
└── subsystem_config.json
productdefine/common
└── products
└── rk3568.json
vendor/hihope
└── rk3568
└── config.json
```
......@@ -149,7 +149,7 @@ Perform the steps below in the source code directory:
4. Modify the product configuration file.
In the **productdefine/common/products/rk3568.json** file, add the **hello** part after the existing part.
In the **vendor\hihope\rk3568\config.json** file, add the **hello** part after the existing part.
```
"usb:usb_manager_native":{},
......
......@@ -207,7 +207,7 @@ The process to build OpenHarmony is as follows:
2. Add the module to the product configuration file.
Add the module to the product configuration file **productdefine/common/products/\{product-name\}.json**.
Add the module to the product configuration file **//vendor/{product_company}/{product-name}/config.json。**.
Add "subsystem\_examples:partA" to the product configuration file. **partA** will be built and packaged into the distribution.
......
......@@ -24,7 +24,7 @@
"target_cpu": "arm",
"ohos_version": "OpenHarmony 1.0",
"device_company": "MyProductVendor",
"board": "MyProduct",
"board": "MySOC",
"enable_ramdisk": true,
"subsystems": [
{
......@@ -41,7 +41,7 @@
```
主要的配置内容
product_name: 产品名称 必填
product_name:产品名称 必填
version:版本 必填
......@@ -101,7 +101,7 @@ product_company:不体现在配置中,而是目录名,vendor下一级目
},
```
接着需要修改定义产品的配置文件//productdefine/common/products/MyProduct.json,将刚刚定义的子系统加入到产品中。
接着需要修改定义产品的配置文件//vendor/MyProductVendor/MyProduct/config.json,将刚刚定义的子系统加入到产品中。
### 2. 编译内核
......
......@@ -19,9 +19,9 @@ applications/sample/hello
├── bundle.json
build
└── subsystem_config.json
productdefine/common
└── products
└── Hi3516DV300.json
vendor/hisilicon
└── Hi3516DV300
└── config.json
```
......@@ -151,7 +151,7 @@ productdefine/common
4. 修改产品配置文件。
productdefine\common\products\Hi3516DV300.json中添加对应的hello部件,直接添加到原有部件后即可。
vendor\hisilicon\Hi3516DV300\config.json中添加对应的hello部件,直接添加到原有部件后即可。
```
......
......@@ -19,9 +19,9 @@ applications/sample/hello
├── bundle.json
build
└── subsystem_config.json
productdefine/common
└── products
└── rk3568.json
vendor/hihope
└── rk3568
└── config.json
```
......@@ -150,7 +150,7 @@ productdefine/common
4. 修改产品配置文件。
productdefine\common\products\rk3568.json中添加对应的hello部件,直接添加到原有部件后即可。
vendor\hihope\rk3568\config.json中添加对应的hello部件,直接添加到原有部件后即可。
```
"usb:usb_manager_native":{},
......
......@@ -19,9 +19,9 @@ applications/sample/hello
│ └── bundle.json
build
└── subsystem_config.json
productdefine/common
└── products
└── Hi3568DV300.json
vendor/hisilicon
└── Hi3516DV300
└── config.json
```
......@@ -151,7 +151,7 @@ productdefine/common
4. 修改产品配置文件。
productdefine/common/products/Hi3516DV300.json中添加对应的hello部件,直接添加到原有部件后即可。
vendor\hisilicon\Hi3516DV300\config.json中添加对应的hello部件,直接添加到原有部件后即可。
```
......
......@@ -18,9 +18,9 @@ applications/sample/hello
│ └── bundle.json
build
└── subsystem_config.json
productdefine/common
└── products
└── rk3568.json
vendor/hihope
└── rk3568
└── config.json
```
......@@ -149,7 +149,7 @@ productdefine/common
4. 修改产品配置文件。
productdefine/common/products/rk3568.json中添加对应的hello部件,直接添加到原有部件后即可。
vendor\hihope\rk3568\config.json中添加对应的hello部件,直接添加到原有部件后即可。
```
"usb:usb_manager_native":{},
......
......@@ -211,7 +211,7 @@ OpenHarmony侧的编译构建流程主要包括编译命令行解析,调用gn
- test_list:组件中对应模块的测试用例;
2. 将组件添加到产品配置中。
在产品的配置中添加组件,产品对应的配置文件:productdefine/common/products/{product-name}.json。
在产品的配置中添加组件,产品对应的配置文件://vendor/{product_company}/{product-name}/config.json。
在产品配置文件中添加 "subsystem_examples:partA",表示该产品中会编译并打包partA到版本中。
......@@ -370,7 +370,7 @@ ohos_shared_library("module2") {
ohos.build文件包含两个部分,第一部分subsystem说明了子系统的名称,parts定义了该子系统包含的部件,要添加一个部件,需要把该部件对应的内容添加进parts中去。添加的时候需要指明该部件包含的模块module_list,假如有提供给其它部件的接口,需要在inner_kits中说明,假如有测试用例,需要在test_list中说明,inner_kits与test_list没有也可以不添加。
3.productdefine/common/products目录下的产品配置文件(json格式)中添加对应的部件,直接添加到原有部件后即可。
3.//vendor/{product_company}/{product-name}/config.json中添加对应的部件,直接添加到原有部件后即可。
```
{
......@@ -400,7 +400,7 @@ ohos_shared_library("module2") {
该文件定义了有哪些子系统以及这些子系统所在文件夹路径,添加子系统时需要说明子系统path与name,分别表示子系统路径和子系统名。
4.productdefine/common/products目录下的产品配置如Hi3516DV300.json中添加对应的部件,直接添加到原有部件后即可。
4.//vendor/{product_company}/{product-name}目录下的产品配置如product-name是Hi3516DV300时,在config.json中添加对应的部件,直接添加到原有部件后即可。
```
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册