Home
last modified time | relevance | path

Searched refs:boot (Results 1 - 15 of 15) sorted by relevance

/base/update/updater/utils/
H A Dwrite_updater.cpp35 static int ExceptionUpdater(int argc, char **argv, UpdateMessage &boot) in ExceptionUpdater() argument
42 if (snprintf_s(boot.update, sizeof(boot.update), sizeof(boot.update) - 1, "--update_package=%s", in ExceptionUpdater()
77 struct UpdateMessage boot {}; in main() struct
80 if (ExceptionUpdater(argc, argv, boot) == -1) { in main()
84 if (strncpy_s(boot.update, sizeof(boot.update), "--user_wipe_data", sizeof(boot.update) - 1) != 0) { in main()
89 if (strncpy_s(boot in main()
[all...]
H A Dutils.cpp738 struct UpdateMessage boot {}; in ParseParams() struct
740 if (!ReadUpdaterMiscMsg(boot)) { in ParseParams()
743 // if boot.update is empty, read from command.The Misc partition may have dirty data, in ParseParams()
744 // so strlen(boot.update) is not used, which can cause system exceptions. in ParseParams()
745 if (boot.update[0] == '\0' && !access(COMMAND_FILE, 0)) { in ParseParams()
746 if (!ReadUpdaterMessage(COMMAND_FILE, boot)) { in ParseParams()
751 boot.update[sizeof(boot.update) - 1] = '\0'; in ParseParams()
752 std::vector<std::string> parseParams = Utils::SplitString(boot.update, "\n"); in ParseParams()
955 if (GetParameter("ohos.boot in IsEsDevice()
[all...]
/base/update/updater/test/unittest/updater_main_test/
H A Dupdater_main_unittest.cpp72 UpdateMessage boot {}; in HWTEST_F()
81 EXPECT_EQ(strncpy_s(boot.command, sizeof(boot.command) - 1, commandMsg.c_str(), commandMsg.size()), 0); in HWTEST_F()
82 EXPECT_EQ(strncpy_s(boot.update, sizeof(boot.update), "", sizeof(boot.update)), 0); in HWTEST_F()
83 bool bRet = WriteUpdaterMessage(commandFile, boot); in HWTEST_F()
99 UpdateMessage boot {}; in HWTEST_F()
101 EXPECT_EQ(strncpy_s(boot.command, sizeof(boot in HWTEST_F()
[all...]
/base/update/updater/test/fuzztest/writeupdatermsg_fuzzer/
H A Dwriteupdatermsg_fuzzer.cpp30 UpdateMessage boot; in FuzzWriteUpdaterMsg() local
31 if (memcpy_s(boot.update, MAX_UPDATE_SIZE - 1, reinterpret_cast<const char*>(data), size) != EOK) { in FuzzWriteUpdaterMsg()
34 ReadUpdaterMiscMsg(boot); in FuzzWriteUpdaterMsg()
36 WriteUpdaterMessage(path, boot); in FuzzWriteUpdaterMsg()
37 WriteUpdaterMiscMsg(boot); in FuzzWriteUpdaterMsg()
41 UpdaterPara boot; in FuzzWriteUpdaterPara() local
42 WriteUpdaterParaMisc(boot); in FuzzWriteUpdaterPara()
43 ReadUpdaterParaMisc(boot); in FuzzWriteUpdaterPara()
/base/update/updater/test/unittest/misc_info_test/
H A Dmisc_info_unittest.cpp45 UpdateMessage boot {}; in HWTEST_F()
47 EXPECT_EQ(strncpy_s(boot.command, sizeof(boot.command) - 1, command1.c_str(), command1.size()), 0); in HWTEST_F()
49 EXPECT_EQ(strncpy_s(boot.update, sizeof(boot.update) - 1, command2.c_str(), command2.size()), 0); in HWTEST_F()
51 bool ret = WriteUpdaterMessage(path, boot); in HWTEST_F()
55 ret = WriteUpdaterMessage(path, boot); in HWTEST_F()
59 ret = ReadUpdaterMessage(path, boot); in HWTEST_F()
64 ret = ReadUpdaterMessage(path, boot); in HWTEST_F()
67 ret = WriteUpdaterMiscMsg(boot); in HWTEST_F()
[all...]
/base/update/updater/test/fuzztest/updatermain_fuzzer/
H A Dupdatermain_fuzzer.cpp41 UpdateMessage boot {}; in ParseParamsFuzzTest()
48 if (strncpy_s(boot.command, sizeof(boot.command) - 1, commandMsg.c_str(), commandMsg.size()) != 0) { in ParseParamsFuzzTest()
51 if (strncpy_s(boot.update, sizeof(boot.update), "", sizeof(boot.update)) != 0) { in ParseParamsFuzzTest()
54 WriteUpdaterMessage(commandFile, boot); in ParseParamsFuzzTest()
70 UpdateMessage boot {}; in MianUpdaterFuzzTest()
85 if (strncpy_s(boot.command, sizeof(boot in MianUpdaterFuzzTest()
[all...]
/base/update/updater/services/
H A Dmain.cpp30 struct UpdateMessage boot {}; in main() struct
31 if (!ReadUpdaterMiscMsg(boot)) { in main()
37 auto bootMode = SelectMode(boot).value_or(BOOT_MODE(Updater, "updater.hdc.configfs")); in main()
H A Dupdater_utils.cpp126 LOG(ERROR) << "ClearMisc clear boot message to misc failed"; in ClearMisc()
226 bool IsUpdater(const UpdateMessage &boot) in IsUpdater() argument
228 return !IsFlashd(boot) && strncmp(boot.command, "boot_updater", sizeof("boot_updater") - 1) == 0; in IsUpdater()
231 bool IsFlashd(const UpdateMessage &boot) in IsFlashd() argument
233 return strncmp(boot.update, "boot_flash", sizeof("boot_flash") - 1) == 0; in IsFlashd()
247 std::optional<BootMode> SelectMode(const UpdateMessage &boot) in SelectMode() argument
252 auto it = std::find_if(modes.begin(), modes.end(), [&boot] (const auto &bootMode) { in SelectMode()
253 if (bootMode.cond != nullptr && bootMode.cond(boot)) { in SelectMode()
/base/update/updater/test/unittest/service_test/
H A Dupdater_service_unittest.cpp114 UpdateMessage boot {}; in HWTEST_F()
120 EXPECT_EQ(strncpy_s(boot.command, sizeof(boot.command) - 1, commandMsg.c_str(), commandMsg.size()), 0); in HWTEST_F()
121 EXPECT_EQ(strncpy_s(boot.update, sizeof(boot.update) - 1, updateMsg.c_str(), updateMsg.size()), 0); in HWTEST_F()
122 bool bRet = WriteUpdaterMessage(commandFile, boot); in HWTEST_F()
138 EXPECT_EQ(strncpy_s(boot.command, sizeof(boot.command) - 1, commandMsg.c_str(), commandMsg.size()), 0); in HWTEST_F()
139 EXPECT_EQ(strncpy_s(boot.update, sizeof(boot in HWTEST_F()
[all...]
/base/startup/init/services/modules/reboot/
H A Dreboot_misc.c35 static int RBMiscWriteUpdaterMessage(const char *path, const struct RBMiscUpdateMessage *boot) in RBMiscWriteUpdaterMessage() argument
44 size_t writeLen = fwrite(boot, sizeof(struct RBMiscUpdateMessage), 1, fp); in RBMiscWriteUpdaterMessage()
52 static int RBMiscReadUpdaterMessage(const char *path, struct RBMiscUpdateMessage *boot) in RBMiscReadUpdaterMessage() argument
65 size_t readLen = fread(boot, 1, sizeof(struct RBMiscUpdateMessage), fp); in RBMiscReadUpdaterMessage()
84 int UpdateMiscMessage(const char *valueData, const char *cmd, const char *cmdExt, const char *boot) in UpdateMiscMessage() argument
96 if (boot != NULL) { in UpdateMiscMessage()
97 ret = snprintf_s(msg.command, MAX_COMMAND_SIZE, MAX_COMMAND_SIZE - 1, "%s", boot); in UpdateMiscMessage()
H A Dreboot_adp.h27 int UpdateMiscMessage(const char *valueData, const char *cmd, const char *cmdExt, const char *boot);
/base/update/updater/interfaces/kits/include/misc_info/
H A Dmisc_info.h63 bool WriteUpdaterMessage(const std::string &path, const UpdateMessage &boot);
64 bool ReadUpdaterMessage(const std::string &path, UpdateMessage &boot);
65 bool WriteUpdaterMiscMsg(const UpdateMessage &boot);
66 bool ReadUpdaterMiscMsg(UpdateMessage &boot);
/base/update/updater/interfaces/kits/misc_info/
H A Dmisc_info.cpp24 bool WriteUpdaterMessage(const std::string &path, const UpdateMessage &boot) in WriteUpdaterMessage() argument
38 size_t ret = fwrite(&boot, sizeof(UpdateMessage), 1, fp); in WriteUpdaterMessage()
56 bool ReadUpdaterMessage(const std::string &path, UpdateMessage &boot) in ReadUpdaterMessage() argument
83 if (memcpy_s(&boot, sizeof(UpdateMessage), &tempBoot, sizeof(UpdateMessage)) != EOK) { in ReadUpdaterMessage()
90 bool WriteUpdaterMiscMsg(const UpdateMessage &boot) in WriteUpdaterMiscMsg() argument
98 return WriteUpdaterMessage(path, boot); in WriteUpdaterMiscMsg()
101 bool ReadUpdaterMiscMsg(UpdateMessage &boot) in ReadUpdaterMiscMsg() argument
108 return ReadUpdaterMessage(path, boot); in ReadUpdaterMiscMsg()
/base/update/updater/services/include/updater/
H A Dupdater.h109 bool IsUpdater(const UpdateMessage &boot);
111 bool IsFlashd(const UpdateMessage &boot);
117 std::optional<BootMode> SelectMode(const UpdateMessage &boot);
/base/startup/init/test/unittest/param/
H A Dtrigger_unittest.cpp187 int TestBootEvent(const char *boot) in TestBootEvent() argument
189 PostTrigger(EVENT_TRIGGER_BOOT, boot, strlen(boot)); in TestBootEvent()
461 const char *boot = "boot2"; in TestExecuteParamTrigger5() local
465 JobNode *trigger = AddTrigger(TRIGGER_BOOT, boot, nullptr, 0); in TestExecuteParamTrigger5()
484 TestBootEvent(boot); in TestExecuteParamTrigger5()

Completed in 12 milliseconds