Improve flash image handling of mounting

Flashing an image does not always require storage to be mounted.

Change-Id: I9d2a69cee9053f7829e51486d727e2e0b522c5da
This commit is contained in:
Ethan Yonker
2016-01-15 16:46:35 -06:00
committed by Dees Troy
parent 1308d53e24
commit b78fbdfabc
+9 -2
View File
@@ -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);