提交 84a840d9 编写于 作者: M mgceshuang

[bootDetector] uninstall the plugin after boot complete

Signed-off-by: Nmgceshuang <mashuang13@huawei.com>
上级 c94657fd
......@@ -54,6 +54,10 @@ __attribute__((weak)) void RetriggerUeventByPath(int sockFd, char *path)
}
#endif
__attribute__((weak)) void InitPostMount(const char *mountPoint, int rc)
{
}
bool IsSupportedFilesystem(const char *fsType)
{
bool supported = false;
......@@ -406,6 +410,7 @@ int MountOneItem(FstabItem *item)
}
int rc = Mount(item->deviceName, item->mountPoint, item->fsType, mountFlags, fsSpecificData);
InitPostMount(item->mountPoint, rc);
if (rc != 0) {
if (FM_MANAGER_NOFAIL_ENABLED(item->fsManagerFlags)) {
BEGET_LOGE("Mount no fail device %s to %s failed, err = %d", item->deviceName, item->mountPoint, errno);
......
......@@ -27,7 +27,7 @@ extern "C" {
enum INIT_BOOTSTAGE {
INIT_GLOBAL_INIT = 0,
INIT_POST_MOUNT = 3,
INIT_FIRST_STAGE = 1,
INIT_POST_DATA_UNENCRYPT = 5,
INIT_PRE_PARAM_SERVICE = 10,
INIT_PRE_PARAM_LOAD = 20,
......
......@@ -28,6 +28,8 @@ int InitModuleMgrInstall(const char *moduleName);
void InitModuleMgrUnInstall(const char *moduleName);
void AutorunModuleMgrUnInstall(const char *moduleName);
void InitModuleMgrDump(void);
#ifdef __cplusplus
......
......@@ -40,6 +40,11 @@ void InitModuleMgrUnInstall(const char *moduleName)
ModuleMgrUninstall(defaultModuleMgr, moduleName);
}
void AutorunModuleMgrUnInstall(const char *moduleName)
{
ModuleMgrUninstall(autorunModuleMgr, moduleName);
}
static void InitModuleDump(const MODULE_INFO *moduleInfo)
{
printf("%s\n", moduleInfo->name);
......
......@@ -6,6 +6,7 @@
{ "name": "AddCmdExecutor" },
{ "name": "RemoveCmdExecutor" },
{ "name": "HookMgrAdd" },
{ "name": "HookMgrDel" },
{ "name": "GetBootStageHookMgr"},
{ "name": "InitAddGlobalInitHook" },
{ "name": "InitAddPreParamServiceHook" },
......@@ -14,6 +15,7 @@
{ "name": "InitAddPostCfgLoadHook" },
{ "name": "InitModuleMgrInstall" },
{ "name": "InitModuleMgrUnInstall" },
{ "name": "AutorunModuleMgrUnInstall" },
{ "name": "StartupLog" },
{ "name": "DoJobNow" },
{ "name": "GetServiceExtData" },
......
......@@ -230,7 +230,7 @@ void SystemPrepare(void)
// Make sure init log always output to /dev/kmsg.
EnableDevKmsg();
INIT_LOGI("Start init first stage.");
HookMgrExecute(GetBootStageHookMgr(), INIT_PRE_PARAM_SERVICE, NULL, NULL);
HookMgrExecute(GetBootStageHookMgr(), INIT_FIRST_STAGE, NULL, NULL);
// Only ohos normal system support
// two stages of init.
// If we are in updater mode, only one stage of init.
......
......@@ -260,6 +260,7 @@ static void BootEventParaFireByName(const char *paramName)
#ifndef STARTUP_INIT_TEST
HookMgrExecute(GetBootStageHookMgr(), INIT_BOOT_COMPLETE, NULL, NULL);
#endif
AutorunModuleMgrUnInstall("init_bootDetector");
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册