From f7f07090ecdfb527fab2808c7a2383b5213a7d6f Mon Sep 17 00:00:00 2001 From: liaoxianyi Date: Tue, 3 Sep 2024 11:46:05 +0000 Subject: [PATCH] =?UTF-8?q?sd=E5=8D=A1=E5=8D=87=E7=BA=A7=E6=97=A0=E5=8D=A1?= =?UTF-8?q?=E7=AD=89=E5=BE=85=E6=97=B6=E9=97=B4=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liaoxianyi --- services/sdcard_update/sdcard_update.cpp | 9 ++++++--- services/sdcard_update/sdcard_update.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/services/sdcard_update/sdcard_update.cpp b/services/sdcard_update/sdcard_update.cpp index f13bf526..4f26c7cf 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 9f238b03..fa914704 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 -- Gitee