diff options
author | Dees_Troy <dees_troy@teamw.in> | 2012-09-18 21:40:25 +0200 |
---|---|---|
committer | Dees_Troy <dees_troy@teamw.in> | 2012-09-18 21:44:39 +0200 |
commit | 8170a921453945caffb31c06d563010e8a182b3d (patch) | |
tree | 570e5aebccc70b1c4ba2ae29b9e3dd16dd44e16d /partition.cpp | |
parent | Improve backup and restore (diff) | |
download | android_bootable_recovery-8170a921453945caffb31c06d563010e8a182b3d.tar android_bootable_recovery-8170a921453945caffb31c06d563010e8a182b3d.tar.gz android_bootable_recovery-8170a921453945caffb31c06d563010e8a182b3d.tar.bz2 android_bootable_recovery-8170a921453945caffb31c06d563010e8a182b3d.tar.lz android_bootable_recovery-8170a921453945caffb31c06d563010e8a182b3d.tar.xz android_bootable_recovery-8170a921453945caffb31c06d563010e8a182b3d.tar.zst android_bootable_recovery-8170a921453945caffb31c06d563010e8a182b3d.zip |
Diffstat (limited to '')
-rw-r--r-- | partition.cpp | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/partition.cpp b/partition.cpp index 27f855e5a..ad3198ba7 100644 --- a/partition.cpp +++ b/partition.cpp @@ -206,7 +206,6 @@ bool TWPartition::Process_Fstab_Line(string Line, bool Display_Error) { Display_Name = "Cache"; Wipe_Available_in_GUI = true; Wipe_During_Factory_Reset = true; - Update_Size(Display_Error); MTD_Name = "cache"; } else if (Mount_Point == "/datadata") { Wipe_During_Factory_Reset = true; @@ -218,8 +217,29 @@ bool TWPartition::Process_Fstab_Line(string Line, bool Display_Error) { Wipe_During_Factory_Reset = true; Display_Name = "SD-Ext"; Wipe_Available_in_GUI = true; - } else - Update_Size(Display_Error); + } +#ifdef TW_EXTERNAL_STORAGE_PATH + if (Mount_Point == EXPAND(TW_EXTERNAL_STORAGE_PATH)) { + Is_Storage = true; + Storage_Path = EXPAND(TW_EXTERNAL_STORAGE_PATH); + } +#else + if (Mount_Point == "/sdcard") { + Is_Storage = true; + Storage_Path = "/sdcard"; + } +#endif +#ifdef TW_INTERNAL_STORAGE_PATH + if (Mount_Point == EXPAND(TW_INTERNAL_STORAGE_PATH)) { + Is_Storage = true; + Storage_Path = EXPAND(TW_INTERNAL_STORAGE_PATH); + } +#else + if (Mount_Point == "/emmc") { + Is_Storage = true; + Storage_Path = "/emmc"; + } +#endif } else if (Is_Image(Fstab_File_System)) { Find_Actual_Block_Device(); Setup_Image(Display_Error); @@ -774,10 +794,17 @@ void TWPartition::Check_FS_Type() { return; // Running blkid on some mtd devices causes a massive crash Find_Actual_Block_Device(); - blkCommand = "blkid " + Actual_Block_Device + " > /tmp/blkidoutput.txt"; + if (!Is_Present) + return; + + if (TWFunc::Path_Exists("/tmp/blkidoutput.txt")) + system("rm /tmp/blkidoutput.txt"); + blkCommand = "blkid " + Actual_Block_Device + " > /tmp/blkidoutput.txt"; system(blkCommand.c_str()); fp = fopen("/tmp/blkidoutput.txt", "rt"); + if (fp == NULL) + return; while (fgets(blkOutput, sizeof(blkOutput), fp) != NULL) { blk = blkOutput; |