From 4555ac90a569e34e0a1ea1585e6739ee08025993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=87=AF?= Date: Wed, 16 Apr 2025 07:27:30 +0000 Subject: [PATCH 1/2] update services/updater.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈凯 --- services/updater.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/updater.cpp b/services/updater.cpp index c954de35..930284bc 100644 --- a/services/updater.cpp +++ b/services/updater.cpp @@ -610,7 +610,10 @@ static std::string GetBinaryPath(PkgManager::PkgManagerPtr pkgManager, UpdaterPa { std::string fullPath = GetWorkPath() + std::string(UPDATER_BINARY); (void)Utils::DeleteFile(fullPath); - if (ExtractUpdaterBinary(pkgManager, upParams.updatePackage[upParams.pkgLocation], UPDATER_BINARY) != 0) { + if (access("/data/updater/rollback", F_OK) != 0) { + LOG(INFO) << "There is rollback, use updater_binary in device"; + fullPath = "/bin/updater_binary"; + } else if (ExtractUpdaterBinary(pkgManager, upParams.updatePackage[upParams.pkgLocation], UPDATER_BINARY) != 0) { LOG(INFO) << "There is no valid updater_binary in package, use updater_binary in device"; fullPath = "/bin/updater_binary"; } -- Gitee From f51ae4e6166b3e2ca473f1e73cead8c820b53389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=87=AF?= Date: Wed, 16 Apr 2025 07:47:41 +0000 Subject: [PATCH 2/2] update services/updater.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈凯 --- services/updater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/updater.cpp b/services/updater.cpp index 930284bc..f20481a2 100644 --- a/services/updater.cpp +++ b/services/updater.cpp @@ -610,7 +610,7 @@ static std::string GetBinaryPath(PkgManager::PkgManagerPtr pkgManager, UpdaterPa { std::string fullPath = GetWorkPath() + std::string(UPDATER_BINARY); (void)Utils::DeleteFile(fullPath); - if (access("/data/updater/rollback", F_OK) != 0) { + if (access("/data/updater/rollback", F_OK) == 0) { LOG(INFO) << "There is rollback, use updater_binary in device"; fullPath = "/bin/updater_binary"; } else if (ExtractUpdaterBinary(pkgManager, upParams.updatePackage[upParams.pkgLocation], UPDATER_BINARY) != 0) { -- Gitee