From 3f5c4e8dfe4d29d793251379c8f8fdcda2008088 Mon Sep 17 00:00:00 2001 From: Dees_Troy Date: Fri, 1 Feb 2013 15:16:59 +0000 Subject: Fix fail over to vfat from exfat Fix issues with MD5 checking using chdir and leaving the working dir in a subfolder that prevented unmounting sometimes. Change-Id: I01a563d722f474297ed3f7a30064c3a61748ade3 --- partitionmanager.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'partitionmanager.cpp') diff --git a/partitionmanager.cpp b/partitionmanager.cpp index 5230810f1..19efd424a 100644 --- a/partitionmanager.cpp +++ b/partitionmanager.cpp @@ -485,8 +485,7 @@ bool TWPartitionManager::Make_MD5(bool generate_md5, string Backup_Folder, strin ui_print(" * Generating md5...\n"); if (TWFunc::Path_Exists(Full_File)) { - command = "md5sum " + Backup_Filename + " > " + Backup_Filename + ".md5"; - chdir(Backup_Folder.c_str()); + command = "cd '" + Backup_Folder + "' && md5sum '" + Backup_Filename + "' > '" + Backup_Filename + ".md5'"; if (TWFunc::Exec_Cmd(command, result) == 0) { ui_print(" * MD5 Created.\n"); return true; @@ -503,8 +502,7 @@ bool TWPartitionManager::Make_MD5(bool generate_md5, string Backup_Folder, strin intToStr << index; ostringstream fn; fn << setw(3) << setfill('0') << intToStr.str(); - command = "md5sum " + Backup_Filename + fn.str() + " >" + Backup_Filename + fn.str() + ".md5"; - chdir(Backup_Folder.c_str()); + command = "cd '" + Backup_Folder + "' && md5sum '" + Backup_Filename + fn.str() + "' > '" + Backup_Filename + fn.str() + ".md5'"; if (TWFunc::Exec_Cmd(command, result) != 0) { ui_print(" * MD5 Error.\n"); return false; @@ -887,7 +885,9 @@ int TWPartitionManager::Run_Backup(void) { Update_System_Details(); UnMount_Main_Partitions(); ui_print("[BACKUP COMPLETED IN %d SECONDS]\n\n", total_time); // the end - return true; + string backup_log = Full_Backup_Path + "recovery.log"; + TWFunc::copy_file("/tmp/recovery.log", backup_log, 0644); + return true; } bool TWPartitionManager::Restore_Partition(TWPartition* Part, string Restore_Name, int partition_count) { -- cgit v1.2.3