Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
d69b944c
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
大约 1 年 前同步成功
通知
3
Star
37
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Startup Init Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d69b944c
编写于
11月 30, 2021
作者:
O
openharmony_ci
提交者:
Gitee
11月 30, 2021
浏览文件
操作
浏览文件
下载
差异文件
!174 dayu200 增加进入下载模式命令(reboot loader)
Merge pull request !174 from yang_hongliang/master
上级
7ee6dc2b
caad82c4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
1 deletion
+10
-1
services/cmds/reboot/init_cmd_reboot.c
services/cmds/reboot/init_cmd_reboot.c
+2
-0
services/init/standard/init_reboot.c
services/init/standard/init_reboot.c
+8
-1
未找到文件。
services/cmds/reboot/init_cmd_reboot.c
浏览文件 @
d69b944c
...
...
@@ -24,6 +24,7 @@
" reboot updater[:options]
\n
"
\
" reboot flashd
\n
"
\
" reboot flashd[:options]
\n
"
\
" reboot loader
\n
"
\
" reboot
\n
"
int
main
(
int
argc
,
char
*
argv
[])
...
...
@@ -36,6 +37,7 @@ int main(int argc, char* argv[])
if
(
argc
==
REBOOT_CMD_NUMBER
&&
strcmp
(
argv
[
1
],
"shutdown"
)
!=
0
&&
strcmp
(
argv
[
1
],
"updater"
)
!=
0
&&
strcmp
(
argv
[
1
],
"flashd"
)
!=
0
&&
strcmp
(
argv
[
1
],
"loader"
)
!=
0
&&
strncmp
(
argv
[
1
],
"updater:"
,
strlen
(
"updater:"
))
!=
0
&&
strncmp
(
argv
[
1
],
"flashd:"
,
strlen
(
"flashd:"
))
!=
0
)
{
printf
(
"%s"
,
USAGE_INFO
);
...
...
services/init/standard/init_reboot.c
浏览文件 @
d69b944c
...
...
@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/reboot.h>
#include <sys/syscall.h>
#include "init_log.h"
#include "init_service.h"
...
...
@@ -27,6 +28,10 @@
#define MAX_COMMAND_SIZE 20
#define MAX_UPDATE_SIZE 100
#define REBOOT_MAGIC1 0xfee1dead
#define REBOOT_MAGIC2 672274793
#define REBOOT_CMD_RESTART2 0xA1B2C3D4
struct
RBMiscUpdateMessage
{
char
command
[
MAX_COMMAND_SIZE
];
char
update
[
MAX_UPDATE_SIZE
];
...
...
@@ -137,7 +142,7 @@ static int CheckRebootParam(const char *valueData)
return
0
;
}
static
const
char
*
cmdParams
[]
=
{
"shutdown"
,
"updater"
,
"updater:"
,
"flash"
,
"flash:"
,
"NoArgument"
,
"bootloader"
"shutdown"
,
"updater"
,
"updater:"
,
"flash"
,
"flash:"
,
"NoArgument"
,
"
loader"
,
"
bootloader"
};
size_t
i
=
0
;
for
(;
i
<
ARRAY_LENGTH
(
cmdParams
);
i
++
)
{
...
...
@@ -188,6 +193,8 @@ void ExecReboot(const char *value)
ret
=
CheckAndRebootToUpdater
(
valueData
,
"updater"
,
"updater:"
,
"boot_updater"
);
}
else
if
(
strncmp
(
valueData
,
"flash"
,
strlen
(
"flash"
))
==
0
)
{
ret
=
CheckAndRebootToUpdater
(
valueData
,
"flash"
,
"flash:"
,
"boot_flash"
);
}
else
if
(
strncmp
(
valueData
,
"loader"
,
strlen
(
"loader"
))
==
0
)
{
syscall
(
__NR_reboot
,
REBOOT_MAGIC1
,
REBOOT_MAGIC2
,
REBOOT_CMD_RESTART2
,
"loader"
);
}
INIT_LOGI
(
"Reboot %s %s."
,
value
,
(
ret
==
0
)
?
"success"
:
"fail"
);
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录