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..227621f56eea5211cd0c3b2acbc576a027af477d 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" @@ -38,12 +39,8 @@ static bool WriteToMiscAndRebootToUpdater(const std::string &miscFile, #ifndef UPDATER_UT 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; - } + void(snprintf_s(updateCmd, propertyMaxSize, propertyMaxSize - 1, "updater:%s", updateMsg.update)); + DoReboot(updateCmd); while (true) { pause(); }