Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
8d34a205
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,发现更多精彩内容 >>
提交
8d34a205
编写于
5月 30, 2022
作者:
M
Mupceet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support liteos
Signed-off-by:
N
Mupceet
<
laiguizhong@huawei.com
>
上级
54859a3e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
24 addition
and
25 deletion
+24
-25
interfaces/innerkits/BUILD.gn
interfaces/innerkits/BUILD.gn
+15
-20
interfaces/innerkits/syspara/param_comm.c
interfaces/innerkits/syspara/param_comm.c
+4
-0
services/include/param/init_param.h
services/include/param/init_param.h
+2
-0
services/param/include/param_security.h
services/param/include/param_security.h
+1
-5
test/unittest/BUILD.gn
test/unittest/BUILD.gn
+1
-0
test/unittest/lite/BUILD.gn
test/unittest/lite/BUILD.gn
+1
-0
未找到文件。
interfaces/innerkits/BUILD.gn
浏览文件 @
8d34a205
...
@@ -33,6 +33,18 @@ if (defined(ohos_lite)) {
...
@@ -33,6 +33,18 @@ if (defined(ohos_lite)) {
import("//build/lite/config/component/lite_component.gni")
import("//build/lite/config/component/lite_component.gni")
import("//build/lite/ndk/ndk.gni")
import("//build/lite/ndk/ndk.gni")
include_common = [
"./include",
"//base/hiviewdfx/hilog_lite/interfaces/native/kits",
"//third_party/bounds_checking_function/include",
"//base/startup/init_lite/services/include",
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/interfaces/innerkits/fd_holder",
"//base/startup/init_lite/services/param/include",
"//base/startup/init_lite/interfaces/innerkits/include",
"//base/startup/init_lite/interfaces/hals",
]
if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "linux") {
if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "linux") {
shared_library("libbegetutil") {
shared_library("libbegetutil") {
sources = [ "//base/startup/init_lite/services/log/init_log.c" ]
sources = [ "//base/startup/init_lite/services/log/init_log.c" ]
...
@@ -42,6 +54,7 @@ if (defined(ohos_lite)) {
...
@@ -42,6 +54,7 @@ if (defined(ohos_lite)) {
"OHOS_LITE",
"OHOS_LITE",
]
]
deps = []
deps = []
include_dirs = include_common
if (enable_ohos_startup_init_feature_begetctl_liteos) {
if (enable_ohos_startup_init_feature_begetctl_liteos) {
sources += syspara_sources
sources += syspara_sources
defines += [ "LITEOS_SUPPORT" ]
defines += [ "LITEOS_SUPPORT" ]
...
@@ -52,16 +65,7 @@ if (defined(ohos_lite)) {
...
@@ -52,16 +65,7 @@ if (defined(ohos_lite)) {
public_configs = [ ":exported_header_files" ]
public_configs = [ ":exported_header_files" ]
cflags = [ "-fPIC" ]
cflags = [ "-fPIC" ]
include_dirs = [
"./include",
"//base/hiviewdfx/hilog_lite/interfaces/native/kits",
"//third_party/bounds_checking_function/include",
"//base/startup/init_lite/services/include",
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/interfaces/innerkits/fd_holder",
"//base/startup/init_lite/services/param/include",
"//base/startup/init_lite/interfaces/innerkits/include",
]
deps += [
deps += [
"//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
"//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
"//base/startup/init_lite/services/utils:libinit_tools",
"//base/startup/init_lite/services/utils:libinit_tools",
...
@@ -91,16 +95,7 @@ if (defined(ohos_lite)) {
...
@@ -91,16 +95,7 @@ if (defined(ohos_lite)) {
"__LITEOS_M__",
"__LITEOS_M__",
]
]
include_dirs = [
include_dirs = include_common
"./include",
"//base/hiviewdfx/hilog_lite/interfaces/native/kits",
"//third_party/bounds_checking_function/include",
"//base/startup/init_lite/services/include",
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/interfaces/innerkits/fd_holder",
"//base/startup/init_lite/services/param/include",
"//base/startup/init_lite/interfaces/innerkits/include",
]
deps = [
deps = [
"//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static",
"//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static",
"//base/startup/init_lite/services/utils:libinit_tools",
"//base/startup/init_lite/services/utils:libinit_tools",
...
...
interfaces/innerkits/syspara/param_comm.c
浏览文件 @
8d34a205
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include <string.h>
#include <string.h>
#include "init_param.h"
#include "init_param.h"
#include "hal_sys_param.h"
#include "parameter.h"
#include "parameter.h"
#include "sysparam_errno.h"
#include "sysparam_errno.h"
#ifdef USE_MBEDTLS
#ifdef USE_MBEDTLS
...
@@ -46,6 +47,9 @@ INIT_LOCAL_API int GetParameter_(const char *key, const char *def, char *value,
...
@@ -46,6 +47,9 @@ INIT_LOCAL_API int GetParameter_(const char *key, const char *def, char *value,
}
}
uint32_t
size
=
len
;
uint32_t
size
=
len
;
int
ret
=
SystemGetParameter
(
key
,
NULL
,
&
size
);
int
ret
=
SystemGetParameter
(
key
,
NULL
,
&
size
);
if
(
ret
==
PARAM_CODE_INVALID_NAME
||
ret
==
DAC_RESULT_FORBIDED
||
ret
==
PARAM_CODE_INVALID_PARAM
)
{
return
EC_FAILURE
;
}
if
((
size
>
len
)
||
(
ret
!=
0
))
{
if
((
size
>
len
)
||
(
ret
!=
0
))
{
return
strcpy_s
(
value
,
len
,
def
);
return
strcpy_s
(
value
,
len
,
def
);
}
}
...
...
services/include/param/init_param.h
浏览文件 @
8d34a205
...
@@ -50,6 +50,8 @@ typedef enum {
...
@@ -50,6 +50,8 @@ typedef enum {
PARAM_CODE_READ_ONLY
,
PARAM_CODE_READ_ONLY
,
PARAM_CODE_FAIL_CONNECT
,
PARAM_CODE_FAIL_CONNECT
,
PARAM_CODE_NODE_EXIST
,
// 9
PARAM_CODE_NODE_EXIST
,
// 9
DAC_RESULT_INVALID_PARAM
=
1000
,
DAC_RESULT_FORBIDED
,
PARAM_CODE_MAX
PARAM_CODE_MAX
}
PARAM_CODE
;
}
PARAM_CODE
;
...
...
services/param/include/param_security.h
浏览文件 @
8d34a205
...
@@ -47,11 +47,7 @@ extern "C" {
...
@@ -47,11 +47,7 @@ extern "C" {
#define SELINUX_CONTENT_LEN 64
#define SELINUX_CONTENT_LEN 64
#define SYS_UID_INDEX 1000
#define SYS_UID_INDEX 1000
typedef
enum
{
#define DAC_RESULT_PERMISSION 0
DAC_RESULT_PERMISSION
=
0
,
DAC_RESULT_INVALID_PARAM
=
1000
,
DAC_RESULT_FORBIDED
,
}
DAC_RESULT
;
typedef
struct
UserCred
{
typedef
struct
UserCred
{
pid_t
pid
;
pid_t
pid
;
...
...
test/unittest/BUILD.gn
浏览文件 @
8d34a205
...
@@ -192,6 +192,7 @@ ohos_unittest("init_ut") {
...
@@ -192,6 +192,7 @@ ohos_unittest("init_ut") {
"//base/security/access_token/interfaces/innerkits/token_setproc/include",
"//base/security/access_token/interfaces/innerkits/token_setproc/include",
"//base/security/access_token/interfaces/innerkits/nativetoken/include",
"//base/security/access_token/interfaces/innerkits/nativetoken/include",
"//base/startup/init_lite/interfaces/innerkits/sandbox/include",
"//base/startup/init_lite/interfaces/innerkits/sandbox/include",
"//base/startup/init_lite/interfaces/innerkits/hals",
]
]
deps = [
deps = [
...
...
test/unittest/lite/BUILD.gn
浏览文件 @
8d34a205
...
@@ -95,6 +95,7 @@ if (defined(ohos_lite)) {
...
@@ -95,6 +95,7 @@ if (defined(ohos_lite)) {
"//third_party/bounds_checking_function/include",
"//third_party/bounds_checking_function/include",
"//base/hiviewdfx/hilog_lite/interfaces/native/kits",
"//base/hiviewdfx/hilog_lite/interfaces/native/kits",
"//base/startup/init_lite/interfaces/innerkits/fd_holder",
"//base/startup/init_lite/interfaces/innerkits/fd_holder",
"//base/startup/init_lite/interfaces/hals",
]
]
sources = sysparam_source
sources = sysparam_source
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录