!2995 init代码优化整改

Merge pull request !2995 from 林楠木/LHCY
This commit is contained in:
openharmony_ci 2024-07-23 08:58:47 +00:00 committed by Gitee
commit 6935991720
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
10 changed files with 13 additions and 9 deletions

View File

@ -48,7 +48,7 @@ private:
return deathRecipient_;
}
static const int DEVICEINFO_LOAD_SA_TIMEOUT_MS = 60000;
static const int DEVICEINFO_LOAD_SA_TIMEOUT_MS = 5000;
void LoadDeviceInfoSa(std::unique_lock<std::mutex> &lock);
sptr<IDeviceInfo> GetService(std::unique_lock<std::mutex> &lock);
std::mutex lock_;

View File

@ -67,8 +67,8 @@ typedef enum {
ACTION_SANDBOX = 0,
ACTION_DUMP,
ACTION_MODULEMGR,
ACTION_APP_SANDBOX,
ACTION_APP_SPAWNTIME,
ACTION_APP_SANDBOX,
ACTION_MAX
} ActionType;

View File

@ -219,7 +219,7 @@ int MountOverlayOne(const char *mnt)
int RemountOverlay(void)
{
char *remountPath[] = { "/usr", "/vendor", "/sys_prod", "/chip_prod", "/preload", "/cust" };
char *remountPath[] = { "/usr", "/vendor", "/sys_prod", "/chip_prod", "/preload", "/cust", "/version" };
for (size_t i = 0; i < ARRAY_LENGTH(remountPath); i++) {
struct stat statInfo;
char dirMnt[MAX_BUFFER_LEN] = {0};

View File

@ -17,6 +17,7 @@
#define EROFS_OVERLAY_COMMON_H
#include <stdbool.h>
#include <stdint.h>
#include "fs_manager/ext4_super_block.h"
#include "fs_manager/erofs_super_block.h"

View File

@ -124,7 +124,7 @@ static int FormatExt4(const char *fsBlkDev, const char *fsMntPoint)
if (ret) {
INIT_LOGE("e2fsdroid failed returned %d", ret);
}
return ret;
return 0;
}
static void OverlayRemountPre(const char *mnt)

View File

@ -49,7 +49,8 @@ static int SendAppspawnCmdMessage(const CmdAgent *agent, uint16_t type, const ch
BEGET_ERROR_CHECK(ret == 0, return -1, "AppSpawnClientInit error, errno = %d", errno);
AppSpawnReqMsgHandle reqHandle;
ret = AppSpawnReqMsgCreate(MSG_DUMP, ptyName, &reqHandle);
BEGET_ERROR_CHECK(ret == 0, AppSpawnClientDestroy(clientHandle); return -1, "AppSpawnReqMsgCreate error");
BEGET_ERROR_CHECK(ret == 0, AppSpawnClientDestroy(clientHandle);
return -1, "AppSpawnReqMsgCreate error");
ret = AppSpawnReqMsgAddStringInfo(reqHandle, "pty-name", ptyName);
BEGET_ERROR_CHECK(ret == 0, AppSpawnClientDestroy(clientHandle);
return -1, "add %s request message error", ptyName);

View File

@ -26,11 +26,11 @@
#include <sched.h>
#include "begetctl.h"
#include "init_param.h"
#include "param_manager.h"
#include "param_security.h"
#include "param_init.h"
#include "init_param.h"
#include "shell_utils.h"
#include "param_init.h"
#include "beget_ext.h"
#ifdef PARAM_SUPPORT_SELINUX
#include <policycoreutils.h>

View File

@ -92,7 +92,7 @@ extern "C" {
#endif
#define PARAM_WORKSPACE_SMALL (1024 * 10)
#define PARAM_WORKSPACE_DEF (1024 * 30)
#define PARAM_WORKSPACE_DAC (1024 * 60)
#define PARAM_WORKSPACE_DAC (1024 * 1024 * 2)
#endif // __LITEOS_A__
#endif // __LITEOS_M__
#endif // STARTUP_INIT_TEST

View File

@ -330,7 +330,7 @@ static int LoadParamFromImport_(char *buffer, const int buffSize, uint32_t mode)
}
char *target = calloc(PATH_MAX, 1);
PARAM_CHECK(target != NULL, return -1, "Failed to alloc memory");
if (strncpy_s(target, buffSize, buffer + IMPORT_PREFIX_LEN + spaceCount, buffSize) != 0) {
if (strncpy_s(target, PATH_MAX, buffer + IMPORT_PREFIX_LEN + spaceCount, buffSize) != 0) {
PARAM_LOGE("Failed to get value of import.");
free(target);
return -1;

View File

@ -645,6 +645,8 @@ int OpenConsole(void)
{
#ifndef __LITEOS_M__
return OpenStdioDevice("/dev/console", 1);
#else
return 0;
#endif
}