diff --git a/services/sdcard_update/sdcard_update.cpp b/services/sdcard_update/sdcard_update.cpp index f13bf526e67039730474d2b04670c7bcc933db58..4f26c7cfabddcf5a9dedd6eb2bef79bd042a6c9f 100644 --- a/services/sdcard_update/sdcard_update.cpp +++ b/services/sdcard_update/sdcard_update.cpp @@ -68,10 +68,13 @@ bool CheckPathNeedMountSD(UpdaterParams &upParams) return true; } -bool DoMountSdcard(std::vector &sdcardStr, std::string &mountPoint) +bool DoMountSdCard(std::vector &sdcardStr, std::string &mountPoint, UpdaterParams &upParams) { bool mountSuccess = false; - unsigned int retryTimes = 20; + unsigned int retryTimes = 20; // Wait 20s + if (upParams.sdExtMode == SDCARD_MAINIMG || upParams.sdExtMode == SDCARD_NORMAL_UPDATE) { + retryTimes = 60; // Wait 60s + } for (unsigned int retryCount = 1; retryCount <= retryTimes; retryCount++) { LOG(INFO) << "the retry time is: " << retryCount; for (auto item : sdcardStr) { @@ -119,7 +122,7 @@ UpdaterStatus CheckSdcardPkgs(UpdaterParams &upParams) } if ((Utils::CheckUpdateMode(Updater::SDCARD_MODE) && !Utils::CheckUpdateMode(Updater::SDCARD_INTRAL_MODE)) || (Utils::CheckUpdateMode(Updater::SDCARD_INTRAL_MODE) && CheckPathNeedMountSD(upParams))) { - if (!DoMountSdcard(sdcardStr, mountPoint)) { + if (!DoMountSdCard(sdcardStr, mountPoint, upParams)) { LOG(ERROR) << "mount sdcard fail!"; return UPDATE_ERROR; } diff --git a/services/sdcard_update/sdcard_update.h b/services/sdcard_update/sdcard_update.h index 9f238b0375ad9bb6e5bd4dbf4546b4256634d464..1816f65693d7ffefc7338839a7ea4b01df1889f3 100644 --- a/services/sdcard_update/sdcard_update.h +++ b/services/sdcard_update/sdcard_update.h @@ -37,6 +37,6 @@ UpdaterStatus GetSdcardInternalPkgs(UpdaterParams &upParams); #endif bool CheckPathNeedMountSD(UpdaterParams &upParams); -bool DoMountSdcard(std::vector &sdcardStr, std::string &mountPoint); +bool DoMountSdcard(std::vector &sdcardStr, std::string &mountPoint, UpdaterParams &upParams); } // namespace Updater #endif // SDCARD_UPDATE_H \ No newline at end of file