delete rk and init for litea

Signed-off-by: cheng_jinsong <chengjinsong2@huawei.com>
This commit is contained in:
cheng_jinsong 2022-11-02 09:23:29 +08:00
parent e45b365ba6
commit f6acb7ed5b
6 changed files with 12 additions and 49 deletions

View File

@ -14,16 +14,19 @@
declare_args() { declare_args() {
enable_ohos_startup_init_feature_watcher = true enable_ohos_startup_init_feature_watcher = true
enable_ohos_startup_init_feature_deviceinfo = true enable_ohos_startup_init_feature_deviceinfo = true
# only for test
param_test = true param_test = true
param_base_log = false param_base_log = false
enable_ohos_startup_init_feature_ab_partition = false enable_ohos_startup_init_feature_ab_partition = false
# init begetctl support liteos # init begetctl support liteos
enable_ohos_startup_init_feature_begetctl_liteos = false 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_thirdparty_mbedtls = true
enable_ohos_startup_init_lite_use_posix_file_api = false 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 # boot_kernel_extended_cmdline for extend cmdline
} }

View File

@ -76,10 +76,6 @@ if (defined(ohos_lite)) {
defines = [ "_GNU_SOURCE" ] defines = [ "_GNU_SOURCE" ]
if (enable_ohos_startup_init_feature_loader) {
defines += [ "PRODUCT_RK" ]
}
include_dirs = common_include_dirs include_dirs = common_include_dirs
deps = [ deps = [
"//base/startup/init/interfaces/innerkits:libbegetutil", "//base/startup/init/interfaces/innerkits:libbegetutil",

View File

@ -26,22 +26,6 @@ static int main_cmd(BShellHandle shell, int argc, char* argv[])
BShellCmdHelp(shell, argc, argv); BShellCmdHelp(shell, argc, argv);
return 0; 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; int ret;
if (argc == REBOOT_CMD_NUMBER) { if (argc == REBOOT_CMD_NUMBER) {
ret = DoReboot(argv[1]); ret = DoReboot(argv[1]);
@ -53,9 +37,11 @@ static int main_cmd(BShellHandle shell, int argc, char* argv[])
} else { } else {
printf("[reboot command] DoReboot Api return ok\n"); printf("[reboot command] DoReboot Api return ok\n");
} }
#ifndef STARTUP_INIT_TEST
while (1) { while (1) {
pause(); pause();
} }
#endif
return 0; 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 updater", "reboot updater[:options]", ""},
{"reboot", main_cmd, "reboot and boot into flashd", "reboot flashd", ""}, {"reboot", main_cmd, "reboot and boot into flashd", "reboot flashd", ""},
{"reboot", main_cmd, "reboot and boot into flashd", "reboot flashd[:options]", ""}, {"reboot", main_cmd, "reboot and boot into flashd", "reboot flashd[:options]", ""},
#ifdef INIT_TEST
{"reboot", main_cmd, "reboot and boot into charge", "reboot charge", ""}, {"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--) { for (size_t i = sizeof(infos) / sizeof(infos[0]); i > 0; i--) {
BShellEnvRegisterCmd(GetShellHandle(), &infos[i - 1]); BShellEnvRegisterCmd(GetShellHandle(), &infos[i - 1]);

View File

@ -137,9 +137,6 @@ ohos_executable("init") {
defines += [ "ASAN_DETECTOR" ] defines += [ "ASAN_DETECTOR" ]
} }
if (enable_ohos_startup_init_feature_loader) {
defines += [ "PRODUCT_RK" ]
}
version_script = get_label_info( version_script = get_label_info(
"//base/startup/init/interfaces/innerkits/init_module_engine:libinit_stub_versionscript", "//base/startup/init/interfaces/innerkits/init_module_engine:libinit_stub_versionscript",
"target_gen_dir") + "/" + get_label_info( "target_gen_dir") + "/" + get_label_info(

View File

@ -27,9 +27,6 @@ ohos_shared_library("rebootmodule") {
external_deps = [ "init:libinit_module_engine" ] external_deps = [ "init:libinit_module_engine" ]
defines = [] defines = []
if (enable_ohos_startup_init_feature_loader) {
defines += [ "PRODUCT_RK" ]
}
part_name = "init" part_name = "init"
subsystem_name = "startup" subsystem_name = "startup"
if (target_cpu == "arm64") { if (target_cpu == "arm64") {

View File

@ -17,12 +17,10 @@
#include "param_manager.h" #include "param_manager.h"
#define MIN_SLEEP (100 * 1000) #define MIN_SLEEP (100 * 1000)
#ifdef __LITEOS_A__
static int g_flags = 0; static int g_flags = 0;
__attribute__((constructor)) static int ClientInit(void)
__attribute__((constructor)) static void ClientInit(void);
static void ClientDeinit(void);
static int InitParamClient(void)
{ {
if (PARAM_TEST_FLAG(g_flags, WORKSPACE_FLAGS_INIT)) { if (PARAM_TEST_FLAG(g_flags, WORKSPACE_FLAGS_INIT)) {
return 0; return 0;
@ -37,23 +35,14 @@ static int InitParamClient(void)
return 0; return 0;
} }
void ClientInit(void) __attribute__((destructor)) static void ClientDeinit(void)
{
#ifdef __LITEOS_A__
#ifndef STARTUP_INIT_TEST
PARAM_LOGV("ClientInit");
(void)InitParamClient();
#endif
#endif
}
void ClientDeinit(void)
{ {
if (PARAM_TEST_FLAG(g_flags, WORKSPACE_FLAGS_INIT)) { if (PARAM_TEST_FLAG(g_flags, WORKSPACE_FLAGS_INIT)) {
CloseParamWorkSpace(); CloseParamWorkSpace();
} }
PARAM_SET_FLAG(g_flags, 0); PARAM_SET_FLAG(g_flags, 0);
} }
#endif
int SystemSetParameter(const char *name, const char *value) int SystemSetParameter(const char *name, const char *value)
{ {