blob: e087d710cdd13010f25659452d61872a2d8169e6 [file] [log] [blame]
Lei YU28b2ba42018-07-19 15:41:44 +08001#include "config.h"
Gunnar Millsb0ce9962018-09-07 13:39:10 -05002
Lei YU56aaf452018-06-21 16:09:44 +08003#include "item_updater_helper.hpp"
4
5namespace phosphor
6{
7namespace software
8{
9namespace updater
10{
Lei YU28b2ba42018-07-19 15:41:44 +080011// openbmconce=clean-rwfs-filesystem factory-reset
12#define ENV_FACTORY_RESET "openbmconce\\x3dfactory\\x2dreset"
Lei YU76c79df2018-08-27 14:36:32 +080013#define ENV_ENABLE_FIELD_MODE "fieldmode\\x3dtrue"
Lei YU28b2ba42018-07-19 15:41:44 +080014#define SERVICE_FACTORY_RESET \
15 "obmc-flash-bmc-setenv@" ENV_FACTORY_RESET ".service"
Lei YU76c79df2018-08-27 14:36:32 +080016#define SERVICE_ENABLE_FIELD_MODE \
17 "obmc-flash-bmc-setenv@" ENV_ENABLE_FIELD_MODE ".service"
Lei YU56aaf452018-06-21 16:09:44 +080018
Adriana Kobylakbbcb7be2018-07-17 15:47:34 -050019void Helper::setEntry(const std::string& entryId, uint8_t value)
20{
21 // Empty
22}
23
Lei YU56aaf452018-06-21 16:09:44 +080024void Helper::clearEntry(const std::string& entryId)
25{
26 // Empty
27}
28
29void Helper::cleanup()
30{
31 // Empty
32}
33
34void Helper::factoryReset()
35{
Lei YU28b2ba42018-07-19 15:41:44 +080036 // Set openbmconce=factory-reset env in U-Boot.
37 // The init will cleanup rwfs during boot.
38 auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH,
39 SYSTEMD_INTERFACE, "StartUnit");
40 method.append(SERVICE_FACTORY_RESET, "replace");
41 bus.call_noreply(method);
Lei YU56aaf452018-06-21 16:09:44 +080042}
43
44void Helper::removeVersion(const std::string& versionId)
45{
46 // Empty
47}
48
49void Helper::updateUbootVersionId(const std::string& versionId)
50{
51 // Empty
52}
53
54void Helper::enableFieldMode()
55{
Lei YU76c79df2018-08-27 14:36:32 +080056 auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH,
57 SYSTEMD_INTERFACE, "StartUnit");
58 method.append(SERVICE_ENABLE_FIELD_MODE, "replace");
59 bus.call_noreply(method);
Lei YU56aaf452018-06-21 16:09:44 +080060}
61
62void Helper::mirrorAlt()
63{
64 // Empty
65}
66
67} // namespace updater
68} // namespace software
69} // namespace phosphor