From 0a4b0cf43182e91ead0df31364154e7299450055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=93=9D=E8=89=B2=E5=A4=A7=E9=AD=94=E7=8E=8B?= Date: Wed, 21 May 2025 16:24:08 +0800 Subject: [PATCH 1/3] Signed-off-by:high_level <352754628@qq.com> --- services/updater_binary/update_processor.cpp | 7 +------ services/updater_main.cpp | 3 +++ updater_default_cfg.gni | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/services/updater_binary/update_processor.cpp b/services/updater_binary/update_processor.cpp index 49e841e3..78a17325 100644 --- a/services/updater_binary/update_processor.cpp +++ b/services/updater_binary/update_processor.cpp @@ -526,11 +526,6 @@ int ProcessUpdater(bool retry, int pipeFd, const std::string &packagePath, const } }); PkgManager::ReleasePackageInstance(pkgManager); -#ifndef UPDATER_UT - if (ret == 0) { - SetActiveSlot(); - } -#endif return ret; } -} // Updater \ No newline at end of file +} // Updater diff --git a/services/updater_main.cpp b/services/updater_main.cpp index 6f31d80c..137925e7 100644 --- a/services/updater_main.cpp +++ b/services/updater_main.cpp @@ -887,6 +887,9 @@ static void ShowSuccessUi(UpdaterParams &upParams, UpdaterStatus &status) __attribute__((weak)) UpdaterStatus CheckAndSetSlot([[maybe_unused]]UpdaterParams &upParams) { LOG(INFO) << "not need check and set slot"; +#ifndef UPDATER_UT + SetActiveSlot(); //UPDATER_AB_SUPPORT +#endif return UPDATE_SUCCESS; } diff --git a/updater_default_cfg.gni b/updater_default_cfg.gni index e2036f20..4f84e9f2 100644 --- a/updater_default_cfg.gni +++ b/updater_default_cfg.gni @@ -13,7 +13,7 @@ import("//build/ohos.gni") -init_feature_ab_partition = true +init_feature_ab_partition = false declare_args() { updater_cfg_file = "" updater_ui_support = true @@ -45,7 +45,7 @@ template("updater_gen") { } else { ohos_executable(target_name) { if (!is_asan && !is_emulator && target_name == "updater_binary") { - static_link = false + static_link = true } forward_variables_from(invoker, "*") -- Gitee From acc1de20eeeba6f17d9ab860ab65d05126444163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=93=9D=E8=89=B2=E5=A4=A7=E9=AD=94=E7=8E=8B?= Date: Wed, 21 May 2025 17:15:17 +0800 Subject: [PATCH 2/3] Signed-off-by:high_level <352754628@qq.com> --- services/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/services/BUILD.gn b/services/BUILD.gn index 85bf7979..f1c260f5 100755 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -80,6 +80,7 @@ ohos_static_library("libupdater_static") { deps += [ "${updater_path}/interfaces/kits/misc_info:libmiscinfo", "${updater_path}/services/sdcard_update:libsdupdate", + "${updater_path}/interfaces/kits/slot_info:libslotinfo", ] if (defined(use_ptable)) { -- Gitee From 55b8ea747481e7f03c4cb369f86782769ab8687d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=93=9D=E8=89=B2=E5=A4=A7=E9=AD=94=E7=8E=8B?= Date: Wed, 21 May 2025 21:55:39 +0800 Subject: [PATCH 3/3] Signed-off-by:high_level <352754628@qq.com> --- services/updater_main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/services/updater_main.cpp b/services/updater_main.cpp index 137925e7..c92a607f 100644 --- a/services/updater_main.cpp +++ b/services/updater_main.cpp @@ -50,6 +50,7 @@ #include "utils.h" #include "factory_reset/factory_reset.h" #include "write_state/write_state.h" +#include "slot_info/slot_info.h" namespace Updater { using Utils::String2Int; -- Gitee