Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
97d8bd8b
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
9 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
提交
97d8bd8b
编写于
4月 22, 2021
作者:
Z
zhong_ning
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify updater init
上级
3900746c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
12 addition
and
11 deletion
+12
-11
services/BUILD.gn
services/BUILD.gn
+1
-2
services/src/init_cmds.c
services/src/init_cmds.c
+5
-3
services/src/main.c
services/src/main.c
+4
-4
services/test/unittest/common/BUILD.gn
services/test/unittest/common/BUILD.gn
+2
-2
未找到文件。
services/BUILD.gn
浏览文件 @
97d8bd8b
...
...
@@ -21,7 +21,7 @@ if (defined(ohos_lite)) {
executable("init") {
defines = [
"_GNU_SOURCE", #syscall function need this macro definition
"OHOS_LITE
=1
",
"OHOS_LITE",
]
sources = [
"src/init_adapter.c",
...
...
@@ -97,7 +97,6 @@ if (defined(ohos_lite)) {
"src/init_signal_handler.c",
"src/device.c",
]
defines = [ "OHOS_LITE=0" ]
include_dirs = [
"include",
"//third_party/cJSON",
...
...
services/src/init_cmds.c
浏览文件 @
97d8bd8b
...
...
@@ -24,7 +24,7 @@
#include <sys/mount.h>
#include <sys/stat.h>
#include <unistd.h>
#if
!
OHOS_LITE
#if
ndef
OHOS_LITE
#include <sys/syscall.h>
#include <fcntl.h>
#include <linux/module.h>
...
...
@@ -320,7 +320,7 @@ static void DoMount(const char* cmdContent)
free
(
target
);
}
#if
!
OHOS_LITE
#if
ndef
OHOS_LITE
// format insmod <ko name> [-f] [options]
static
void
DoInsmod
(
const
char
*
cmdContent
)
{
...
...
@@ -370,10 +370,12 @@ static void DoInsmod(const char *cmdContent)
if
(
p
!=
NULL
)
{
if
(
restPtr
!=
NULL
)
{
if
(
snprintf_s
(
options
,
sizeof
(
options
),
OPTIONS_SIZE
-
1
,
"%s %s"
,
p
,
restPtr
)
==
-
1
)
{
goto
out
;
return
;
}
}
else
{
if
(
strncpy_s
(
options
,
OPTIONS_SIZE
-
1
,
p
,
strlen
(
p
))
!=
0
)
{
goto
out
;
return
;
}
}
...
...
@@ -487,7 +489,7 @@ void DoCmd(const CmdLine* curCmd)
}
else
if
(
strncmp
(
curCmd
->
name
,
"loadcfg "
,
strlen
(
"loadcfg "
))
==
0
)
{
DoLoadCfg
(
curCmd
->
cmdContent
);
}
#if
!
OHOS_LITE
#if
ndef
OHOS_LITE
else
if
(
strncmp
(
curCmd
->
name
,
"insmod "
,
strlen
(
"insmod "
))
==
0
)
{
DoInsmod
(
curCmd
->
cmdContent
);
}
...
...
services/src/main.c
浏览文件 @
97d8bd8b
...
...
@@ -27,11 +27,11 @@
#include "init_adapter.h"
#include "init_read_cfg.h"
#include "init_signal_handler.h"
#if OHOS_LITE
#if
def
OHOS_LITE
#include "parameter.h"
#endif
#if
!
OHOS_LITE
#if
ndef
OHOS_LITE
#include "device.h"
#endif
...
...
@@ -39,7 +39,7 @@ static const pid_t INIT_PROCESS_PID = 1;
static
void
PrintSysInfo
()
{
#if OHOS_LITE
#if
def
OHOS_LITE
char
*
sysInfo
=
GetVersionId
();
if
(
sysInfo
!=
NULL
)
{
printf
(
"[Init] %s
\n
"
,
sysInfo
);
...
...
@@ -80,7 +80,7 @@ int main(int argc, char * const argv[])
// 1. print system info
PrintSysInfo
();
#if
!
OHOS_LITE
#if
ndef
OHOS_LITE
// 2. Mount basic filesystem and create common device node.
MountBasicFs
();
CreateDeviceNode
();
...
...
services/test/unittest/common/BUILD.gn
浏览文件 @
97d8bd8b
...
...
@@ -21,9 +21,9 @@ unittest("init_test") {
"-lpthread",
"-lm",
]
defines = ["OHOS_LITE"]
if (storage_type == "emmc") {
defines = [ "USE_EMMC_STORAGE" ]
defines
+
= [ "USE_EMMC_STORAGE" ]
}
include_dirs = [ "//base/startup/init_lite/services/include" ]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录