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