!2033 不开机维测补充修改,开机完成卸载插件

Merge pull request !2033 from mgceshuang/master
This commit is contained in:
openharmony_ci 2023-06-09 08:36:05 +00:00 committed by Gitee
commit 38e3115f29
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 17 additions and 2 deletions

View File

@ -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);

View File

@ -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,

View File

@ -28,6 +28,8 @@ int InitModuleMgrInstall(const char *moduleName);
void InitModuleMgrUnInstall(const char *moduleName);
void AutorunModuleMgrUnInstall(const char *moduleName);
void InitModuleMgrDump(void);
#ifdef __cplusplus

View File

@ -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);

View File

@ -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" },

View File

@ -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.

View File

@ -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;
}