From b78fbdfabc4f5d6e2de0b123f58a61059aa2ad9c Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Fri, 15 Jan 2016 16:46:35 -0600 Subject: Improve flash image handling of mounting Flashing an image does not always require storage to be mounted. Change-Id: I9d2a69cee9053f7829e51486d727e2e0b522c5da --- partitionmanager.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/partitionmanager.cpp b/partitionmanager.cpp index 4cd3e7d59..eeeafb22c 100644 --- a/partitionmanager.cpp +++ b/partitionmanager.cpp @@ -2211,8 +2211,15 @@ bool TWPartitionManager::Flash_Image(string Filename) { gui_msg("image_flash_start=[IMAGE FLASH STARTED]"); gui_msg(Msg("img_to_flash=Image to flash: '{1}'")(Filename)); - if (!Mount_Current_Storage(true)) - return false; + if (!TWFunc::Path_Exists(Filename)) { + if (!Mount_By_Path(Filename, true)) { + return false; + } + if (!TWFunc::Path_Exists(Filename)) { + gui_msg(Msg(msg::kError, "unable_to_locate=Unable to locate {1}.")(Filename)); + return false; + } + } gui_msg("calc_restore=Calculating restore details..."); DataManager::GetValue("tw_flash_partition", Flash_List); -- cgit v1.2.3