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