diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-10-11 10:01:18 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-10-11 10:01:18 +0000 |
commit | 6af32c394fdb4ec4712f009e43a81deea00f8a8d (patch) | |
tree | 417b353a9f7dfae5100382d7f7b6373cfeaada47 | |
parent | 49f1e68d83b92d539b0daea7cee98a4a73c10683 (diff) | |
parent | 3e45d8fe1711d3df2b1af9f42df230380fce4911 (diff) |
Snap for 9160906 from 3e45d8fe1711d3df2b1af9f42df230380fce4911 to t-keystone-qcom-release
Change-Id: Id266375a48a8cadd181f8e6c5be62ca1748b3078
-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 ffaa4dec..eeecd6a7 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; |