From da4bcfb13a4b630ad4811bc9db7554028dfd033f Mon Sep 17 00:00:00 2001 From: chenzihan Date: Mon, 11 Apr 2022 19:59:51 +0800 Subject: [PATCH 1/3] Signed-off-by: chenzihan fix:fix about user_wipe_data --- interfaces/kits/updaterkits/BUILD.gn | 1 + interfaces/kits/updaterkits/updaterkits.cpp | 7 ++----- update_updater | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) create mode 160000 update_updater diff --git a/interfaces/kits/updaterkits/BUILD.gn b/interfaces/kits/updaterkits/BUILD.gn index fd59e521..2c68114f 100755 --- a/interfaces/kits/updaterkits/BUILD.gn +++ b/interfaces/kits/updaterkits/BUILD.gn @@ -30,6 +30,7 @@ ohos_static_library("libupdaterkits") { "//third_party/bounds_checking_function:libsec_static", ] + external_deps = [ "init:libbegetutil" ] subsystem_name = "updater" part_name = "updater" } diff --git a/interfaces/kits/updaterkits/updaterkits.cpp b/interfaces/kits/updaterkits/updaterkits.cpp index bfc2a6a4..2f29eb7a 100755 --- a/interfaces/kits/updaterkits/updaterkits.cpp +++ b/interfaces/kits/updaterkits/updaterkits.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include "misc_info/misc_info.h" #include "parameters.h" #include "securec.h" @@ -39,11 +40,7 @@ static bool WriteToMiscAndRebootToUpdater(const std::string &miscFile, int32_t propertyMaxSize = 92; char updateCmd[propertyMaxSize]; void(snprintf_s(updateCmd, propertyMaxSize, propertyMaxSize - 1, "reboot,updater:%s", updateMsg.update)); - bool bRet = OHOS::system::SetParameter("ohos.startup.powerctrl", updateCmd); - if (!bRet) { - std::cout << "WriteToMiscAndRebootToUpdater SetParameter failed, errno: " << errno << std::endl; - return false; - } + DoReboot(updateCmd); while (true) { pause(); } diff --git a/update_updater b/update_updater new file mode 160000 index 00000000..341c81b1 --- /dev/null +++ b/update_updater @@ -0,0 +1 @@ +Subproject commit 341c81b1d46310ea96ab9f07842661a8db209af7 -- Gitee From ac4f4b11dc692a2ea2bafa13bb8d9164db073aae Mon Sep 17 00:00:00 2001 From: chenzihan Date: Tue, 12 Apr 2022 12:12:52 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20upda?= =?UTF-8?q?te=5Fupdater?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update_updater | 1 - 1 file changed, 1 deletion(-) delete mode 160000 update_updater diff --git a/update_updater b/update_updater deleted file mode 160000 index 341c81b1..00000000 --- a/update_updater +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 341c81b1d46310ea96ab9f07842661a8db209af7 -- Gitee From 60c67e98a22ba789a9db83274ec8a916aafd6c09 Mon Sep 17 00:00:00 2001 From: chenzihan Date: Mon, 11 Apr 2022 19:59:51 +0800 Subject: [PATCH 3/3] Signed-off-by: chenzihan fix:fix about user_wipe_data --- interfaces/kits/updaterkits/BUILD.gn | 1 + interfaces/kits/updaterkits/updaterkits.cpp | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/interfaces/kits/updaterkits/BUILD.gn b/interfaces/kits/updaterkits/BUILD.gn index fd59e521..2c68114f 100755 --- a/interfaces/kits/updaterkits/BUILD.gn +++ b/interfaces/kits/updaterkits/BUILD.gn @@ -30,6 +30,7 @@ ohos_static_library("libupdaterkits") { "//third_party/bounds_checking_function:libsec_static", ] + external_deps = [ "init:libbegetutil" ] subsystem_name = "updater" part_name = "updater" } diff --git a/interfaces/kits/updaterkits/updaterkits.cpp b/interfaces/kits/updaterkits/updaterkits.cpp index bfc2a6a4..2f29eb7a 100755 --- a/interfaces/kits/updaterkits/updaterkits.cpp +++ b/interfaces/kits/updaterkits/updaterkits.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include "misc_info/misc_info.h" #include "parameters.h" #include "securec.h" @@ -39,11 +40,7 @@ static bool WriteToMiscAndRebootToUpdater(const std::string &miscFile, int32_t propertyMaxSize = 92; char updateCmd[propertyMaxSize]; void(snprintf_s(updateCmd, propertyMaxSize, propertyMaxSize - 1, "reboot,updater:%s", updateMsg.update)); - bool bRet = OHOS::system::SetParameter("ohos.startup.powerctrl", updateCmd); - if (!bRet) { - std::cout << "WriteToMiscAndRebootToUpdater SetParameter failed, errno: " << errno << std::endl; - return false; - } + DoReboot(updateCmd); while (true) { pause(); } -- Gitee