diff --git a/interfaces/kits/updaterkits/BUILD.gn b/interfaces/kits/updaterkits/BUILD.gn index fd59e5214d523a8f6c0cc7afa33eedcfa5a90f2a..2c68114f85aefa181ba731b310200d73021ff3ca 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 bfc2a6a4ff47c3b5648d39fc1f2ec13f305d9ab7..2f29eb7a0715eaa7c5076b560e254867d20c7036 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(); }