Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
e1a4db45
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
10 个月 前同步成功
通知
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 搜索 >>
提交
e1a4db45
编写于
6月 30, 2022
作者:
R
renwei
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of gitee.com:openharmony/startup_init_lite
Change-Id: I9ff0c097ffbea63d1cc919d4f039f27c1ebe3737
上级
9269e913
2bf18e0c
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
47 addition
and
48 deletion
+47
-48
begetd.gni
begetd.gni
+3
-4
interfaces/innerkits/init_module_engine/init_modulemgr.c
interfaces/innerkits/init_module_engine/init_modulemgr.c
+1
-1
interfaces/innerkits/modulemgr/modulemgr.c
interfaces/innerkits/modulemgr/modulemgr.c
+1
-1
services/begetctl/BUILD.gn
services/begetctl/BUILD.gn
+1
-1
services/etc/BUILD.gn
services/etc/BUILD.gn
+3
-4
services/etc/param/ohos.para
services/etc/param/ohos.para
+1
-1
services/init/standard/BUILD.gn
services/init/standard/BUILD.gn
+1
-1
services/modules/bootchart/bootchart_static.c
services/modules/bootchart/bootchart_static.c
+1
-1
services/param/include/param_utils.h
services/param/include/param_utils.h
+2
-0
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
浏览文件 @
e1a4db45
...
...
@@ -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
}
interfaces/innerkits/init_module_engine/init_modulemgr.c
浏览文件 @
e1a4db45
...
...
@@ -68,7 +68,7 @@ static int ModuleMgrCmdInstall(int id, const char *name, int argc, const char **
static
int
ModuleMgrCmdUninstall
(
int
id
,
const
char
*
name
,
int
argc
,
const
char
**
argv
)
{
INIT_ERROR_CHECK
(
argv
!=
NULL
&&
argc
>=
1
,
return
-
1
,
"Invalid install parameter"
);
ModuleMgrUninstall
(
NULL
,
argv
[
0
]);
ModuleMgrUninstall
(
defaultModuleMgr
,
argv
[
0
]);
return
0
;
}
...
...
interfaces/innerkits/modulemgr/modulemgr.c
浏览文件 @
e1a4db45
...
...
@@ -109,7 +109,7 @@ static void *moduleInstall(MODULE_ITEM *module, int argc, const char *argv[])
return
NULL
;
}
}
else
{
if
(
snprintf_s
(
path
,
sizeof
(
path
),
sizeof
(
path
)
-
1
,
"/system/"
MODULE_LIB_NAME
"/%s/%s"
MODULE_SUFFIX_D
,
if
(
snprintf_s
(
path
,
sizeof
(
path
),
sizeof
(
path
)
-
1
,
"/system/"
MODULE_LIB_NAME
"/%s/
lib
%s"
MODULE_SUFFIX_D
,
module
->
moduleMgr
->
name
,
module
->
name
)
<
0
)
{
return
NULL
;
}
...
...
services/begetctl/BUILD.gn
浏览文件 @
e1a4db45
...
...
@@ -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/etc/BUILD.gn
浏览文件 @
e1a4db45
...
...
@@ -157,19 +157,18 @@ if (defined(ohos_lite)) {
}
ohos_prebuilt_etc("syscap.para") {
source =
"${preloader_output_dir}/${product_name}/system/etc/param/syscap.para"
source = "${preloader_output_dir}/system/etc/param/syscap.para"
module_install_dir = "etc/param/"
part_name = "init"
}
ohos_prebuilt_etc("syscap.json") {
source = "${preloader_output_dir}/
${product_name}/
system/etc/syscap.json"
source = "${preloader_output_dir}/system/etc/syscap.json"
part_name = "init"
}
ohos_prebuilt_etc("systemcapability.json") {
source = "${preloader_output_dir}/
${product_name}/
system/etc/SystemCapability.json"
source = "${preloader_output_dir}/system/etc/SystemCapability.json"
part_name = "init"
}
...
...
services/etc/param/ohos.para
浏览文件 @
e1a4db45
...
...
@@ -30,7 +30,7 @@ const.build.product=default
const.product.hardwareversion=default
const.product.bootloader.version=bootloader
const.product.cpu.abilist=default
const.product.software.version=OpenHarmony 3.2.5.
1
const.product.software.version=OpenHarmony 3.2.5.
2
const.product.incremental.version=default
const.product.firstapiversion=1
const.product.build.type=default
...
...
services/init/standard/BUILD.gn
浏览文件 @
e1a4db45
...
...
@@ -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/modules/bootchart/bootchart_static.c
浏览文件 @
e1a4db45
...
...
@@ -26,7 +26,7 @@ static int bootchartEarlyHook(const HOOK_INFO *info, void *cookie)
return
0
;
}
InitModuleMgrInstall
(
"
lib
bootchart"
);
InitModuleMgrInstall
(
"bootchart"
);
PLUGIN_LOGI
(
"bootchart enabled."
);
return
0
;
}
...
...
services/param/include/param_utils.h
浏览文件 @
e1a4db45
...
...
@@ -45,7 +45,9 @@ typedef struct cmdLineInfo {
#define FILENAME_LEN_MAX 255
#define MS_UNIT 1000
#ifndef UNUSED
#define UNUSED(x) (void)(x)
#endif
#define PARAM_ALIGN(len) (((len) + 0x03) & (~0x03))
#define PARAM_ENTRY(ptr, type, member) (type *)((char *)(ptr)-offsetof(type, member))
...
...
services/param/linux/BUILD.gn
浏览文件 @
e1a4db45
...
...
@@ -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
浏览文件 @
e1a4db45
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录