summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2012-12-18 22:23:08 +0100
committerDees_Troy <dees_troy@teamw.in>2012-12-18 22:23:08 +0100
commit2204203a949234ceb652b1236c89837405d8fe5f (patch)
treef947013c4b25e545fae8bdec4412e28b0263ad74
parentMerge "Ignore bma150 in event handler" into jb-wip (diff)
downloadandroid_bootable_recovery-2204203a949234ceb652b1236c89837405d8fe5f.tar
android_bootable_recovery-2204203a949234ceb652b1236c89837405d8fe5f.tar.gz
android_bootable_recovery-2204203a949234ceb652b1236c89837405d8fe5f.tar.bz2
android_bootable_recovery-2204203a949234ceb652b1236c89837405d8fe5f.tar.lz
android_bootable_recovery-2204203a949234ceb652b1236c89837405d8fe5f.tar.xz
android_bootable_recovery-2204203a949234ceb652b1236c89837405d8fe5f.tar.zst
android_bootable_recovery-2204203a949234ceb652b1236c89837405d8fe5f.zip
-rw-r--r--partition.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/partition.cpp b/partition.cpp
index 32376c1bc..0590d981c 100644
--- a/partition.cpp
+++ b/partition.cpp
@@ -656,7 +656,25 @@ bool TWPartition::Mount(bool Display_Error) {
// Check the current file system before mounting
Check_FS_Type();
- if (mount(Actual_Block_Device.c_str(), Mount_Point.c_str(), Current_File_System.c_str(), 0, NULL) != 0) {
+ if (Fstab_File_System == "yaffs2") {
+ // mount an MTD partition as a YAFFS2 filesystem.
+ mtd_scan_partitions();
+ const MtdPartition* partition;
+ partition = mtd_find_partition_by_name(MTD_Name.c_str());
+ if (partition == NULL) {
+ LOGE("Failed to find '%s' partition to mount at '%s'\n",
+ MTD_Name.c_str(), Mount_Point.c_str());
+ return false;
+ }
+ if (mtd_mount_partition(partition, Mount_Point.c_str(), Fstab_File_System.c_str(), 0)) {
+ if (Display_Error)
+ LOGE("Failed to mount '%s' (MTD)\n", Mount_Point.c_str());
+ else
+ LOGI("Failed to mount '%s' (MTD)\n", Mount_Point.c_str());
+ return false;
+ } else
+ return true;
+ } else if (mount(Actual_Block_Device.c_str(), Mount_Point.c_str(), Current_File_System.c_str(), 0, NULL) != 0) {
if (Display_Error)
LOGE("Unable to mount '%s'\n", Mount_Point.c_str());
else