mirror of
https://gitee.com/openharmony/startup_init
synced 2025-02-07 12:27:08 +00:00
init 蓝黄区代码不一致,黄区代码同步到蓝区
Signed-off-by: 陈其文 <chenqiwen6@huawei.com>
This commit is contained in:
parent
d0b2036295
commit
3e5f515f7c
@ -16,20 +16,11 @@
|
||||
#ifndef EROFS_H
|
||||
#define EROFS_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#define EROFS_SUPER_MAGIC 0xE0F5E1E2
|
||||
#define EROFS_SUPER_BLOCK_START_POSITION 1024
|
||||
|
||||
#define __le64 uint64_t
|
||||
#define __le32 uint32_t
|
||||
#define __le16 uint16_t
|
||||
|
||||
#define __u64 uint64_t
|
||||
#define __u32 uint32_t
|
||||
#define __u16 uint16_t
|
||||
#define __u8 uint8_t
|
||||
|
||||
struct erofs_super_block {
|
||||
__le32 magic;
|
||||
__le32 checksum;
|
||||
@ -51,12 +42,4 @@ struct erofs_super_block {
|
||||
__u8 reserved2[44];
|
||||
} __attribute((packed)); /* 128 byte */
|
||||
|
||||
#undef __le64
|
||||
#undef __le32
|
||||
#undef __le16
|
||||
|
||||
#undef __u64
|
||||
#undef __u32
|
||||
#undef __u16
|
||||
#undef __u8
|
||||
#endif
|
@ -16,21 +16,12 @@
|
||||
#ifndef EXT4_H
|
||||
#define EXT4_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#define EXT4_SUPER_MAGIC 0xEF53
|
||||
#define EXT4_SUPER_BLOCK_START_POSITION 0x400
|
||||
#define BLOCK_SIZE_UNIT 4096
|
||||
|
||||
#define __le64 uint64_t
|
||||
#define __le32 uint32_t
|
||||
#define __le16 uint16_t
|
||||
|
||||
#define __u64 uint64_t
|
||||
#define __u32 uint32_t
|
||||
#define __u16 uint16_t
|
||||
#define __u8 uint8_t
|
||||
|
||||
typedef struct ext4_super_block {
|
||||
__le32 s_inodes_count;
|
||||
__le32 s_blocks_count_lo;
|
||||
@ -129,12 +120,4 @@ __le32 s_reserved[98];
|
||||
__le32 s_checksum;
|
||||
} ext4_super_block; /* 1024 byte */
|
||||
|
||||
#undef __le64
|
||||
#undef __le32
|
||||
#undef __le16
|
||||
|
||||
#undef __u64
|
||||
#undef __u32
|
||||
#undef __u16
|
||||
#undef __u8
|
||||
#endif
|
@ -16,7 +16,6 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "beget_ext.h"
|
||||
#include "param_comm.h"
|
||||
@ -54,19 +53,9 @@ static void GetVersions(void)
|
||||
}
|
||||
const char *tmp = strstr(fullName, "-");
|
||||
if (tmp == NULL) {
|
||||
tmp = fullName;
|
||||
while (*tmp) {
|
||||
if (isdigit(*tmp)) {
|
||||
break;
|
||||
}
|
||||
tmp++;
|
||||
}
|
||||
if (*tmp == 0) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
tmp++; // skip "-"
|
||||
return;
|
||||
}
|
||||
tmp++; // skip "-"
|
||||
int ret = sscanf_s(tmp, "%d.%d.%d.%d", &g_majorVersion, &g_seniorVersion, &g_featureVersion, &g_buildVersion);
|
||||
BEGET_LOGV("fullName %s %d.%d.%d.%d ret %d",
|
||||
fullName, g_majorVersion, g_seniorVersion, g_featureVersion, g_buildVersion, ret);
|
||||
|
@ -34,12 +34,25 @@
|
||||
#define ROOT_MOUNT_DIR "/"
|
||||
#define SYSTEM_DIR "/usr"
|
||||
|
||||
static bool MntNeedRemount(const char *mnt)
|
||||
{
|
||||
char *remountPath[] = { "/", "/vendor", "/sys_prod", "/chip_prod", "/preload", "/cust", "/version" };
|
||||
for (int i = 0; i < ARRAY_LENGTH(remountPath); i++) {
|
||||
if (strcmp(remountPath[i], mnt) == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool IsSkipRemount(const struct mntent mentry)
|
||||
{
|
||||
if (mentry.mnt_type == NULL || mentry.mnt_dir == NULL) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!MntNeedRemount(mentry.mnt_dir)) {
|
||||
return true;
|
||||
}
|
||||
if (strncmp(mentry.mnt_type, "erofs", strlen("erofs")) != 0) {
|
||||
return true;
|
||||
}
|
||||
|
@ -154,7 +154,7 @@
|
||||
"cmds" : [
|
||||
"mkdir /storage/media 0711 root root",
|
||||
"mkdir /data/misc 01771 system misc",
|
||||
"mkdir /data/misc/shared_relro 0771 nwebspawn nwebspawn",
|
||||
"mkdir /data/misc/shared_relro 0771 root root",
|
||||
"mkdir /data/local 0751 root root",
|
||||
"mkdir /data/vendor 0771 root root",
|
||||
"mkdir /data/local/ark-cache 0711 root root",
|
||||
|
@ -49,16 +49,16 @@ int main(int argc, char * const argv[])
|
||||
SystemPrepare(upTimeInMicroSecs);
|
||||
} else {
|
||||
LogInit();
|
||||
}
|
||||
|
||||
SystemInit();
|
||||
SystemExecuteRcs();
|
||||
SystemConfig(uptime);
|
||||
#ifdef EROFS_OVERLAY
|
||||
if (IsOverlayEnable()) {
|
||||
RemountOverlay();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
SystemInit();
|
||||
SystemExecuteRcs();
|
||||
SystemConfig(uptime);
|
||||
SystemRun();
|
||||
return 0;
|
||||
}
|
||||
|
@ -65,6 +65,7 @@ static int DoRebootPanic(int id, const char *name, int argc, const char **argv)
|
||||
ret = sprintf_s(tmp, len - 1, " %s", argv[i]);
|
||||
if (ret <= 0) {
|
||||
PLUGIN_LOGW("DoRebootPanic sprintf_s arg %s failed!", argv[i]);
|
||||
break;
|
||||
} else {
|
||||
len -= ret;
|
||||
tmp += ret;
|
||||
|
@ -654,6 +654,8 @@ int OpenKmsg(void)
|
||||
{
|
||||
#ifndef __LITEOS_M__
|
||||
return OpenStdioDevice("/dev/kmsg", 0);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -13,12 +13,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "init_unittest.h"
|
||||
|
||||
#include <cerrno>
|
||||
#include <cstdio>
|
||||
#include <ctime>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/stat.h>
|
||||
@ -28,6 +25,7 @@
|
||||
#include "init_cmds.h"
|
||||
#include "init_log.h"
|
||||
#include "init_service.h"
|
||||
#include "init_unittest.h"
|
||||
#include "init_adapter.h"
|
||||
#include "init_utils.h"
|
||||
#include "loop_event.h"
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "param_stub.h"
|
||||
#include "securec.h"
|
||||
#include "sys_event.h"
|
||||
#include "init_cmdexecutor.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace testing::ext;
|
||||
@ -133,4 +134,11 @@ HWTEST_F(SysEventUnitTest, SysEventTest_006, TestSize.Level1)
|
||||
{
|
||||
ReportSysEvent(nullptr);
|
||||
}
|
||||
|
||||
HWTEST_F(SysEventUnitTest, SysEventTest_007, TestSize.Level1)
|
||||
{
|
||||
const char *appfwkReady[] = {"bootevent.appfwk.ready"};
|
||||
int ret = PluginExecCmd("unset_bootevent", 1, appfwkReady);
|
||||
printf("SysEventTest_007:%d\n", ret);
|
||||
}
|
||||
} // namespace init_ut
|
||||
|
Loading…
x
Reference in New Issue
Block a user