diff options
author | Lei YU <mine260309@gmail.com> | 2018-08-27 14:36:32 +0800 |
---|---|---|
committer | Lei YU <mine260309@gmail.com> | 2018-08-30 03:03:05 +0000 |
commit | 76c79df3fca0842ec9dd38f9627913cf5c64001e (patch) | |
tree | 212d88db68d7dabb15e2b934b038386233d57e01 | |
parent | 0f88b5afec39b0fcb31cb5b9692599305cca4c24 (diff) | |
download | phosphor-bmc-code-mgmt-76c79df3fca0842ec9dd38f9627913cf5c64001e.tar.gz phosphor-bmc-code-mgmt-76c79df3fca0842ec9dd38f9627913cf5c64001e.zip |
static layout: Support field mode
Enable support for field mode, which sets "fieldmode=true" in u-boot
env.
Tested: Verify field mode is enabled via REST API, and verify it is
still enabled after BMC reboot.
Change-Id: I9ff01a51260d1f08021e0ba7ade16fd48c8bb24e
Signed-off-by: Lei YU <mine260309@gmail.com>
-rw-r--r-- | static/item_updater_helper.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/static/item_updater_helper.cpp b/static/item_updater_helper.cpp index 19ac61d..572cb9c 100644 --- a/static/item_updater_helper.cpp +++ b/static/item_updater_helper.cpp @@ -9,8 +9,11 @@ namespace updater { // openbmconce=clean-rwfs-filesystem factory-reset #define ENV_FACTORY_RESET "openbmconce\\x3dfactory\\x2dreset" +#define ENV_ENABLE_FIELD_MODE "fieldmode\\x3dtrue" #define SERVICE_FACTORY_RESET \ "obmc-flash-bmc-setenv@" ENV_FACTORY_RESET ".service" +#define SERVICE_ENABLE_FIELD_MODE \ + "obmc-flash-bmc-setenv@" ENV_ENABLE_FIELD_MODE ".service" void Helper::setEntry(const std::string& entryId, uint8_t value) { @@ -49,7 +52,10 @@ void Helper::updateUbootVersionId(const std::string& versionId) void Helper::enableFieldMode() { - // TODO + auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, + SYSTEMD_INTERFACE, "StartUnit"); + method.append(SERVICE_ENABLE_FIELD_MODE, "replace"); + bus.call_noreply(method); } void Helper::mirrorAlt() |