diff --git a/services/sdcard_update/sdcard_update.cpp b/services/sdcard_update/sdcard_update.cpp index f104c875dc4e11ec446f5cc3b4b18d124d67f327..6ee486c68562cadb9ac0173fbcea80564d81d60b 100644 --- a/services/sdcard_update/sdcard_update.cpp +++ b/services/sdcard_update/sdcard_update.cpp @@ -98,10 +98,12 @@ UpdaterStatus CheckSdcardPkgs(UpdaterParams &upParams) LOG(INFO) << "get sd card from dev succeed, skip get package from sd card"; return UPDATE_SUCCESS; } + if (GetSdcardInternalPkgs(upParams) == UPDATE_SUCCESS) { LOG(INFO) << "get sdcard internal pkgs succeed"; return UPDATE_SUCCESS; } + std::string mountPoint = std::string(SDCARD_PATH); std::vector sdcardStr = GetBlockDevicesByMountPoint(mountPoint); if (sdcardStr.empty()) { @@ -129,6 +131,7 @@ UpdaterStatus CheckSdcardPkgs(UpdaterParams &upParams) } return UPDATE_SUCCESS; } + __attribute__((weak)) UpdaterStatus GetSdcardInternalPkgs(UpdaterParams &upParams) { LOG(INFO) << "not implemented get normal update sdcard pkgs"; diff --git a/services/updater.cpp b/services/updater.cpp index 3bac7406a5e986a5e019b067266eaea6d3024eb4..2bf70ddd83f08363be8f134fb84b801b785a06b4 100644 --- a/services/updater.cpp +++ b/services/updater.cpp @@ -257,11 +257,9 @@ UpdaterStatus DoInstallUpdaterPackage(PkgManager::PkgManagerPtr pkgManager, Upda return UPDATE_CORRUPT; } - if (SetupPartitions(updateMode != SDCARD_UPDATE || - Utils::CheckUpdateMode(Updater::SDCARD_INTRAL_MODE) || - Utils::CheckUpdateMode(Updater::FACTORY_INTERNAL_MODE) || - upParams.sdExtMode == SDCARD_UPDATE_FROM_DATA || - upParams.sdExtMode == SDCARD_UPDATE_FROM_DEV) != 0) { + if (SetupPartitions(updateMode != SDCARD_UPDATE || upParams.sdExtMode == SDCARD_UPDATE_FROM_DEV || + upParams.sdExtMode == SDCARD_UPDATE_FROM_DATA || Utils::CheckUpdateMode(Updater::SDCARD_INTRAL_MODE) || + Utils::CheckUpdateMode(Updater::FACTORY_INTERNAL_MODE)) != 0) { UPDATER_UI_INSTANCE.ShowUpdInfo(TR(UPD_SETPART_FAIL), true); UPDATER_LAST_WORD(UPDATE_ERROR); return UPDATE_ERROR;