1 #include "config.h"
2 
3 #include "item_updater_helper.hpp"
4 
5 namespace phosphor
6 {
7 namespace software
8 {
9 namespace updater
10 {
11 // openbmconce=clean-rwfs-filesystem factory-reset
12 #define ENV_FACTORY_RESET "openbmconce\\x3dfactory\\x2dreset"
13 #define ENV_ENABLE_FIELD_MODE "fieldmode\\x3dtrue"
14 #define SERVICE_FACTORY_RESET                                                  \
15     "obmc-flash-bmc-setenv@" ENV_FACTORY_RESET ".service"
16 #define SERVICE_ENABLE_FIELD_MODE                                              \
17     "obmc-flash-bmc-setenv@" ENV_ENABLE_FIELD_MODE ".service"
18 
19 void Helper::setEntry(const std::string& entryId, uint8_t value)
20 {
21     // Empty
22 }
23 
24 void Helper::clearEntry(const std::string& entryId)
25 {
26     // Empty
27 }
28 
29 void Helper::cleanup()
30 {
31     // Empty
32 }
33 
34 void Helper::factoryReset()
35 {
36     // 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);
42 }
43 
44 void Helper::removeVersion(const std::string& versionId)
45 {
46     // Empty
47 }
48 
49 void Helper::updateUbootVersionId(const std::string& versionId)
50 {
51     // Empty
52 }
53 
54 void Helper::enableFieldMode()
55 {
56     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);
60 }
61 
62 void Helper::mirrorAlt()
63 {
64     // Empty
65 }
66 
67 } // namespace updater
68 } // namespace software
69 } // namespace phosphor
70