Lei YU | 28b2ba4 | 2018-07-19 15:41:44 +0800 | [diff] [blame] | 1 | #include "config.h" |
Gunnar Mills | b0ce996 | 2018-09-07 13:39:10 -0500 | [diff] [blame^] | 2 | |
Lei YU | 56aaf45 | 2018-06-21 16:09:44 +0800 | [diff] [blame] | 3 | #include "item_updater_helper.hpp" |
| 4 | |
| 5 | namespace phosphor |
| 6 | { |
| 7 | namespace software |
| 8 | { |
| 9 | namespace updater |
| 10 | { |
Lei YU | 28b2ba4 | 2018-07-19 15:41:44 +0800 | [diff] [blame] | 11 | // openbmconce=clean-rwfs-filesystem factory-reset |
| 12 | #define ENV_FACTORY_RESET "openbmconce\\x3dfactory\\x2dreset" |
Lei YU | 76c79df | 2018-08-27 14:36:32 +0800 | [diff] [blame] | 13 | #define ENV_ENABLE_FIELD_MODE "fieldmode\\x3dtrue" |
Lei YU | 28b2ba4 | 2018-07-19 15:41:44 +0800 | [diff] [blame] | 14 | #define SERVICE_FACTORY_RESET \ |
| 15 | "obmc-flash-bmc-setenv@" ENV_FACTORY_RESET ".service" |
Lei YU | 76c79df | 2018-08-27 14:36:32 +0800 | [diff] [blame] | 16 | #define SERVICE_ENABLE_FIELD_MODE \ |
| 17 | "obmc-flash-bmc-setenv@" ENV_ENABLE_FIELD_MODE ".service" |
Lei YU | 56aaf45 | 2018-06-21 16:09:44 +0800 | [diff] [blame] | 18 | |
Adriana Kobylak | bbcb7be | 2018-07-17 15:47:34 -0500 | [diff] [blame] | 19 | void Helper::setEntry(const std::string& entryId, uint8_t value) |
| 20 | { |
| 21 | // Empty |
| 22 | } |
| 23 | |
Lei YU | 56aaf45 | 2018-06-21 16:09:44 +0800 | [diff] [blame] | 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 | { |
Lei YU | 28b2ba4 | 2018-07-19 15:41:44 +0800 | [diff] [blame] | 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); |
Lei YU | 56aaf45 | 2018-06-21 16:09:44 +0800 | [diff] [blame] | 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 | { |
Lei YU | 76c79df | 2018-08-27 14:36:32 +0800 | [diff] [blame] | 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); |
Lei YU | 56aaf45 | 2018-06-21 16:09:44 +0800 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | void Helper::mirrorAlt() |
| 63 | { |
| 64 | // Empty |
| 65 | } |
| 66 | |
| 67 | } // namespace updater |
| 68 | } // namespace software |
| 69 | } // namespace phosphor |