提交 9ea707c8 编写于 作者: S sun_fan

init: add disable two step switch

Signed-off-by: Nsun_fan <sun_fan1@hoperun.com>
上级 ec138686
......@@ -133,6 +133,11 @@ if (defined(ohos_lite)) {
"//third_party/toybox:toybox",
]
}
if (disable_init_two_stages) {
defines = [ "DISABLE_INIT_TWO_STAGES" ]
}
install_images = [
"system",
"updater",
......@@ -162,7 +167,12 @@ if (defined(ohos_lite)) {
# init etc files group
ohos_prebuilt_etc("init.cfg") {
source = "//base/startup/init_lite/services/etc/init.cfg"
if (disable_init_two_stages) {
source =
"//base/startup/init_lite/services/etc/init.without_two_stages.cfg"
} else {
source = "//base/startup/init_lite/services/etc/init.cfg"
}
part_name = "init"
}
......
此差异已折叠。
......@@ -36,7 +36,11 @@ void DoJob(const char *jobName);
void ReleaseAllJobs(void);
void DumpAllJobs(void);
#ifndef DISABLE_INIT_TWO_STAGES
#define INIT_CONFIGURATION_FILE "/etc/init.cfg"
#else
#define INIT_CONFIGURATION_FILE "/etc/init.without_two_stages.cfg"
#endif
#define OTHER_CFG_PATH "/system/etc/init"
#define MAX_PATH_ARGS_CNT 20
......
......@@ -46,6 +46,7 @@ void LogInit(void)
}
}
#ifndef DISABLE_INIT_TWO_STAGES
static pid_t StartUeventd(void)
{
char *const argv[] = {
......@@ -98,6 +99,7 @@ static void StartInitSecondStage(void)
exit(-1);
}
}
#endif
void SystemPrepare(void)
{
......@@ -105,12 +107,17 @@ void SystemPrepare(void)
// Make sure init log always output to /dev/kmsg.
EnableDevKmsg();
CreateDeviceNode();
#ifndef DISABLE_INIT_TWO_STAGES
// Only ohos normal system support
// two stages of init.
// If we are in updater mode, only one stage of init,
INIT_LOGI("DISABLE_INIT_TWO_STAGES not defined");
if (InUpdaterMode() == 0) {
StartInitSecondStage();
}
#else
INIT_LOGI("DISABLE_INIT_TWO_STAGES defined");
#endif
}
void SystemConfig(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册