Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
3fb0f722
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
8 个月 前同步成功
通知
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 搜索 >>
未验证
提交
3fb0f722
编写于
1月 08, 2022
作者:
O
openharmony_ci
提交者:
Gitee
1月 08, 2022
浏览文件
操作
浏览文件
下载
差异文件
!227 add selinux adaption for rk3568
Merge pull request !227 from dapaodexiaoyu2/master
上级
feafe7ec
dc5a29c4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
8 deletion
+20
-8
services/init/standard/init.c
services/init/standard/init.c
+6
-8
services/init/standard/init_cmds.c
services/init/standard/init_cmds.c
+14
-0
未找到文件。
services/init/standard/init.c
浏览文件 @
3fb0f722
...
...
@@ -35,6 +35,7 @@
#include "ueventd_socket.h"
#ifdef WITH_SELINUX
#include <policycoreutils.h>
#include <selinux/selinux.h>
#endif // WITH_SELINUX
void
SystemInit
(
void
)
...
...
@@ -164,16 +165,16 @@ void SystemLoadSelinux(void)
}
else
{
INIT_LOGI
(
"main, load_policy success."
);
}
if
(
restorecon
()
<
0
)
{
INIT_LOGE
(
"main, restorecon failed."
);
}
else
{
INIT_LOGI
(
"main, restorecon success."
);
}
setcon
(
"u:r:init:s0"
);
#endif // WITH_SELINUX
}
void
SystemConfig
(
void
)
{
// load SELinux context and policy
SystemLoadSelinux
();
InitParamService
();
// parse parameters
LoadDefaultParams
(
"/system/etc/param/ohos_const"
,
LOAD_PARAM_NORMAL
);
...
...
@@ -193,9 +194,6 @@ void SystemConfig(void)
PostTrigger
(
EVENT_TRIGGER_BOOT
,
"pre-init"
,
strlen
(
"pre-init"
));
PostTrigger
(
EVENT_TRIGGER_BOOT
,
"init"
,
strlen
(
"init"
));
PostTrigger
(
EVENT_TRIGGER_BOOT
,
"post-init"
,
strlen
(
"post-init"
));
// load SELinux context and policy
SystemLoadSelinux
();
}
void
SystemRun
(
void
)
...
...
services/init/standard/init_cmds.c
浏览文件 @
3fb0f722
...
...
@@ -38,6 +38,9 @@
#include "init_service_manager.h"
#include "init_utils.h"
#include "securec.h"
#ifdef WITH_SELINUX
#include <policycoreutils.h>
#endif
int
GetParamValue
(
const
char
*
symValue
,
unsigned
int
symLen
,
char
*
paramValue
,
unsigned
int
paramLen
)
{
...
...
@@ -266,6 +269,16 @@ static void DoUmountFstabFile(const struct CmdArgs *ctx)
}
}
static
void
DoRestorecon
(
const
struct
CmdArgs
*
ctx
)
{
#ifdef WITH_SELINUX
INIT_LOGI
(
"start restorecon ......
\n
"
);
restorecon
();
INIT_LOGI
(
"finish restorecon ......
\n
"
);
#endif
return
;
}
static
const
struct
CmdTable
g_cmdTable
[]
=
{
{
"exec "
,
1
,
10
,
DoExec
},
{
"mknode "
,
1
,
5
,
DoMakeNode
},
...
...
@@ -279,6 +292,7 @@ static const struct CmdTable g_cmdTable[] = {
{
"ifup "
,
1
,
1
,
DoIfup
},
{
"mount_fstab "
,
1
,
1
,
DoMountFstabFile
},
{
"umount_fstab "
,
1
,
1
,
DoUmountFstabFile
},
{
"restorecon "
,
0
,
0
,
DoRestorecon
},
};
const
struct
CmdTable
*
GetCmdTable
(
int
*
number
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录