blob: 572cb9cdec815f144aa7ea6279b199325ffde2b0 [file] [log] [blame]
Lei YU28b2ba42018-07-19 15:41:44 +08001#include "config.h"
Lei YU56aaf452018-06-21 16:09:44 +08002#include "item_updater_helper.hpp"
3
4namespace phosphor
5{
6namespace software
7{
8namespace updater
9{
Lei YU28b2ba42018-07-19 15:41:44 +080010// openbmconce=clean-rwfs-filesystem factory-reset
11#define ENV_FACTORY_RESET "openbmconce\\x3dfactory\\x2dreset"
Lei YU76c79df2018-08-27 14:36:32 +080012#define ENV_ENABLE_FIELD_MODE "fieldmode\\x3dtrue"
Lei YU28b2ba42018-07-19 15:41:44 +080013#define SERVICE_FACTORY_RESET \
14 "obmc-flash-bmc-setenv@" ENV_FACTORY_RESET ".service"
Lei YU76c79df2018-08-27 14:36:32 +080015#define SERVICE_ENABLE_FIELD_MODE \
16 "obmc-flash-bmc-setenv@" ENV_ENABLE_FIELD_MODE ".service"
Lei YU56aaf452018-06-21 16:09:44 +080017
Adriana Kobylakbbcb7be2018-07-17 15:47:34 -050018void Helper::setEntry(const std::string& entryId, uint8_t value)
19{
20 // Empty
21}
22
Lei YU56aaf452018-06-21 16:09:44 +080023void Helper::clearEntry(const std::string& entryId)
24{
25 // Empty
26}
27
28void Helper::cleanup()
29{
30 // Empty
31}
32
33void Helper::factoryReset()
34{
Lei YU28b2ba42018-07-19 15:41:44 +080035 // Set openbmconce=factory-reset env in U-Boot.
36 // The init will cleanup rwfs during boot.
37 auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH,
38 SYSTEMD_INTERFACE, "StartUnit");
39 method.append(SERVICE_FACTORY_RESET, "replace");
40 bus.call_noreply(method);
Lei YU56aaf452018-06-21 16:09:44 +080041}
42
43void Helper::removeVersion(const std::string& versionId)
44{
45 // Empty
46}
47
48void Helper::updateUbootVersionId(const std::string& versionId)
49{
50 // Empty
51}
52
53void Helper::enableFieldMode()
54{
Lei YU76c79df2018-08-27 14:36:32 +080055 auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH,
56 SYSTEMD_INTERFACE, "StartUnit");
57 method.append(SERVICE_ENABLE_FIELD_MODE, "replace");
58 bus.call_noreply(method);
Lei YU56aaf452018-06-21 16:09:44 +080059}
60
61void Helper::mirrorAlt()
62{
63 // Empty
64}
65
66} // namespace updater
67} // namespace software
68} // namespace phosphor