未验证 提交 a1eab9e3 编写于 作者: O openharmony_ci 提交者: Gitee

!1462 系统优化:liteos 初始化处理

Merge pull request !1462 from cheng_jinsong/init1101
......@@ -14,16 +14,19 @@
declare_args() {
enable_ohos_startup_init_feature_watcher = true
enable_ohos_startup_init_feature_deviceinfo = true
# only for test
param_test = true
param_base_log = false
enable_ohos_startup_init_feature_ab_partition = false
# init begetctl support liteos
enable_ohos_startup_init_feature_begetctl_liteos = false
# only support mbedtls for hash
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 = ""
config_ohos_startup_init_lite_data_path = "/"
# boot_kernel_extended_cmdline for extend cmdline
}
......@@ -76,10 +76,6 @@ if (defined(ohos_lite)) {
defines = [ "_GNU_SOURCE" ]
if (enable_ohos_startup_init_feature_loader) {
defines += [ "PRODUCT_RK" ]
}
include_dirs = common_include_dirs
deps = [
"//base/startup/init/interfaces/innerkits:libbegetutil",
......
......@@ -26,22 +26,6 @@ static int main_cmd(BShellHandle shell, int argc, char* argv[])
BShellCmdHelp(shell, argc, argv);
return 0;
}
if (argc == REBOOT_CMD_NUMBER && strcmp(argv[1], "shutdown") != 0 &&
strcmp(argv[1], "updater") != 0 &&
strcmp(argv[1], "suspend") != 0 &&
strcmp(argv[1], "flashd") != 0 &&
#ifdef INIT_TEST
strcmp(argv[1], "charge") != 0 &&
#endif
#ifdef PRODUCT_RK
strcmp(argv[1], "loader") != 0 &&
#endif
strncmp(argv[1], "updater:", strlen("updater:")) != 0 &&
strncmp(argv[1], "flashd:", strlen("flashd:")) != 0) {
BShellCmdHelp(shell, argc, argv);
return 0;
}
int ret;
if (argc == REBOOT_CMD_NUMBER) {
ret = DoReboot(argv[1]);
......@@ -53,9 +37,11 @@ static int main_cmd(BShellHandle shell, int argc, char* argv[])
} else {
printf("[reboot command] DoReboot Api return ok\n");
}
#ifndef STARTUP_INIT_TEST
while (1) {
pause();
}
#endif
return 0;
}
......@@ -69,12 +55,7 @@ MODULE_CONSTRUCTOR(void)
{"reboot", main_cmd, "reboot and boot into updater", "reboot updater[:options]", ""},
{"reboot", main_cmd, "reboot and boot into flashd", "reboot flashd", ""},
{"reboot", main_cmd, "reboot and boot into flashd", "reboot flashd[:options]", ""},
#ifdef INIT_TEST
{"reboot", main_cmd, "reboot and boot into charge", "reboot charge", ""},
#endif
#ifdef PRODUCT_RK
{"reboot", main_cmd, "reboot loader", "reboot loader", ""}
#endif
};
for (size_t i = sizeof(infos) / sizeof(infos[0]); i > 0; i--) {
BShellEnvRegisterCmd(GetShellHandle(), &infos[i - 1]);
......
......@@ -137,9 +137,6 @@ ohos_executable("init") {
defines += [ "ASAN_DETECTOR" ]
}
if (enable_ohos_startup_init_feature_loader) {
defines += [ "PRODUCT_RK" ]
}
version_script = get_label_info(
"//base/startup/init/interfaces/innerkits/init_module_engine:libinit_stub_versionscript",
"target_gen_dir") + "/" + get_label_info(
......
......@@ -27,9 +27,6 @@ ohos_shared_library("rebootmodule") {
external_deps = [ "init:libinit_module_engine" ]
defines = []
if (enable_ohos_startup_init_feature_loader) {
defines += [ "PRODUCT_RK" ]
}
part_name = "init"
subsystem_name = "startup"
if (target_cpu == "arm64") {
......
......@@ -17,12 +17,10 @@
#include "param_manager.h"
#define MIN_SLEEP (100 * 1000)
static int g_flags = 0;
__attribute__((constructor)) static void ClientInit(void);
static void ClientDeinit(void);
static int InitParamClient(void)
#ifdef __LITEOS_A__
static int g_flags = 0;
__attribute__((constructor)) static int ClientInit(void)
{
if (PARAM_TEST_FLAG(g_flags, WORKSPACE_FLAGS_INIT)) {
return 0;
......@@ -37,23 +35,14 @@ static int InitParamClient(void)
return 0;
}
void ClientInit(void)
{
#ifdef __LITEOS_A__
#ifndef STARTUP_INIT_TEST
PARAM_LOGV("ClientInit");
(void)InitParamClient();
#endif
#endif
}
void ClientDeinit(void)
__attribute__((destructor)) static void ClientDeinit(void)
{
if (PARAM_TEST_FLAG(g_flags, WORKSPACE_FLAGS_INIT)) {
CloseParamWorkSpace();
}
PARAM_SET_FLAG(g_flags, 0);
}
#endif
int SystemSetParameter(const char *name, const char *value)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册