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

!12517 FIX:更新文档中init仓名

Merge pull request !12517 from cheng_jinsong/1214_init
......@@ -211,7 +211,7 @@ The HDF-based driver development involves driver implementation, write of the dr
>
> - If you need to set **uid** and **gid** to **system** or **root** due to service requirements, contact security experts for review.
>
> - The process UIDs are configured in **base/startup/init_lite/services/etc/passwd**, and the process GIDs are configured in **base/startup/init_lite/services/etc/group**. For details, see [Adding a System Service User Group]( https://gitee.com/openharmony/startup_init_lite/wikis).
> - The process UIDs are configured in **base/startup/init/services/etc/passwd**, and the process GIDs are configured in **base/startup/init/services/etc/group**. For details, see [Adding a System Service User Group]( https://gitee.com/openharmony/startup_init_lite/wikis).
>
> - The **caps** value is in the caps = ["xxx"] format. To configure **CAP_DAC_OVERRIDE**, set this parameter to **caps = ["DAC_OVERRIDE"]**. Do not set it to **caps = ["CAP_DAC_OVERRIDE"]**.
>
......
......@@ -161,7 +161,7 @@ OpenHarmony-3.0-LTS
**Solution**
1. For case 1, leave **caps** unspecified.
2. For case 2, correctly configure **caps** by referring to the definition of the **capStrCapNum** data structure in **base/startup/init_lite/services/init/init_capability.c**.
2. For case 2, correctly configure **caps** by referring to the definition of the **capStrCapNum** data structure in **base/startup/init/services/init/init_capability.c**.
### Sandbox Not Enabled
......@@ -175,7 +175,7 @@ None.
**Solution**
Set **const.sandbox** to **enable** in **base/startup/init_lite/services/etc/param/ohos.para**. For details, see [Sandbox Management](../subsystems/subsys-boot-init-sandbox.md).
Set **const.sandbox** to **enable** in **base/startup/init/services/etc/param/ohos.para**. For details, see [Sandbox Management](../subsystems/subsys-boot-init-sandbox.md).
### How to Check the Sandbox Mounting Status
......
......@@ -69,7 +69,7 @@ Based on the preceding process, the recommended verification procedure is as fol
Create a root file system image **rootfs.img** by following instructions in [Building Procedures](../subsystems/subsys-build-all.md). As shown in the preceding figure, the startup process is closely related to the product configuration. You need to complete the following configuration when creating **rootfs.img**:
- Component configuration
In the product component configuration file ***vendor*/{*company*}/{*product*}/config.json**, configure the **init_lite** component of the startup subsystem and the **linux_4_1_9** component of the kernel subsystem.
In the product component configuration file ***vendor*/{*company*}/{*product*}/config.json**, configure the **init** component of the startup subsystem and the **linux_4_1_9** component of the kernel subsystem.
- System service configuration
Modify the system service configuration file ***vendor*/{*company*}/{*product*}/init_configs/init_xxx.cfg** to start the shell service.
- File system configuration
......
......@@ -158,7 +158,7 @@ Now start build, and check whether the kernel image is generated as expected.
When porting a new chip platform, you need to add the **/vendor/etc/init/init.{hardware}.cfg** file that contains the platform-level initialization configuration. This file is used to implement platform-level initialization, for example, installing the ko driver and configuring information on the related **/proc** nodes.
The code of the init process is stored in the **//base/startup/init_lite** directory. This process is the first process in the system and does not depend on other processes.
The code of the init process is stored in the **//base/startup/init** directory. This process is the first process in the system and does not depend on other processes.
For details about how to develop the initialization configuration file, see [Startup](../subsystems/subsys-boot-overview.md).
......
......@@ -39,7 +39,7 @@ If you need to add a configuration file, define its content as you want and copy
For the standard system:
```
ohos_prebuilt_etc("misc.cfg") {
source = "//base/startup/init_lite/services/etc/misc.cfg"
source = "//base/startup/init/services/etc/misc.cfg"
relative_install_dir = "init"
part_name = "init"
}
......
......@@ -98,7 +98,7 @@ A job is a command set, where you can manage the commands to be executed. A maxi
mount fileSystemType src dst flags data<br>Example:<br>mount vfat /dev/mmcblk0 /sdc rw,umask=000<br>mount jffs2 /dev/mtdblock3 /storage nosuid
</td>
<td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
Mounts devices. Every two parameters must be separated by only one space. <br>For details about <strong>flags</strong>, see the <strong>mountFlagMap[]</strong> array of the <strong>mountFlagMap</strong> function in <strong>base/startup/init_lite/services/init/init_common_cmds.c</strong>. The <strong>data</strong> field is optional.
Mounts devices. Every two parameters must be separated by only one space. <br>For details about <strong>flags</strong>, see the <strong>mountFlagMap[]</strong> array of the <strong>mountFlagMap</strong> function in <strong>base/startup/init/services/init/init_common_cmds.c</strong>. The <strong>data</strong> field is optional.
</td>
<td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
Small and standard systems
......@@ -294,7 +294,7 @@ A job is a command set, where you can manage the commands to be executed. A maxi
setrlimit resource <i>curValue</i> <i>maxValue</i><br>Example:<br>setrlimit RLIMIT_CPU 10 100
</td>
<td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
Sets resource usage restrictions. <br>For details, see the <strong>resource[]</strong> array of the <strong>DoSetrlimit</strong> function in <strong>base/startup/init_lite/services/init/init_common_cmds.c</strong>.
Sets resource usage restrictions. <br>For details, see the <strong>resource[]</strong> array of the <strong>DoSetrlimit</strong> function in <strong>base/startup/init/services/init/init_common_cmds.c</strong>.
</td>
<td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
Small and standard systems
......
......@@ -65,7 +65,7 @@ typedef struct {
2. Modify the JSON file configuration of the sandbox.
- Go to the **/system/etc/sandbox/** directory, and run **cat system-sandbox.json** and **cat chipset-sandbox.json**.
If you are using a 64-bit system, run **cat system-sandbox64.json** and **cat chipset-sandbox64.json** instead.
- Modify the sandbox configuration files in the **base/startup/init_lite/interfaces/innerkits/sandbox** directory. After that, restart the system.
- Modify the sandbox configuration files in the **base/startup/init/interfaces/innerkits/sandbox** directory. After that, restart the system.
### Development Example
Sandbox JSON File Configuration
......
......@@ -247,16 +247,16 @@ You can set specific system parameters as needed to meet your service demand.
​ On a standard system, use the <strong>ohos_prebuilt_para</strong> template to install the configuration file to the <strong>/etc/param/</strong> directory. The following is an example of the GN script:
```go
import("//base/startup/init_lite/services/etc/param/param_fixer.gni")
import("//base/startup/init/services/etc/param/param_fixer.gni")
ohos_prebuilt_para("ohos.para") {
source = "//base/startup/init_lite/services/etc/ohos.para"
source = "//base/startup/init/services/etc/ohos.para"
part_name = "init"
module_install_dir = "etc/param"
}
ohos_prebuilt_para("ohos.para.dac") {
source = "//base/startup/init_lite/services/etc/ohos.para.dac"
source = "//base/startup/init/services/etc/ohos.para.dac"
part_name = "init"
module_install_dir = "etc/param"
}
......@@ -265,24 +265,24 @@ You can set specific system parameters as needed to meet your service demand.
On a small system, run the <strong>copy</strong> command to copy the corresponding system parameter definition file to the <strong>system/etc/param</strong> directory.
```go
copy("ohos.para") {
sources = [ "//base/startup/init_lite/services/etc/param/ohos.para" ]
sources = [ "//base/startup/init/services/etc/param/ohos.para" ]
outputs = [ "$root_out_dir/system/etc/param/ohos.para" ]
}
copy("ohos.para.dac") {
sources = [ "//base/startup/init_lite/services/etc/param/ohos.para.dac" ]
sources = [ "//base/startup/init/services/etc/param/ohos.para.dac" ]
outputs = [ "$root_out_dir/system/etc/param/ohos.para.dac" ]
}
```
On a mini system, convert all defined default system parameters into header files through **action** and compile them into the system.
```go
action("lite_const_param_to") {
script = "//base/startup/init_lite/scripts/param_cfg_to_code.py"
script = "//base/startup/init/scripts/param_cfg_to_code.py"
args = [
"--source",
rebase_path(
"//base/startup/init_lite/services/etc_lite/param/ohos_const/ohospara"),
"//base/startup/init/services/etc_lite/param/ohos_const/ohospara"),
"--dest_dir",
rebase_path("$root_out_dir/gen/init_lite/"),
rebase_path("$root_out_dir/gen/init/"),
"--priority",
"0",
]
......
......@@ -53,7 +53,7 @@ The Startup subsystem consists of the following modules:
| -------- | -------- |
| base/startup/appspawn_lite | Small-system devices (reference memory ≥ 1 MiB), for example, Hi3516D V300 and Hi3518E V300|
| base/startup/bootstrap_lite | Mini-system devices (reference memory ≥ 128 KiB), for example, Hi3861 V100|
| base/startup/init_lite | Small-system devices (reference memory ≥ 1 MiB), for example, Hi3516D V300 and Hi3518E V300|
| base/startup/init | Small-system devices (reference memory ≥ 1 MiB), for example, Hi3516D V300 and Hi3518E V300|
| base/startup/syspara_lite | - Mini-system devices (reference memory ≥ 128 KiB), for example, Hi3861 V100<br>- Small-system devices (reference memory ≥ 1 MiB), for example, Hi3516D V300 and Hi3518E V300|
- init module
......
......@@ -39,7 +39,7 @@ The startup subsystem is responsible for starting key system processes and servi
| base/startup/appspawn_lite | appspawn module of the Lite edition for spawning application processes. It receives Ability Manager Service (AMS) messages via IPC, parses the messages, starts application processes based on the parsing result, and grants permissions to them. | Platforms using the LiteOS Cortex-A kernel |
| base/startup/appspawn_standard | appspawn module of the Standard version for spawning application processes. It receives Ability Manager Service (AMS) messages via IPC, parses the messages, starts application processes based on the parsing result, and grants permissions to them. | Platforms using the Linux kernel |
| base/startup/bootstrap_lite | bootstrap module for starting all services except core system services. | Platforms using the LiteOS Cortex-M kernel |
| base/startup/init_lite | init_lite module for implementing the init process, which is the first user-space process loaded after the kernel is initialized. Upon startup, the process parses the configuration file in **/etc/init.cfg**. Based on the parsing result, the process then starts other key system processes and grants required permissions to them. | Platforms using the LiteOS Cortex-A or Linux kernel |
| base/startup/init | init module for implementing the init process, which is the first user-space process loaded after the kernel is initialized. Upon startup, the process parses the configuration file in **/etc/init.cfg**. Based on the parsing result, the process then starts other key system processes and grants required permissions to them. | Platforms using the LiteOS Cortex-A or Linux kernel |
| base/startup/syspara_lite | syspara module that provides APIs to obtain device information, including the product name, brand name, category name, and manufacturer name. | All platforms |
......@@ -60,7 +60,7 @@ base/startup/
├── bootstrap_lite # bootstrap module
│ └── services
│ └── source # Source files
├── init_lite # init module
├── init # init module
│ ├── initsync # Source files
│ ├── interfaces # External APIs
│ └── services
......
......@@ -209,7 +209,7 @@ HDF(Hardware Driver Foundation)框架以组件化的驱动模型作为核心
>
> - 如果普通用户权限不能满足业务要求,需要把uid、gid定义为system或者root权限时,请找安全专家进行评审。
>
> - 进程的uid在文件**base/startup/init_lite/services/etc/passwd**中配置,进程的gid在文件**base/startup/init_lite/services/etc/group**中配置,进程uid和gid配置参考:[系统服务用户组添加方法](https://gitee.com/openharmony/startup_init_lite/wikis)。
> - 进程的uid在文件**base/startup/init/services/etc/passwd**中配置,进程的gid在文件**base/startup/init/services/etc/group**中配置,进程uid和gid配置参考:[系统服务用户组添加方法](https://gitee.com/openharmony/startup_init_lite/wikis)。
>
> - caps值:格式为caps = ["xxx"],如果要配置CAP_DAC_OVERRIDE,此处需要填写caps = ["DAC_OVERRIDE"],不能填写为caps = ["CAP_DAC_OVERRIDE"]。
>
......
......@@ -161,7 +161,7 @@ OpenHarmony-3.0-LTS
**解决办法**
1. 内核不支持, 不需要配置caps。
2. 内核支持,cfg文件中caps配置不正确,导致在init中解析的时候,解析失败,参考base/startup/init_lite/services/init/init_capability.c中,capStrCapNum数据结构的定义,正确配置caps。
2. 内核支持,cfg文件中caps配置不正确,导致在init中解析的时候,解析失败,参考base/startup/init/services/init/init_capability.c中,capStrCapNum数据结构的定义,正确配置caps。
### 打开沙盒功能
......@@ -175,7 +175,7 @@ OpenHarmony-3.0-LTS
**解决方法**
在base/startup/init_lite/services/etc/param/ohos.para中配置const.sandbox=enable。具体参考[沙盒指导](../subsystems/subsys-boot-init-sandbox.md)
在base/startup/init/services/etc/param/ohos.para中配置const.sandbox=enable。具体参考[沙盒指导](../subsystems/subsys-boot-init-sandbox.md)
### 查看服务中沙盒的挂载状态
......
......@@ -444,7 +444,7 @@ vendor
#### 启动恢复子系统适配
启动恢复子系统需要适配`bootstrap_lite``syspara_lite``appspawn_lite``init_lite`四个部件。请在`vendor/bearpi/bearpi_hm_micro/config.json`中新增对应的配置选项。
启动恢复子系统需要适配`bootstrap_lite``syspara_lite``appspawn_lite``init`四个部件。请在`vendor/bearpi/bearpi_hm_micro/config.json`中新增对应的配置选项。
```
{
......@@ -453,7 +453,7 @@ vendor
{ "component": "syspara_lite", "features":[] },
{ "component": "bootstrap_lite", "features":[] },
{ "component": "appspawn_lite", "features":[] },
{ "component": "init_lite", "features":[] }
{ "component": "init", "features":[] }
]
},
```
......
......@@ -39,7 +39,7 @@ init进程启动时,首先完成系统初始化工作,然后开始解析配
标准系统下:
```
ohos_prebuilt_etc("misc.cfg") {
source = "//base/startup/init_lite/services/etc/misc.cfg"
source = "//base/startup/init/services/etc/misc.cfg"
relative_install_dir = "init"
part_name = "init"
}
......
......@@ -37,7 +37,7 @@ job就是命令集合,jobs管理就是对要执行的一组命令集合进行
| mkdir | mkdir 目标文件夹 [mode] [owner] [group]<br/>如:mkdir /storage/myDirectory<br>mkdir /storage/myDirectory 0755 root root| 创建文件夹命令,mkdir和目标文件夹之间有且只能有一个空格。<B><br>系统类型:小型系统和标准系统 |
| chmod | chmod&nbsp;权限&nbsp;目标<br/>如:chmod&nbsp;0600&nbsp;/storage/myFile.txt<br/>chmod&nbsp;0750&nbsp;/storage/myDir | 修改权限命令,chmod权限目标之间间隔有且仅有一个空格,权限必须为0xxx格式。<B><br>系统类型:小型系统和标准系统|
| chown | chown&nbsp;uid&nbsp;gid&nbsp;目标<br/>如:chown&nbsp;900&nbsp;800&nbsp;/storage/myDir<br/>chown&nbsp;100&nbsp;100&nbsp;/storage/myFile.txt | 修改属组命令,chown&nbsp;uid&nbsp;gid目标之间间隔有且仅有一个空格。<B><br>系统类型:小型系统和标准系统 |
| mount | mount&nbsp;fileSystemType&nbsp;src&nbsp;dst&nbsp;flags&nbsp;[data]<br/>如:mount&nbsp;vfat&nbsp;/dev/mmcblk0&nbsp;/sdc&nbsp;rw,umask=000<br/>mount&nbsp;jffs2&nbsp;/dev/mtdblock3&nbsp;/storage&nbsp;nosuid | 挂载命令,各参数之间有且仅有一个空格。flags参考base/startup/init_lite/services/init/init_common_cmds.c中mountFlagMap函数mountFlagMap[],data为可选字段。<B><br>系统类型:小型系统和标准系统 |
| mount | mount&nbsp;fileSystemType&nbsp;src&nbsp;dst&nbsp;flags&nbsp;[data]<br/>如:mount&nbsp;vfat&nbsp;/dev/mmcblk0&nbsp;/sdc&nbsp;rw,umask=000<br/>mount&nbsp;jffs2&nbsp;/dev/mtdblock3&nbsp;/storage&nbsp;nosuid | 挂载命令,各参数之间有且仅有一个空格。flags参考base/startup/init/services/init/init_common_cmds.c中mountFlagMap函数mountFlagMap[],data为可选字段。<B><br>系统类型:小型系统和标准系统 |
| start | start&nbsp;serviceName<br/>如:start&nbsp;foundation| 启动服务命令,start后面跟着service名称,该service名称必须能够在services数组中找到。<B><br>系统类型:小型系统和标准系统 |
| export | export key value<br>如:export TEST /data/test | 设置环境变量命令。后面跟两个参数,第一个参数是环境变量名,第二个参数是环境变量值。<B><br>系统类型:小型系统和标准系统 |
| rm | rm filename<br>如:rm /data/testfile | 删除文件命令。后面跟一个参数,即文件的绝对路径。<B><br>系统类型:小型系统和标准系统 |
......
......@@ -64,7 +64,7 @@ typedef struct {
2. 修改沙盒JSON文件配置
- 查看系统组件沙盒配置文件、芯片组件沙盒配置文件,进入/system/etc/sandbox/ 目录下,cat system-sandbox.json ,cat chipset-sandbox.json; 直接修改对应沙盒配置文件, 重新启动。
对于64位系统,cat system-sandbox64.json ,cat chipset-sandbox64.json。
- 代码路径下:base/startup/init_lite/interfaces/innerkits/sandbox 修改对应沙盒配置文件。
- 代码路径下:base/startup/init/interfaces/innerkits/sandbox 修改对应沙盒配置文件。
### 开发实例
沙盒JSON文件配置<a name = "sandbox"></a>
......
......@@ -245,16 +245,16 @@ startup_init_param=40960
​ 在标准系统上通过ohos_prebuilt_para模版安装配置文件到到/etc/param/目录下,GN脚本示例如下:
```go
import("//base/startup/init_lite/services/etc/param/param_fixer.gni")
import("//base/startup/init/services/etc/param/param_fixer.gni")
ohos_prebuilt_para("ohos.para") {
source = "//base/startup/init_lite/services/etc/ohos.para"
source = "//base/startup/init/services/etc/ohos.para"
part_name = "init"
module_install_dir = "etc/param"
}
ohos_prebuilt_para("ohos.para.dac") {
source = "//base/startup/init_lite/services/etc/ohos.para.dac"
source = "//base/startup/init/services/etc/ohos.para.dac"
part_name = "init"
module_install_dir = "etc/param"
}
......@@ -263,24 +263,24 @@ startup_init_param=40960
在小系统上,通过copy命令,把对应的系统参数定义文件拷贝到system/etc/param目录下
```go
copy("ohos.para") {
sources = [ "//base/startup/init_lite/services/etc/param/ohos.para" ]
sources = [ "//base/startup/init/services/etc/param/ohos.para" ]
outputs = [ "$root_out_dir/system/etc/param/ohos.para" ]
}
copy("ohos.para.dac") {
sources = [ "//base/startup/init_lite/services/etc/param/ohos.para.dac" ]
sources = [ "//base/startup/init/services/etc/param/ohos.para.dac" ]
outputs = [ "$root_out_dir/system/etc/param/ohos.para.dac" ]
}
```
在mini系统上,通过action把所有定义的默认系统参数转化成头文件,并编译到系统中
```go
action("lite_const_param_to") {
script = "//base/startup/init_lite/scripts/param_cfg_to_code.py"
script = "//base/startup/init/scripts/param_cfg_to_code.py"
args = [
"--source",
rebase_path(
"//base/startup/init_lite/services/etc_lite/param/ohos_const/ohospara"),
"//base/startup/init/services/etc_lite/param/ohos_const/ohospara"),
"--dest_dir",
rebase_path("$root_out_dir/gen/init_lite/"),
rebase_path("$root_out_dir/gen/init/"),
"--priority",
"0",
]
......
......@@ -48,7 +48,7 @@
| -------- | -------- |
| base/startup/appspawn_lite | 小型系统设备(参考内存≥1MB),如Hi3516DV300&nbsp;、Hi3518EV300 |
| base/startup/bootstrap_lite | 轻量系统设备(参考内存≥128KB),如Hi3861V100 |
| base/startup/init_lite | 小型系统设备(参考内存≥1MB),如Hi3516DV300、Hi3518EV300 |
| base/startup/init | 小型系统设备(参考内存≥1MB),如Hi3516DV300、Hi3518EV300 |
| base/startup/syspara_lite | -&nbsp;轻量系统设备(参考内存≥128KB),如Hi3861V100<br/>-&nbsp;小型系统设备(参考内存≥1MB),如Hi3516DV300、Hi3518EV300 |
- init启动引导组件:
......
......@@ -66,7 +66,7 @@
<td class="cellrowborder" valign="top" width="13.919999999999998%" headers="mcps1.2.4.1.3 ">LiteOS-M内核平台
</td>
</tr>
<tr id="row6978201031415"><td class="cellrowborder" align="left" valign="top" width="20.880000000000003%" headers="mcps1.2.4.1.1 "><p id="p117935599130"><a name="p117935599130"></a><a name="p117935599130"></a>base/startup/init_lite</p>
<tr id="row6978201031415"><td class="cellrowborder" align="left" valign="top" width="20.880000000000003%" headers="mcps1.2.4.1.1 "><p id="p117935599130"><a name="p117935599130"></a><a name="p117935599130"></a>base/startup/init</p>
</td>
<td class="cellrowborder" valign="top" width="65.2%" headers="mcps1.2.4.1.2 "><p id="p0793185971316"><a name="p0793185971316"></a><a name="p0793185971316"></a>init组件,init进程,内核完成初始化后加载的第一个用户态进程,启动后解析/etc/init.cfg配置文件,并根据解析结果拉起其他系统关键进程,同时分别赋予其对应权限。</p>
</td>
......@@ -97,7 +97,7 @@ base/startup/
├── bootstrap_lite # 启动引导组件
│ └── services
│ └── source # 启动引导组件源文件目录
├── init_lite # init组件
├── init # init组件
│ ├── initsync # 分阶段启动源文件目录
│ ├── interfaces # 对外接口目录
│ └── services
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册