diff --git a/services/init/standard/init.c b/services/init/standard/init.c index b03b5f444..d3a362945 100755 --- a/services/init/standard/init.c +++ b/services/init/standard/init.c @@ -254,6 +254,15 @@ static HOOK_MGR *bootStageHookMgr = NULL; HOOK_MGR *GetBootStageHookMgr() { + if (bootStageHookMgr != NULL) { + return bootStageHookMgr; + } + + /* + * Create bootstage hook manager for booting only. + * When boot completed, this manager will be destroyed. + */ + bootStageHookMgr = HookMgrCreate(INIT_BOOTSTAGE_HOOK_NAME); return bootStageHookMgr; } @@ -359,12 +368,6 @@ void SystemConfig(void) options.preHook = InitPreHook; options.postHook = InitPostHook; - /* - * Create bootstage hook manager for booting only. - * When boot completed, this manager will be destroyed. - */ - bootStageHookMgr = HookMgrCreate(INIT_BOOTSTAGE_HOOK_NAME); - HookMgrExecute(GetBootStageHookMgr(), INIT_GLOBAL_INIT, (void *)&timingStat, (void *)&options); InitServiceSpace();