diff options
author | alk3pInjection <webmaster@raspii.tech> | 2023-01-11 15:53:05 +0800 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2023-01-11 15:53:05 +0800 |
commit | a7c2a69702471e09259944f9ad6e56d4a350b524 (patch) | |
tree | 3ed66186cc78e23c378396d12bdc8ff29c6a25ab | |
parent | f069f70593ec88a5d5e2e5d459beee78bace719a (diff) | |
parent | 1f13efa151082311cc0f1739a3553879b01aaf1c (diff) |
Merge tag 'LA.QSSI.13.0.r1-08600-qssi.0' into tachibana
"LA.QSSI.13.0.r1-08600-qssi.0"
Change-Id: I847087e8a62ce88aeaf0cafa336d9b489d7588ee
-rw-r--r-- | install/fuse_install.cpp | 14 | ||||
-rw-r--r-- | recovery.cpp | 14 |
2 files changed, 24 insertions, 4 deletions
diff --git a/install/fuse_install.cpp b/install/fuse_install.cpp index c4a350d1..72c11ce9 100644 --- a/install/fuse_install.cpp +++ b/install/fuse_install.cpp @@ -45,6 +45,8 @@ #define SDCARD_BLK_0_PATH "/dev/block/mmcblk0p1" #define MMC_1_TYPE_PATH "/sys/block/mmcblk1/device/type" #define SDCARD_BLK_1_PATH "/dev/block/mmcblk1p1" +#define SDEXPRESS_0_TYPE_PATH "/sys/block/nvme0n1/device/transport" +#define SDEXPRESS_BLK_0_PATH "/dev/block/nvme0n1p1" static constexpr const char* SDCARD_ROOT = "/sdcard"; // How long (in seconds) we wait for the fuse-provided package file to @@ -225,7 +227,7 @@ static int check_mmc_is_sdcard (const char* mmc_type_path) return -1; } LOG(INFO) << "MMC type is : " << mmc_type.c_str(); - if (!strncmp(mmc_type.c_str(), "SD", strlen("SD"))) + if (!strncmp(mmc_type.c_str(), "SD", strlen("SD")) || !strncmp(mmc_type.c_str(), "pcie", strlen("pcie"))) return 0; else return -1; @@ -241,7 +243,7 @@ static int do_sdcard_mount() { LOG(ERROR) << "Unknown volume for /sdcard. Check fstab\n"; goto error; } - if (strncmp(v->fs_type.c_str(), "vfat", sizeof("vfat"))) { + if (strncmp(v->fs_type.c_str(), "vfat", sizeof("vfat")) && strncmp(v->fs_type.c_str(), "exfat", sizeof("exfat"))) { LOG(ERROR) << "Unsupported format on the sdcard: " << v->fs_type.c_str() << "\n"; goto error; @@ -263,6 +265,14 @@ static int do_sdcard_mount() { v->flags, v->fs_options.c_str()); } + else if (check_mmc_is_sdcard(SDEXPRESS_0_TYPE_PATH) == 0) { + LOG(INFO) << "Mounting sdexpress on " << SDEXPRESS_BLK_0_PATH; + rc = mount(SDEXPRESS_BLK_0_PATH, + v->mount_point.c_str(), + v->fs_type.c_str(), + v->flags, + v->fs_options.c_str()); + } else { LOG(ERROR) << "Unable to get the block path for sdcard."; goto error; diff --git a/recovery.cpp b/recovery.cpp index 57feb31b..2f87f07b 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -77,6 +77,8 @@ static constexpr const char* CACHE_ROOT = "/cache"; #define SDCARD_BLK_0_PATH "/dev/block/mmcblk0p1" #define MMC_1_TYPE_PATH "/sys/block/mmcblk1/device/type" #define SDCARD_BLK_1_PATH "/dev/block/mmcblk1p1" +#define SDEXPRESS_0_TYPE_PATH "/sys/block/nvme0n1/device/transport" +#define SDEXPRESS_BLK_0_PATH "/dev/block/nvme0n1p1" static bool save_current_log = false; @@ -331,7 +333,7 @@ static int check_mmc_is_sdcard (const char* mmc_type_path) return -1; } LOG(INFO) << "MMC type is : " << mmc_type.c_str(); - if (!strncmp(mmc_type.c_str(), "SD", strlen("SD"))) + if (!strncmp(mmc_type.c_str(), "SD", strlen("SD")) || !strncmp(mmc_type.c_str(), "pcie", strlen("pcie"))) return 0; else return -1; @@ -348,7 +350,7 @@ static int do_sdcard_mount(RecoveryUI* ui) ui->Print("Unknown volume for /sdcard. Check fstab\n"); goto error; } - if (strncmp(v->fs_type.c_str(), "vfat", sizeof("vfat"))) { + if (strncmp(v->fs_type.c_str(), "vfat", sizeof("vfat")) && strncmp(v->fs_type.c_str(), "exfat", sizeof("exfat"))) { ui->Print("Unsupported format on the sdcard: %s\n", v->fs_type.c_str()); goto error; @@ -370,6 +372,14 @@ static int do_sdcard_mount(RecoveryUI* ui) v->flags, v->fs_options.c_str()); } + else if (check_mmc_is_sdcard(SDEXPRESS_0_TYPE_PATH) == 0) { + LOG(INFO) << "Mounting sdexpress on " << SDEXPRESS_BLK_0_PATH; + rc = mount(SDEXPRESS_BLK_0_PATH, + v->mount_point.c_str(), + v->fs_type.c_str(), + v->flags, + v->fs_options.c_str()); + } else { LOG(ERROR) << "Unable to get the block path for sdcard."; goto error; |