Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
8af1487d
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
8af1487d
编写于
7月 07, 2022
作者:
M
Mupceet
提交者:
Gitee
7月 07, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update zh-cn/device-dev/subsystems/subsys-boot-init-jobs.md.
Signed-off-by:
N
Mupceet
<
laiguizhong@huawei.com
>
上级
243b0b51
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
849 addition
and
60 deletion
+849
-60
zh-cn/device-dev/subsystems/subsys-boot-init-jobs.md
zh-cn/device-dev/subsystems/subsys-boot-init-jobs.md
+849
-60
未找到文件。
zh-cn/device-dev/subsystems/subsys-boot-init-jobs.md
浏览文件 @
8af1487d
...
...
@@ -32,73 +32,862 @@ job就是命令集合,jobs管理就是对要执行的一组命令集合进行
### 参数说明
**表1**
命令集说明
| 命令 | 命令格式和示例 | 说明 | 支持系统类型 |
| -------- | -------- | -------- | -------- |
| mkdir | mkdir
目标文件夹
<br/>
如:mkdir
/storage/myDirectory | 创建文件夹命令,mkdir和目标文件夹之间有且只能有一个空格。 | 小型系统和标准系统 |
| chmod | chmod
权限
目标
<br/>
如:chmod
0600
/storage/myFile.txt
<br/>
chmod
0750
/storage/myDir | 修改权限命令,chmod权限目标之间间隔有且仅有一个空格,权限必须为0xxx格式。 | 小型系统和标准系统|
| chown | chown
uid
gid
目标
<br/>
如:chown
900
800
/storage/myDir
<br/>
chown
100
100
/storage/myFile.txt | 修改属组命令,chown
uid
gid目标之间间隔有且仅有一个空格。 | 小型系统和标准系统 |
| mount | mount
fileSystemType
src
dst
flags
data
<br/>
如:mount
vfat
/dev/mmcblk0
/sdc
rw,umask=000
<br/>
mount
jffs2
/dev/mtdblock3
/storage
nosuid | 挂载命令,各参数之间有且仅有一个空格。flags当前仅支持nodev、noexec、nosuid、rdonly,data为可选字段。 | 小型系统和标准系统 |
| start | start
serviceName
<br/>
如:start
foundation
<br/>
start
shell | 启动服务命令,start后面跟着service名称,该service名称必须能够在services数组中找到。 | 小型系统和标准系统 |
| export | export key value
<br>
如:export TEST /data/test | 设置环境变量命令。后面跟两个参数,第一个参数是环境变量名,第二个参数是环境变量值。| 小型系统和标准系统 |
| rm | rm filename
<br>
如:rm /data/testfile | 删除文件命令。后面跟一个参数,即文件的绝对路径。 | 小型系统和标准系统 |
| rmdir | rmdir dirname
<br>
如:rmdir /data/testdir | 删除目录命令。后面跟一个参数,即目录的绝对路径。 | 小型系统和标准系统 |
| write | write filename value
<br>
如:write /data/testfile 0 | 写文件命令。后面跟两个参数,第一个参数是文件的绝对路径,第二个参数是要写入文件的字符串。 | 小型系统和标准系统 |
| stop | stop servicename
<br>
如:stop console | 关闭服务命令。后面跟一个参数,即要关闭的服务名。 | 小型系统和标准系统 |
| copy | copy oldfile newfile
<br>
如:copy /data/old /data/new | 拷贝文件命令。后面跟两个参数,第一个参数是原文件绝对路径,第二个参数是新文件绝对路径。 | 小型系统和标准系统 |
| reset | reset servicename
<br>
如:reset console | 重启服务命令。后面跟一个参数,即要重启的服务名。目前reset命令的策略是,如果一个服务没有启动,则该命令会将其拉起,如果一个服务处于运行状态,则该命令会将其关闭后重启。| 小型系统和标准系统 |
| reboot | reboot (subsystem)
<br>
如:reboot updater | 重启系统命令。后面可以跟一个参数,也可以没有参数,当没有参数时执行该命令,将会使设备重启到当前系统,当后面跟参数时,参数应当是子系统的名字,例如,reboot updater,将会重启进入updater子系统。 | 小型系统和标准系统 |
| sleep | sleep time
<br>
如:sleep 5 | 睡眠命令。后面可以跟一个参数,该参数是睡眠时间。 | 小型系统和标准系统 |
| domainname | domainname name
<br>
如:domainname localdomain | 设置域名。 | 小型系统和标准系统 |
| hostname | hostname name
<br>
如:hostname localhost | 设置主机名命令。 | 小型系统和标准系统 |
| wait | wait PID
<br>
如:wait pid | 等待命令。| 小型系统和标准系统 |
| setrlimit | setrlimit resource curValue maxValue
<br>
如:| 设定资源使用限制命令。 | 小型系统和标准系统 |
| write | write path content
<br>
如:write /proc/sys/kernel/sysrq 0 | 写文件命令。 | 小型系统和标准系统 |
| exec | exec 可执行文件路径 可执行文件传的参数
<br>
如:exec /system/bin/udevadm trigger | 系统调用命令。 | 小型系统和标准系统 |
| mknode |mknod name { b
\|
c } Major Minor
<br>
如mknod path b 0644 1 9| 建立一个目录项和一个特殊文件的对应索引节点。 |标准系统 |
| makedev | makedev major minor
<br>
如:makedev -v update | 创建静态的设备节点命令,通常位于/dev目录下。| 标准系统 |
| symlink | symlink path1 path2
<br>
如:symlink /proc/self/fd/0 /dev/stdin | 符号链接命令。 | 标准系统 |
| trigger | trigger jobName
<br>
如:trigger early-fs | 触发job执行的命令。 | 标准系统 |
| insmod | insmod ko文件
<br>
如:insmod xxx.ko| 内核模块文件载入命令。 | 标准系统 |
| setparam | setparam paramname paramvalue
<br>
如:setparam sys.usb.config hdc| 设置系统参数。| 标准系统 |
| load_persist_params | load persist params
<br>
如:load_persist_params
| 加载persist参数。load_persist_params命令后有且仅有一个空格。 | 标准系统 |
| load_param | load params
<br>
如:load_param /data/test.normal.para| 将文件里的param加载到内存。| 标准系统 |
| load_access_token_id | 如:load_access_token_id
| 将access token信息写入data/service/el0/access_token/nativetoken.json文件,load_access_token_id后有且只有一个空格。| 标准系统 |
| ifup | ifup 激活网络接口
<br>
如:ifup eth0 | 激活指定的网络接口。| 标准系统 |
| mount_fstab | mount_fstab fstab.test
<br>
如:mount_fstab /vendor/etc/fstab.test| 按照fstab挂载分区的命令。 | 标准系统 |
| umount_fstab | umount_fstab fstab.test
<br>
如:umount_fstab /vendor/etc/fstab.test | 按照fstab卸载分区的命令。 | 标准系统 |
| restorecon | restorecon file or dir
<br>
如:restorecon /file | 重新加载selinux 的context。 | 标准系统 |
| stopAllServices | stopAllServices [bool]
<br>
如:stopAllServices false 或 stopAllServices | 停止所有服务。 | 标准系统 |
| umount |umount path
<br>
如:umount /vendor | 卸载已经挂载的硬件设备 。 | 标准系统 |
| sync | 如:sync
| 同步写入数据到磁盘。sync后有且仅有一个空格。| 标准系统 |
| timer_start | timer_start serviceName
<br>
如:timer_start console | 启动服务计时器。 | 标准系统 |
| timer_stop | timer_stop serviceName
<br>
如:timer_stop console | 停止服务计时器。 | 标准系统 |
| init_global_key | init_global_key path 如:init_global_key /data | data分区文件加密key初始化。| 标准系统 |
| init_main_user | 如:init_main_user| 主用户目录加密。| 标准系统 |
| mkswap | mkswap file
<br>
如:mkswap /swapfile1 | 在一个文件或者设备上建立交换分区。 | 标准系统 |
| swapon | swapon file
<br>
如:swapon /swapfile1| 激活交换空间。 | 标准系统 |
| loadcfg | loadcfg
filePath
<br/>
如:loadcfg
/patch/fstab.cfg | 加载其他cfg文件命令。后面跟着的目标文件大小不得超过50KB,且目前仅支持加载/patch/fstab.cfg,其他文件路径和文件名均不支持。/patch/fstab.cfg文件的每一行都是一条命令,命令类型和格式必须符合本表格描述,命令条数不得超过20条。 | 小型系统 |
<table
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
width=
"770"
style=
"border-collapse: collapse;table-layout:fixed;width:578pt;border-spacing: 0px;font-variant-ligatures: normal; font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px; text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial"
>
<tbody>
<tr
height=
"39"
style=
"height:18.0pt"
>
<th
height=
"24"
class=
"xl6521952"
width=
"140"
style=
"height:18.0pt;width:105pt"
>
命令
</td>
<th
class=
"xl6521952"
width=
"215"
style=
"border-left:none;width:161pt"
>
命令格式和示例
</td>
<th
class=
"xl6521952"
width=
"225"
style=
"border-left:none;width:169pt"
>
说明
</td>
<th
class=
"xl6521952"
width=
"190"
style=
"border-left:none;width:143pt"
>
支持系统类型
</td>
</tr>
<tr
height=
"231"
style=
"height:173.25pt"
>
<td
height=
"231"
class=
"xl6621952"
width=
"140"
style=
"height:173.25pt;border-top: none;width:105pt"
>
mkdir
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
mkdir
目标文件夹
<br>
如:mkdir
/storage/myDirectory
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
创建文件夹命令,mkdir和目标文件夹之间有且只能有一个空格。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"277"
style=
"mso-height-source:userset;height:207.75pt"
>
<td
height=
"277"
class=
"xl6621952"
width=
"140"
style=
"height:207.75pt;border-top: none;width:105pt"
>
chmod
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
chmod
权限
目标
<br>
如:chmod
0600
/storage/myFile.txt
<br>
chmod
0750
/storage/myDir
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
修改权限命令,chmod权限目标之间间隔有且仅有一个空格,权限必须为0xxx格式。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"295"
style=
"mso-height-source:userset;height:221.25pt"
>
<td
height=
"295"
class=
"xl6621952"
width=
"140"
style=
"height:221.25pt;border-top: none;width:105pt"
>
chown
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
chown
uid
gid
目标
<br>
如:chown
900
800
/storage/myDir
<br>
chown
100
100
/storage/myFile.txt
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
修改属组命令,chown
uid
gid目标之间间隔有且仅有一个空格。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"355"
style=
"mso-height-source:userset;height:266.25pt"
>
<td
height=
"355"
class=
"xl6621952"
width=
"140"
style=
"height:266.25pt;border-top: none;width:105pt"
>
mount
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
mount
fileSystemType
src
dst
flags
data
<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"
>
挂载命令,各参数之间有且仅有一个空格。flags当前仅支持nodev、noexec、nosuid、rdonly,data为可选字段。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"238"
style=
"mso-height-source:userset;height:178.5pt"
>
<td
height=
"238"
class=
"xl6621952"
width=
"140"
style=
"height:178.5pt;border-top: none;width:105pt"
>
start
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
start
serviceName
<br>
如:start
foundationstart
shell
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
启动服务命令,start后面跟着service名称,该service名称必须能够在services数组中找到。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"264"
style=
"mso-height-source:userset;height:198.0pt"
>
<td
height=
"264"
class=
"xl6621952"
width=
"140"
style=
"height:198.0pt;border-top: none;width:105pt"
>
export
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
export key value
<br>
如:export TEST /data/test
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
设置环境变量命令。后面跟两个参数,第一个参数是环境变量名,第二个参数是环境变量值。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"185"
style=
"height:138.75pt"
>
<td
height=
"185"
class=
"xl6621952"
width=
"140"
style=
"height:138.75pt;border-top: none;width:105pt"
>
rm
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
rm filename
<br>
如:rm /data/testfile
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
删除文件命令。后面跟一个参数,即文件的绝对路径。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"185"
style=
"height:138.75pt"
>
<td
height=
"185"
class=
"xl6621952"
width=
"140"
style=
"height:138.75pt;border-top: none;width:105pt"
>
rmdir
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
rmdir dirname
<br>
如:rmdir /data/testdir
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
删除目录命令。后面跟一个参数,即目录的绝对路径。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"266"
style=
"mso-height-source:userset;height:199.5pt"
>
<td
height=
"266"
class=
"xl6621952"
width=
"140"
style=
"height:199.5pt;border-top: none;width:105pt"
>
write
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
write filename value
<br>
如:write /data/testfile 0
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
写文件命令。后面跟两个参数,第一个参数是文件的绝对路径,第二个参数是要写入文件的字符串。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"185"
style=
"height:138.75pt"
>
<td
height=
"185"
class=
"xl6621952"
width=
"140"
style=
"height:138.75pt;border-top: none;width:105pt"
>
stop
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
stop servicename
<br>
如:stop console
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
关闭服务命令。后面跟一个参数,即要关闭的服务名。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"280"
style=
"mso-height-source:userset;height:210.0pt"
>
<td
height=
"280"
class=
"xl6621952"
width=
"140"
style=
"height:210.0pt;border-top: none;width:105pt"
>
copy
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
copy oldfile newfile
<br>
如:copy /data/old /data/new
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
拷贝文件命令。后面跟两个参数,第一个参数是原文件绝对路径,第二个参数是新文件绝对路径。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"382"
style=
"mso-height-source:userset;height:286.5pt"
>
<td
height=
"382"
class=
"xl6621952"
width=
"140"
style=
"height:286.5pt;border-top: none;width:105pt"
>
reset
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
reset servicename
<br>
如:reset console
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
重启服务命令。后面跟一个参数,即要重启的服务名。目前reset命令的策略是,如果一个服务没有启动,则该命令会将其拉起,如果一个服务处于运行状态,则该命令会将其关闭后重启。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"363"
style=
"mso-height-source:userset;height:272.25pt"
>
<td
height=
"363"
class=
"xl6621952"
width=
"140"
style=
"height:272.25pt;border-top: none;width:105pt"
>
reboot
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
reboot (subsystem)
<br>
如:reboot updater
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
重启系统命令。后面可以跟一个参数,也可以没有参数,当没有参数时执行该命令,将会使设备重启到当前系统,当后面跟参数时,参数应当是子系统的名字,例如,reboot updater,将会重启进入updater子系统。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"185"
style=
"height:138.75pt"
>
<td
height=
"185"
class=
"xl6621952"
width=
"140"
style=
"height:138.75pt;border-top: none;width:105pt"
>
sleep
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
sleep time
<br>
如:sleep 5
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
睡眠命令。后面可以跟一个参数,该参数是睡眠时间。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"185"
style=
"height:138.75pt"
>
<td
height=
"185"
class=
"xl6621952"
width=
"140"
style=
"height:138.75pt;border-top: none;width:105pt"
>
domainname
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
domainname name
<br>
如:domainname localdomain
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
设置域名。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"185"
style=
"height:138.75pt"
>
<td
height=
"185"
class=
"xl6621952"
width=
"140"
style=
"height:138.75pt;border-top: none;width:105pt"
>
hostname
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
hostname name
<br>
如:hostname localhost
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
设置主机名命令。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"116"
style=
"height:87.0pt"
>
<td
height=
"116"
class=
"xl6621952"
width=
"140"
style=
"height:87.0pt;border-top: none;width:105pt"
>
wait
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
wait PID
<br>
如:wait pid
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
等待命令。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"185"
style=
"height:138.75pt"
>
<td
height=
"185"
class=
"xl6621952"
width=
"140"
style=
"height:138.75pt;border-top: none;width:105pt"
>
setrlimit
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
setrlimit resource curValue maxValue
<br>
如:setrlimit resource 10 100
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
设定资源使用限制命令。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"208"
style=
"height:156.0pt"
>
<td
height=
"208"
class=
"xl6621952"
width=
"140"
style=
"height:156.0pt;border-top: none;width:105pt"
>
write
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
write path content
<br>
如:write /proc/sys/kernel/sysrq 0
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
写文件命令。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"228"
style=
"mso-height-source:userset;height:171.0pt"
>
<td
height=
"228"
class=
"xl6621952"
width=
"140"
style=
"height:171.0pt;border-top: none;width:105pt"
>
exec
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
exec 可执行文件路径 可执行文件传的参数
<br>
如:exec /system/bin/udevadm trigger
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
系统调用命令。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"231"
style=
"height:173.25pt"
>
<td
height=
"231"
class=
"xl6621952"
width=
"140"
style=
"height:173.25pt;border-top: none;width:105pt"
>
mknode
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
mknod name { b | c } Major Minor
<br>
如:mknod path b 0644 1 9
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
建立一个目录项和一个特殊文件的对应索引节点。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"185"
style=
"height:138.75pt"
>
<td
height=
"185"
class=
"xl6621952"
width=
"140"
style=
"height:138.75pt;border-top: none;width:105pt"
>
makedev
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
makedev major minor
<br>
如:makedev -v update
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
创建静态的设备节点命令,通常位于/dev目录下。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"231"
style=
"height:173.25pt"
>
<td
height=
"231"
class=
"xl6621952"
width=
"140"
style=
"height:173.25pt;border-top: none;width:105pt"
>
symlink
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
symlink path1 path2
<br>
如:symlink /proc/self/fd/0 /dev/stdin
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
符号链接命令。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"139"
style=
"height:104.25pt"
>
<td
height=
"139"
class=
"xl6621952"
width=
"140"
style=
"height:104.25pt;border-top: none;width:105pt"
>
trigger
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
trigger jobName
<br>
如:trigger early-fs
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
触发job执行的命令。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"116"
style=
"height:87.0pt"
>
<td
height=
"116"
class=
"xl6621952"
width=
"140"
style=
"height:87.0pt;border-top: none;width:105pt"
>
insmod
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
insmod ko文件
<br>
如:insmod xxx.ko
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
内核模块文件载入命令。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"277"
style=
"height:207.75pt"
>
<td
height=
"277"
class=
"xl6621952"
width=
"140"
style=
"height:207.75pt;border-top: none;width:105pt"
>
setparam
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
setparam paramname paramvalue
<br>
如:setparam sys.usb.config hdc
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
设置系统参数。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"231"
style=
"height:173.25pt"
>
<td
height=
"231"
class=
"xl6621952"
width=
"140"
style=
"height:173.25pt;border-top: none;width:105pt"
>
load_persist_params
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
load persist params
<br>
如:load_persist_params
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
加载persist参数。load_persist_params命令后有且仅有一个空格。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"208"
style=
"height:156.0pt"
>
<td
height=
"208"
class=
"xl6621952"
width=
"140"
style=
"height:156.0pt;border-top: none;width:105pt"
>
load_param
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
load params
<br>
如:load_param /data/test.normal.para
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
将文件里的param加载到内存。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"278"
style=
"mso-height-source:userset;height:208.5pt"
>
<td
height=
"278"
class=
"xl6621952"
width=
"140"
style=
"height:208.5pt;border-top: none;width:105pt"
>
load_access_token_id
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
如:load_access_token_id
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
将access token信息写入data/service/el0/access_token/nativetoken.json文件,load_access_token_id后有且只有一个空格。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"139"
style=
"height:104.25pt"
>
<td
height=
"139"
class=
"xl6621952"
width=
"140"
style=
"height:104.25pt;border-top: none;width:105pt"
>
ifup
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
ifup 激活网络接口
<br>
如:ifup eth0
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
激活指定的网络接口。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"208"
style=
"height:156.0pt"
>
<td
height=
"208"
class=
"xl6621952"
width=
"140"
style=
"height:156.0pt;border-top: none;width:105pt"
>
mount_fstab
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
mount_fstab fstab.test
<br>
如:mount_fstab /vendor/etc/fstab.test
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
按照fstab挂载分区的命令。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"208"
style=
"height:156.0pt"
>
<td
height=
"208"
class=
"xl6621952"
width=
"140"
style=
"height:156.0pt;border-top: none;width:105pt"
>
umount_fstab
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
umount_fstab fstab.test
<br>
如:umount_fstab /vendor/etc/fstab.test
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
按照fstab卸载分区的命令。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"162"
style=
"height:121.5pt"
>
<td
height=
"162"
class=
"xl6621952"
width=
"140"
style=
"height:121.5pt;border-top: none;width:105pt"
>
restorecon
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
restorecon file or dir
<br>
如:restorecon /file
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
重新加载selinux 的context。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"254"
style=
"height:190.5pt"
>
<td
height=
"254"
class=
"xl6621952"
width=
"140"
style=
"height:190.5pt;border-top: none;width:105pt"
>
stopAllServices
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
stopAllServices [bool]
<br>
如:stopAllServices false 或 stopAllServices
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
停止所有服务。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"162"
style=
"height:121.5pt"
>
<td
height=
"162"
class=
"xl6621952"
width=
"140"
style=
"height:121.5pt;border-top: none;width:105pt"
>
umount
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
umount path
<br>
如:umount /vendor
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
卸载已经挂载的硬件设备 。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"185"
style=
"height:138.75pt"
>
<td
height=
"185"
class=
"xl6621952"
width=
"140"
style=
"height:138.75pt;border-top: none;width:105pt"
>
sync
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
如:sync
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
同步写入数据到磁盘。sync后有且仅有一个空格。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"185"
style=
"height:138.75pt"
>
<td
height=
"185"
class=
"xl6621952"
width=
"140"
style=
"height:138.75pt;border-top: none;width:105pt"
>
timer_start
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
timer_start serviceName
<br>
如:timer_start console
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
启动服务计时器。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"185"
style=
"height:138.75pt"
>
<td
height=
"185"
class=
"xl6621952"
width=
"140"
style=
"height:138.75pt;border-top: none;width:105pt"
>
timer_stop
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
timer_stop serviceName
<br>
如:timer_stop console
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
停止服务计时器。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"162"
style=
"height:121.5pt"
>
<td
height=
"162"
class=
"xl6621952"
width=
"140"
style=
"height:121.5pt;border-top: none;width:105pt"
>
init_global_key
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
init_global_key path
<br>
如:init_global_key /data
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
data分区文件加密key初始化。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"70"
style=
"height:52.5pt"
>
<td
height=
"70"
class=
"xl6621952"
width=
"140"
style=
"height:52.5pt;border-top:none; width:105pt"
>
init_main_user
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
如:init_main_user
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
主用户目录加密。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"162"
style=
"height:121.5pt"
>
<td
height=
"162"
class=
"xl6621952"
width=
"140"
style=
"height:121.5pt;border-top: none;width:105pt"
>
mkswap
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
mkswap file
<br>
如:mkswap /swapfile1
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
在一个文件或者设备上建立交换分区。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"162"
style=
"height:121.5pt"
>
<td
height=
"162"
class=
"xl6621952"
width=
"140"
style=
"height:121.5pt;border-top: none;width:105pt"
>
swapon
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
swapon file
<br>
如:swapon /swapfile1
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
激活交换空间。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
标准系统
</td>
</tr>
<tr
height=
"384"
style=
"mso-height-source:userset;height:288.0pt"
>
<td
height=
"384"
class=
"xl6621952"
width=
"140"
style=
"height:288.0pt;border-top: none;width:105pt"
>
loadcfg
</td>
<td
class=
"xl6621952"
width=
"215"
style=
"border-top:none;border-left:none; width:161pt"
>
loadcfg
filePath
<br>
如:loadcfg
/patch/fstab.cfg
</td>
<td
class=
"xl6621952"
width=
"225"
style=
"border-top:none;border-left:none; width:169pt"
>
加载其他cfg文件命令。后面跟着的目标文件大小不得超过50KB,且目前仅支持加载/patch/fstab.cfg,其他文件路径和文件名均不支持。/patch/fstab.cfg文件的每一行都是一条命令,命令类型和格式必须符合本表格描述,命令条数不得超过20条。
</td>
<td
class=
"xl6621952"
width=
"190"
style=
"border-top:none;border-left:none; width:143pt"
>
小型系统
</td>
</tr>
<!--[endif]-->
</tbody>
</table>
### 接口说明
jobs管理属于init启动过程中的一环,是一个流程化的功能,是完全服务于init启动过程的,并不对其他组件提供任何功能接口,其运行逻辑契合cfg中命令组的管理,无法对其他类型管理提供帮助。下述主要介绍其在init当中的调用逻辑。
**表2 job解析接口说明**
| 函数名 | 入参 | 返回值 | 功能 | 支持系统类型 |
|:--------|:-----|:------|:-----|-----|
|void ParseAllJobs(const cJSON
*fileRoot)|const cJSON *
fileRoot|void|jobs解析总入口。| 小型系统和标准系统 |
|static void ParseJob(const cJSON
*jobItem, Job *
resJob)|const cJSON
*jobItem, Job *
resJob|void|校验job是否已存在,解析cmds下命令的功能。| 小型系统 |
|int GetCmdLinesFromJson(const cJSON
*root, CmdLines **cmdLines)|const cJSON *
root, CmdLines
**
cmdLines|int| 解析job中cmds命令。当前小型系统使用,标准系统由于涉及trigger功能和condition条件启动功能,并未使用该接口进行命令解析。| 小型系统和标准系统 |
|int ParseTriggerConfig(const cJSON
*fileRoot, int (*
checkJobValid)(const char
*jobName))|const cJSON *
fileRoot, int (
*checkJobValid)(const char *
jobName)|int|解析job中Trigger命令。| 标准系统 |
|static int ParseTrigger_(const TriggerWorkSpace
*workSpace, const cJSON *
triggerItem, int (
*checkJobValid)(const char *
jobName))|const TriggerWorkSpace
*workSpace, const cJSON *
triggerItem, int (
*checkJobValid)(const char *
jobName)|int|获取job名称,condition属性以及cmds命令组的功能,解析到的job以hash表的形式存储,而命令的保存则使用了队列结构。| 标准系统 |
<table
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
width=
"968"
style=
"border-collapse: collapse;table-layout:fixed;width:727pt;orphans: 2;widows: 2;-webkit-text-stroke-width: 0px; text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial; box-sizing: border-box;border-spacing: 0px;word-break:initial;font-variant-ligatures: normal; font-variant-caps: normal"
>
<tbody>
<tr
height=
"39"
style=
"height:29.25pt;box-sizing: border-box"
>
<th
height=
"39"
class=
"xl6320252"
width=
"249"
style=
"height:29.25pt;width:187pt"
>
函数名
</th>
<th
class=
"xl6420252"
width=
"235"
style=
"width:176pt;border-image: initial"
>
入参
</th>
<th
class=
"xl6420252"
width=
"106"
style=
"width:80pt;border-image: initial"
>
返回值
</th>
<th
class=
"xl6420252"
width=
"200"
style=
"width:150pt;border-image: initial"
>
功能
</th>
<th
class=
"xl6520252"
width=
"178"
style=
"width:134pt;border-image: initial"
>
支持系统类型
</th>
</tr>
<tr
height=
"99"
style=
"mso-height-source:userset;height:74.25pt;box-sizing: border-box"
>
<td
height=
"99"
class=
"xl6620252"
width=
"249"
style=
"height:74.25pt;width:187pt; border-image: initial;box-sizing: border-box"
>
void ParseAllJobs(const cJSON
*
fileRoot)
</td>
<td
class=
"xl6720252"
width=
"235"
style=
"width:176pt;border-image: initial; box-sizing: border-box"
>
const cJSON
*
fileRoot
</td>
<td
class=
"xl6720252"
width=
"106"
style=
"width:80pt;border-image: initial; box-sizing: border-box"
>
void
</td>
<td
class=
"xl6720252"
width=
"200"
style=
"width:150pt;border-image: initial; box-sizing: border-box"
>
jobs解析总入口。
</td>
<td
class=
"xl6720252"
width=
"178"
style=
"width:134pt;border-image: initial; box-sizing: border-box"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"147"
style=
"mso-height-source:userset;height:110.25pt;box-sizing: border-box"
>
<td
height=
"147"
class=
"xl6820252"
width=
"249"
style=
"height:110.25pt;width:187pt; border-image: initial;box-sizing: border-box"
>
static void ParseJob(const cJSON
<span
style=
"mso-spacerun:yes"
>
</span>
*jobItem, Job *
resJob)
</td>
<td
class=
"xl6920252"
width=
"235"
style=
"width:176pt;border-image: initial; box-sizing: border-box"
>
const cJSON
*jobItem, Job *
resJob
</td>
<td
class=
"xl6920252"
width=
"106"
style=
"width:80pt;border-image: initial; box-sizing: border-box"
>
void
</td>
<td
class=
"xl7020252"
width=
"200"
style=
"width:150pt;border-image: initial; box-sizing: border-box"
>
校验job是否已存在,解析cmds下命令的功能。
</td>
<td
class=
"xl6920252"
width=
"178"
style=
"width:134pt;border-image: initial; box-sizing: border-box"
>
小型系统
</td>
</tr>
<tr
height=
"177"
style=
"mso-height-source:userset;height:132.75pt;box-sizing: border-box"
>
<td
height=
"177"
class=
"xl6620252"
width=
"249"
style=
"height:132.75pt;width:187pt; border-image: initial;box-sizing: border-box"
>
int GetCmdLinesFromJson(const cJSON
*root, CmdLines *
*
cmdLines)
</td>
<td
class=
"xl6720252"
width=
"235"
style=
"width:176pt;border-image: initial; box-sizing: border-box"
>
const cJSON
*root, CmdLines *
*
cmdLines
</td>
<td
class=
"xl6720252"
width=
"106"
style=
"width:80pt;border-image: initial; box-sizing: border-box"
>
int
</td>
<td
class=
"xl6720252"
width=
"200"
style=
"width:150pt"
>
解析job中cmds命令。当前小型系统使用,标准系统由于涉及trigger功能和condition条件启动功能,并未使用该接口进行命令解析。
</td>
<td
class=
"xl6720252"
width=
"178"
style=
"width:134pt;border-image: initial; box-sizing: border-box"
>
小型系统和标准系统
</td>
</tr>
<tr
height=
"171"
style=
"mso-height-source:userset;height:128.25pt;box-sizing: border-box"
>
<td
height=
"171"
class=
"xl6820252"
width=
"249"
style=
"height:128.25pt;width:187pt; border-image: initial;box-sizing: border-box"
>
int ParseTriggerConfig(const cJSON
*fileRoot, int (*
checkJobValid)(const char
*
jobName))
</td>
<td
class=
"xl6920252"
width=
"235"
style=
"width:176pt;border-image: initial; box-sizing: border-box"
>
const cJSON
*fileRoot, int (*
checkJobValid)(const char
*
jobName)
</td>
<td
class=
"xl6920252"
width=
"106"
style=
"width:80pt;border-image: initial; box-sizing: border-box"
>
int
</td>
<td
class=
"xl6920252"
width=
"200"
style=
"width:150pt;border-image: initial; box-sizing: border-box"
>
解析job中Trigger命令。
</td>
<td
class=
"xl6920252"
width=
"178"
style=
"width:134pt;border-image: initial; box-sizing: border-box"
>
标准系统
</td>
</tr>
<tr
height=
"210"
style=
"mso-height-source:userset;height:157.5pt;box-sizing: border-box"
>
<td
height=
"210"
class=
"xl6620252"
width=
"249"
style=
"height:157.5pt;width:187pt; border-image: initial;box-sizing: border-box"
>
static int ParseTrigger_(const TriggerWorkSpace
*workSpace, const cJSON *
triggerItem, int (
*checkJobValid)(const char *
jobName))
</td>
<td
class=
"xl6720252"
width=
"235"
style=
"width:176pt;border-image: initial; box-sizing: border-box"
>
const TriggerWorkSpace
*workSpace, const cJSON *
triggerItem, int (
*checkJobValid)(const char *
jobName)
</td>
<td
class=
"xl6720252"
width=
"106"
style=
"width:80pt;border-image: initial; box-sizing: border-box"
>
int
</td>
<td
class=
"xl6720252"
width=
"200"
style=
"width:150pt"
>
获取job名称,condition属性以及cmds命令组的功能,解析到的job以hash表的形式存储,而命令的保存则使用了队列结构。
</td>
<td
class=
"xl6720252"
width=
"178"
style=
"width:134pt;border-image: initial; box-sizing: border-box"
>
标准系统
</td>
</tr>
<!--[endif]-->
</tbody>
</table>
**表3 job触发接口说明**
| 函数名 | 入参 | 返回值 | 功能 | 支持系统类型 |
|:--------|:-----|:------|:-----| :-----|
|void PostTrigger(EventType type, const char
*content, uint32_t contentLen)|EventType type, const char *
content, uint32_t contentLen|void|校验名称的有效性并发送触发job事件的功能。| 标准系统 |
|static void SendTriggerEvent(int type, const char
*content, uint32_t contentLen)|int type, const char *
content, uint32_t contentLen|void|通过系统参数进行整机控制以及服务的启动与停止等。| 标准系统 |
|static void DoTriggerCmd(const struct CmdArgs
*ctx)|const struct CmdArgs *
ctx|void|trigger命令执行接口| 标准系统 |
|void DoTriggerExec(const char
*triggerName)|const char *
triggerName|void|仅标准系统可用。通过参数中的job名称找到对应命令组,并将命令推入执行队列依次执行。| 标准系统 |
|void DoJob(const char
*jobName)|const char *
jobName|void|通过jobName匹配对应job,调用DoCmdByIndex执行其中的命令。| 小型系统 |
|void DoCmdByIndex(int index, const char
*cmdContent)|int index, const char *
cmdContent|void|拼接参数与命令。| 小型系统和标准系统 |
<table
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
width=
"906"
style=
"border-collapse: collapse;table-layout:fixed;width:681pt;box-sizing: border-box;border-spacing: 0px; word-break:initial;font-variant-ligatures: normal;font-variant-caps: normal; orphans: 2;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial; text-decoration-style: initial;text-decoration-color: initial"
>
<tbody>
<tr
height=
"39"
style=
"height:35.25pt;box-sizing: border-box"
>
<th
height=
"47"
class=
"xl6322245"
width=
"239"
style=
"height:35.25pt;width:153pt"
>
函数名
</th>
<th
class=
"xl6322245"
width=
"235"
style=
"border-left:none;width:178pt"
>
入参
</th>
<th
class=
"xl6322245"
width=
"106"
style=
"border-left:none;width:80pt"
>
返回值
</th>
<th
class=
"xl6322245"
width=
"200"
style=
"border-left:none;width:128pt"
>
功能
</th>
<th
class=
"xl6322245"
width=
"178"
style=
"border-left:none;width:133pt"
>
支持系统类型
</th>
</tr>
<tr
height=
"257"
style=
"mso-height-source:userset;height:192.75pt;box-sizing: border-box"
>
<td
height=
"257"
class=
"xl6422245"
width=
"204"
style=
"height:192.75pt;border-top: none;width:153pt;box-sizing: border-box"
>
void PostTrigger(EventType type, const char
*
content, uint32_t contentLen)
</td>
<td
class=
"xl6422245"
width=
"235"
style=
"border-top:none;border-left:none; width:178pt;box-sizing: border-box"
>
EventType type, const char
*
content, uint32_t contentLen
</td>
<td
class=
"xl6422245"
width=
"106"
style=
"border-top:none;border-left:none; width:80pt;box-sizing: border-box"
>
void
</td>
<td
class=
"xl6422245"
width=
"170"
style=
"border-top:none;border-left:none; width:128pt;box-sizing: border-box"
>
校验名称的有效性并发送触发job事件的功能。
</td>
<td
class=
"xl6422245"
width=
"177"
style=
"border-top:none;border-left:none; width:133pt;box-sizing: border-box"
>
标准系统
</td>
</tr>
<tr
height=
"323"
style=
"height:242.25pt;box-sizing: border-box"
>
<td
height=
"323"
class=
"xl6522245"
width=
"204"
style=
"height:242.25pt;border-top: none;width:153pt;box-sizing: border-box"
>
static void SendTriggerEvent(int type, const char
*
content, uint32_t contentLen)
</td>
<td
class=
"xl6522245"
width=
"235"
style=
"border-top:none;border-left:none; width:178pt;box-sizing: border-box"
>
int type, const char
*
content, uint32_t contentLen
</td>
<td
class=
"xl6522245"
width=
"106"
style=
"border-top:none;border-left:none; width:80pt;box-sizing: border-box"
>
void
</td>
<td
class=
"xl6522245"
width=
"170"
style=
"border-top:none;border-left:none; width:128pt;box-sizing: border-box"
>
通过系统参数进行整机控制以及服务的启动与停止等。
</td>
<td
class=
"xl6522245"
width=
"177"
style=
"border-top:none;border-left:none; width:133pt;box-sizing: border-box"
>
标准系统
</td>
</tr>
<tr
height=
"188"
style=
"mso-height-source:userset;height:141.0pt;box-sizing: border-box"
>
<td
height=
"188"
class=
"xl6422245"
width=
"204"
style=
"height:141.0pt;border-top: none;width:153pt;box-sizing: border-box"
>
static void DoTriggerCmd(const struct CmdArgs
*
ctx)
</td>
<td
class=
"xl6422245"
width=
"235"
style=
"border-top:none;border-left:none; width:178pt;box-sizing: border-box"
>
const struct CmdArgs
*
ctx
</td>
<td
class=
"xl6422245"
width=
"106"
style=
"border-top:none;border-left:none; width:80pt;box-sizing: border-box"
>
void
</td>
<td
class=
"xl6422245"
width=
"170"
style=
"border-top:none;border-left:none; width:128pt;box-sizing: border-box"
>
trigger命令执行接口
</td>
<td
class=
"xl6422245"
width=
"177"
style=
"border-top:none;border-left:none; width:133pt;box-sizing: border-box"
>
标准系统
</td>
</tr>
<tr
height=
"258"
style=
"mso-height-source:userset;height:193.5pt;box-sizing: border-box"
>
<td
height=
"258"
class=
"xl6522245"
width=
"204"
style=
"height:193.5pt;border-top: none;width:153pt;box-sizing: border-box"
>
void DoTriggerExec(const char
*
triggerName)
</td>
<td
class=
"xl6522245"
width=
"235"
style=
"border-top:none;border-left:none; width:178pt;box-sizing: border-box"
>
const char
*
triggerName
</td>
<td
class=
"xl6522245"
width=
"106"
style=
"border-top:none;border-left:none; width:80pt;box-sizing: border-box"
>
void
</td>
<td
class=
"xl6522245"
width=
"170"
style=
"border-top:none;border-left:none; width:128pt;box-sizing: border-box"
>
仅标准系统可用。通过参数中的job名称找到对应命令组,并将命令推入执行队列依次执行。
</td>
<td
class=
"xl6522245"
width=
"177"
style=
"border-top:none;border-left:none; width:133pt;box-sizing: border-box"
>
标准系统
</td>
</tr>
<tr
height=
"254"
style=
"height:190.5pt;box-sizing: border-box"
>
<td
height=
"254"
class=
"xl6422245"
width=
"204"
style=
"height:190.5pt;border-top: none;width:153pt;box-sizing: border-box"
>
void DoJob(const char
*
jobName)
</td>
<td
class=
"xl6422245"
width=
"235"
style=
"border-top:none;border-left:none; width:178pt;box-sizing: border-box"
>
const char
*
jobName
</td>
<td
class=
"xl6422245"
width=
"118"
style=
"border-top:none;border-left:none; width:80pt;box-sizing: border-box"
>
void
</td>
<td
class=
"xl6422245"
width=
"170"
style=
"border-top:none;border-left:none; width:128pt;box-sizing: border-box"
>
通过jobName匹配对应job,调用DoCmdByIndex执行其中的命令。
</td>
<td
class=
"xl6422245"
width=
"177"
style=
"border-top:none;border-left:none; width:133pt;box-sizing: border-box"
>
小型系统
</td>
</tr>
<tr
height=
"208"
style=
"height:156.0pt;box-sizing: border-box"
>
<td
height=
"208"
class=
"xl6522245"
width=
"204"
style=
"height:156.0pt;border-top: none;width:153pt;box-sizing: border-box"
>
void DoCmdByIndex(int index, const char
*
cmdContent)
</td>
<td
class=
"xl6522245"
width=
"235"
style=
"border-top:none;border-left:none; width:178pt;box-sizing: border-box"
>
int index, const char
*
cmdContent
</td>
<td
class=
"xl6522245"
width=
"118"
style=
"border-top:none;border-left:none; width:80pt;box-sizing: border-box"
>
void
</td>
<td
class=
"xl6522245"
width=
"170"
style=
"border-top:none;border-left:none; width:128pt;box-sizing: border-box"
>
拼接参数与命令。
</td>
<td
class=
"xl6522245"
width=
"177"
style=
"border-top:none;border-left:none; width:133pt;box-sizing: border-box"
>
小型系统和标准系统
</td>
</tr>
<!--[endif]-->
</tbody>
</table>
### 开发实例
下述为cfg文件中jobs配置模板,可验证jobs管理的功能。
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录