From 9fe74f0214ed4ee1791c3b544db71aa6008ad43d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 26 Dec 2024 10:09:12 +0800 Subject: [PATCH 1/2] record block verify result Signed-off-by: unknown --- services/updater_main.cpp | 7 +++++++ services/updater_main.h | 1 + 2 files changed, 8 insertions(+) diff --git a/services/updater_main.cpp b/services/updater_main.cpp index 8abf00a4..5f354fed 100644 --- a/services/updater_main.cpp +++ b/services/updater_main.cpp @@ -488,6 +488,11 @@ UpdaterStatus DoUpdatePackages(UpdaterParams &upParams) return status; } +__attribute__((weak)) const char* GetBlockVerifyRes() +{ + return ""; +} + static void PostUpdatePackages(UpdaterParams &upParams, bool updateResult) { std::string writeBuffer; @@ -521,6 +526,8 @@ static void PostUpdatePackages(UpdaterParams &upParams, bool updateResult) if (writeBuffer != "") { writeBuffer.pop_back(); } + std::string blockVerifyRes = GetBlockVerifyRes(); + writeBuffer = blockVerifyRes + writeBuffer; LOG(INFO) << "post over, writeBuffer = " << writeBuffer; WriteDumpResult(writeBuffer, UPDATER_RESULT_FILE); DeleteInstallTimeFile(); diff --git a/services/updater_main.h b/services/updater_main.h index 699df7ee..c9219ec7 100644 --- a/services/updater_main.h +++ b/services/updater_main.h @@ -70,6 +70,7 @@ int32_t VerifySpecialPkgs([[maybe_unused]]UpdaterParams &upParams); void UpdaterVerifyFailEntry(bool verifyret); bool IsSpareBoardBoot(void); bool IsNeedWipe(); +const char* GetBlockVerifyRes(); #ifdef __cplusplus #if __cplusplus } -- Gitee From 6662e099f34004130b458b42723054623689a586 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Jan 2025 10:03:20 +0800 Subject: [PATCH 2/2] fix lz4 ut err Signed-off-by: unknown --- test/unittest/package/pkg_manager_unittest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unittest/package/pkg_manager_unittest.cpp b/test/unittest/package/pkg_manager_unittest.cpp index 76155969..1fcc53d2 100755 --- a/test/unittest/package/pkg_manager_unittest.cpp +++ b/test/unittest/package/pkg_manager_unittest.cpp @@ -643,7 +643,7 @@ HWTEST_F(PkgMangerTest, TestLz4Buffer, TestSize.Level1) EXPECT_EQ(0, test.TestDecompressLz4(lz4Info, uncompressedData, digest)); int32_t ret = 0; for (int32_t i = 0; i < LZ4F_MAX_BLOCKID; i++) { - lz4Info.compressionLevel = 2; + lz4Info.compressionLevel = 1; lz4Info.blockSizeID = i; ret = test.TestCompressBuffer(lz4Info.fileInfo, uncompressedData, digest); if (ret == 0) { -- Gitee