Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
3137109c
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,发现更多精彩内容 >>
未验证
提交
3137109c
编写于
6月 30, 2022
作者:
O
openharmony_ci
提交者:
Gitee
6月 30, 2022
浏览文件
操作
浏览文件
下载
差异文件
!877 删除build中的product name
Merge pull request !877 from Mupceet/productname
上级
92cc3399
fa59dadd
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
38 addition
and
40 deletion
+38
-40
begetd.gni
begetd.gni
+3
-4
services/begetctl/BUILD.gn
services/begetctl/BUILD.gn
+1
-1
services/init/standard/BUILD.gn
services/init/standard/BUILD.gn
+1
-1
services/param/linux/BUILD.gn
services/param/linux/BUILD.gn
+0
-4
services/param/manager/param_server.c
services/param/manager/param_server.c
+33
-30
未找到文件。
begetd.gni
浏览文件 @
3137109c
...
...
@@ -21,9 +21,8 @@ declare_args() {
enable_ohos_startup_init_feature_begetctl_liteos = false
enable_ohos_startup_init_lite_use_thirdparty_mbedtls = true
enable_ohos_startup_init_lite_use_posix_file_api = false
enable_ohos_startup_init_feature_loader = false
config_ohos_startup_init_lite_data_path = ""
if (defined(product_name) && product_name == "rk3568") {
boot_kernel_extended_cmdline =
"hardware=rk3568 default_boot_device=fe310000.sdhci"
}
# boot_kernel_extended_cmdline for extend cmdline
}
services/begetctl/BUILD.gn
浏览文件 @
3137109c
...
...
@@ -73,7 +73,7 @@ if (defined(ohos_lite)) {
defines = [ "_GNU_SOURCE" ]
if (
defined(product_name) && product_name == "rk3568"
) {
if (
enable_ohos_startup_init_feature_loader
) {
defines += [ "PRODUCT_RK" ]
}
...
...
services/init/standard/BUILD.gn
浏览文件 @
3137109c
...
...
@@ -121,7 +121,7 @@ ohos_executable("init") {
defines += [ "ASAN_DETECTOR" ]
}
if (
defined(product_name) && product_name == "rk3568"
) {
if (
enable_ohos_startup_init_feature_loader
) {
defines += [ "PRODUCT_RK" ]
}
version_script = get_label_info(
...
...
services/param/linux/BUILD.gn
浏览文件 @
3137109c
...
...
@@ -108,10 +108,6 @@ if (defined(ohos_lite)) {
defines += [ "BOOT_EXTENDED_CMDLINE=\"${boot_kernel_extended_cmdline}\"" ]
}
if ("${product_name}" == "m40") {
defines += [ "USE_MTK_EMMC" ]
}
if (build_selinux) {
include_dirs += [
"//third_party/selinux/libselinux/include/",
...
...
services/param/manager/param_server.c
浏览文件 @
3137109c
...
...
@@ -58,34 +58,10 @@ static int CommonDealFun(const char *name, const char *value, int res)
return
ret
;
}
static
int
SnDealFun
(
const
char
*
name
,
const
char
*
value
,
int
res
)
static
int
ReadSnFromFile
(
const
char
*
name
,
const
char
*
file
)
{
#ifdef USE_MTK_EMMC
static
const
char
SN_FILE
[]
=
{
"/proc/bootdevice/cid"
};
#else
static
const
char
SN_FILE
[]
=
{
"/sys/block/mmcblk0/device/cid"
};
#endif
int
ret
=
CheckParamName
(
name
,
0
);
PARAM_CHECK
(
ret
==
0
,
return
ret
,
"Invalid name %s"
,
name
);
char
*
data
=
NULL
;
if
(
res
!=
0
)
{
// if cmdline not set sn or set sn value is null,read sn from default file
data
=
ReadFileData
(
SN_FILE
);
if
(
data
==
NULL
)
{
PARAM_LOGE
(
"Error, Read sn from default file failed!"
);
return
-
1
;
}
}
else
if
(
value
[
0
]
==
'/'
)
{
data
=
ReadFileData
(
value
);
if
(
data
==
NULL
)
{
PARAM_LOGE
(
"Error, Read sn from cmdline file failed!"
);
return
-
1
;
}
}
else
{
PARAM_LOGV
(
"**** name %s, value %s"
,
name
,
value
);
ret
=
WriteParam
(
name
,
value
,
NULL
,
0
);
PARAM_CHECK
(
ret
==
0
,
return
ret
,
"Failed to write param %s %s"
,
name
,
value
);
return
ret
;
}
char
*
data
=
ReadFileData
(
file
);
PARAM_CHECK
(
data
!=
NULL
,
return
-
1
,
"Read sn from %s file failed!"
,
file
);
int
index
=
0
;
for
(
size_t
i
=
0
;
i
<
strlen
(
data
);
i
++
)
{
...
...
@@ -100,11 +76,38 @@ static int SnDealFun(const char *name, const char *value, int res)
}
data
[
index
]
=
'\0'
;
PARAM_LOGV
(
"**** name %s, value %s"
,
name
,
data
);
ret
=
WriteParam
(
name
,
data
,
NULL
,
0
);
PARAM_CHECK
(
ret
==
0
,
free
(
data
);
return
ret
,
"Failed to write param %s %s"
,
name
,
data
);
int
ret
=
WriteParam
(
name
,
data
,
NULL
,
0
);
free
(
data
);
PARAM_CHECK
(
ret
==
0
,
return
ret
,
"Failed to write param %s %s"
,
name
,
data
);
return
ret
;
}
static
int
SnDealFun
(
const
char
*
name
,
const
char
*
value
,
int
res
)
{
const
char
*
snFileList
[]
=
{
"/sys/block/mmcblk0/device/cid"
,
"/proc/bootdevice/cid"
};
int
ret
=
CheckParamName
(
name
,
0
);
PARAM_CHECK
(
ret
==
0
,
return
ret
,
"Invalid name %s"
,
name
);
if
(
value
!=
NULL
&&
res
==
0
&&
value
[
0
]
!=
'/'
)
{
PARAM_LOGV
(
"**** name %s, value %s"
,
name
,
value
);
ret
=
WriteParam
(
name
,
value
,
NULL
,
0
);
PARAM_CHECK
(
ret
==
0
,
return
ret
,
"Failed to write param %s %s"
,
name
,
value
);
return
ret
;
}
if
(
value
!=
NULL
&&
value
[
0
]
==
'/'
)
{
ret
=
ReadSnFromFile
(
name
,
value
);
if
(
ret
==
0
)
{
return
ret
;
}
}
for
(
size_t
i
=
0
;
i
<
ARRAY_LENGTH
(
snFileList
);
i
++
)
{
ret
=
ReadSnFromFile
(
name
,
snFileList
[
i
]);
if
(
ret
==
0
)
{
break
;
}
}
return
ret
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录