mirror of
https://gitee.com/openharmony/startup_init
synced 2024-11-24 00:30:12 +00:00
Feature: add file_migrate_ability interface
Signed-off-by: fengjiahui4 <fengjiahui6@huawei.com>
This commit is contained in:
parent
f02c38cbfd
commit
8e96af126c
@ -28,6 +28,8 @@ extern "C" {
|
||||
enum INIT_BOOTSTAGE {
|
||||
INIT_GLOBAL_INIT = 0,
|
||||
INIT_FIRST_STAGE = 1,
|
||||
INIT_MOUNT_STAGE = 3,
|
||||
INIT_RESTORECON = 4,
|
||||
INIT_POST_DATA_UNENCRYPT = 5,
|
||||
INIT_PRE_PARAM_SERVICE = 10,
|
||||
INIT_PRE_PARAM_LOAD = 20,
|
||||
|
@ -295,6 +295,7 @@ static void DoMountFstabFile(const struct CmdArgs *ctx)
|
||||
INIT_LOGI("Mount partitions from fstab file \" %s \"", ctx->argv[0]);
|
||||
int ret = MountAllWithFstabFile(ctx->argv[0], 0);
|
||||
INIT_LOGI("Mount partitions from fstab file \" %s \" finish ret %d", ctx->argv[0], ret);
|
||||
HookMgrExecute(GetBootStageHookMgr(), INIT_MOUNT_STAGE, NULL, NULL);
|
||||
}
|
||||
|
||||
static void DoUmountFstabFile(const struct CmdArgs *ctx)
|
||||
@ -310,6 +311,20 @@ static void DoUmountFstabFile(const struct CmdArgs *ctx)
|
||||
|
||||
static void DoRestorecon(const struct CmdArgs *ctx)
|
||||
{
|
||||
int ret;
|
||||
INIT_CMD_INFO cmdInfo;
|
||||
cmdInfo.cmdName = "restorecon";
|
||||
cmdInfo.cmdContent = ctx->argv[0];
|
||||
cmdInfo.reserved = NULL;
|
||||
|
||||
HOOK_EXEC_OPTIONS options;
|
||||
options.flags = TRAVERSE_STOP_WHEN_ERROR;
|
||||
options.preHook = NULL;
|
||||
options.postHook = NULL;
|
||||
ret = HookMgrExecute(GetBootStageHookMgr(), INIT_RESTORECON, (void*)(&cmdInfo), (void*)(&options));
|
||||
if (ret == 0) {
|
||||
return;
|
||||
}
|
||||
PluginExecCmdByName("restoreContentRecurse", ctx->argv[0]);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user