Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 1 | #include "activation.hpp" |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 2 | #include "item_updater.hpp" |
Michael Tritz | f2b5e0d | 2017-07-25 14:39:34 -0500 | [diff] [blame] | 3 | #include "config.h" |
Saqib Khan | 5d53267 | 2017-08-09 10:44:50 -0500 | [diff] [blame] | 4 | #include "serialize.hpp" |
Saqib Khan | b9da663 | 2017-09-13 09:48:37 -0500 | [diff] [blame] | 5 | #include <phosphor-logging/log.hpp> |
| 6 | |
Jayanth Othayoth | 0e0c127 | 2018-02-21 05:46:36 -0600 | [diff] [blame^] | 7 | #ifdef WANT_SIGNATURE_VERIFY |
| 8 | #include <phosphor-logging/elog.hpp> |
| 9 | #include <phosphor-logging/elog-errors.hpp> |
| 10 | #include <xyz/openbmc_project/Common/error.hpp> |
| 11 | #include "image_verify.hpp" |
| 12 | #include "config.h" |
| 13 | #endif |
| 14 | |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 15 | namespace phosphor |
| 16 | { |
| 17 | namespace software |
| 18 | { |
| 19 | namespace updater |
| 20 | { |
| 21 | |
| 22 | namespace softwareServer = sdbusplus::xyz::openbmc_project::Software::server; |
| 23 | |
Saqib Khan | b9da663 | 2017-09-13 09:48:37 -0500 | [diff] [blame] | 24 | using namespace phosphor::logging; |
| 25 | |
Jayanth Othayoth | 0e0c127 | 2018-02-21 05:46:36 -0600 | [diff] [blame^] | 26 | #ifdef WANT_SIGNATURE_VERIFY |
| 27 | using InternalFailure = |
| 28 | sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure; |
| 29 | #endif |
| 30 | |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 31 | void Activation::subscribeToSystemdSignals() |
| 32 | { |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 33 | auto method = this->bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, |
| 34 | SYSTEMD_INTERFACE, "Subscribe"); |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 35 | this->bus.call_noreply(method); |
| 36 | |
| 37 | return; |
| 38 | } |
| 39 | |
Michael Tritz | f2b5e0d | 2017-07-25 14:39:34 -0500 | [diff] [blame] | 40 | void Activation::unsubscribeFromSystemdSignals() |
| 41 | { |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 42 | auto method = this->bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, |
| 43 | SYSTEMD_INTERFACE, "Unsubscribe"); |
Michael Tritz | f2b5e0d | 2017-07-25 14:39:34 -0500 | [diff] [blame] | 44 | this->bus.call_noreply(method); |
| 45 | |
| 46 | return; |
| 47 | } |
| 48 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 49 | auto Activation::activation(Activations value) -> Activations |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 50 | { |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 51 | |
Adriana Kobylak | 8bd84c8 | 2018-01-24 14:19:24 -0600 | [diff] [blame] | 52 | if ((value != softwareServer::Activation::Activations::Active) && |
| 53 | (value != softwareServer::Activation::Activations::Activating)) |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 54 | { |
| 55 | redundancyPriority.reset(nullptr); |
| 56 | } |
| 57 | |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 58 | if (value == softwareServer::Activation::Activations::Activating) |
| 59 | { |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 60 | if (rwVolumeCreated == false && roVolumeCreated == false) |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 61 | { |
Adriana Kobylak | 204e1e7 | 2018-01-24 16:00:05 -0600 | [diff] [blame] | 62 | parent.freeSpace(); |
| 63 | |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 64 | if (!activationProgress) |
| 65 | { |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 66 | activationProgress = |
| 67 | std::make_unique<ActivationProgress>(bus, path); |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 68 | } |
| 69 | |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 70 | if (!activationBlocksTransition) |
| 71 | { |
| 72 | activationBlocksTransition = |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 73 | std::make_unique<ActivationBlocksTransition>(bus, path); |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 74 | } |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 75 | |
Jayanth Othayoth | 0e0c127 | 2018-02-21 05:46:36 -0600 | [diff] [blame^] | 76 | #ifdef WANT_SIGNATURE_VERIFY |
| 77 | using Signature = phosphor::software::image::Signature; |
| 78 | |
| 79 | fs::path uploadDir(IMG_UPLOAD_DIR); |
| 80 | |
| 81 | Signature signature(uploadDir / versionId, SIGNED_IMAGE_CONF_PATH); |
| 82 | |
| 83 | // Validate the signed image. |
| 84 | if (!signature.verify()) |
| 85 | { |
| 86 | log<level::ERR>("Error occurred during image validation"); |
| 87 | report<InternalFailure>(); |
| 88 | |
| 89 | return softwareServer::Activation::activation( |
| 90 | softwareServer::Activation::Activations::Failed); |
| 91 | } |
| 92 | #endif |
| 93 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 94 | auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, |
| 95 | SYSTEMD_INTERFACE, "StartUnit"); |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 96 | method.append("obmc-flash-bmc-ubirw.service", "replace"); |
| 97 | bus.call_noreply(method); |
| 98 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 99 | auto roServiceFile = |
| 100 | "obmc-flash-bmc-ubiro@" + versionId + ".service"; |
| 101 | method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, |
| 102 | SYSTEMD_INTERFACE, "StartUnit"); |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 103 | method.append(roServiceFile, "replace"); |
| 104 | bus.call_noreply(method); |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 105 | |
| 106 | activationProgress->progress(10); |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 107 | } |
| 108 | else if (rwVolumeCreated == true && roVolumeCreated == true) |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 109 | { |
Adriana Kobylak | 4c3edc9 | 2018-01-24 14:50:15 -0600 | [diff] [blame] | 110 | if (ubootEnvVarsUpdated == false) |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 111 | { |
Adriana Kobylak | 4c3edc9 | 2018-01-24 14:50:15 -0600 | [diff] [blame] | 112 | activationProgress->progress(90); |
| 113 | |
| 114 | if (!redundancyPriority) |
| 115 | { |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 116 | redundancyPriority = std::make_unique<RedundancyPriority>( |
| 117 | bus, path, *this, 0); |
Adriana Kobylak | 4c3edc9 | 2018-01-24 14:50:15 -0600 | [diff] [blame] | 118 | } |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 119 | } |
Adriana Kobylak | 4c3edc9 | 2018-01-24 14:50:15 -0600 | [diff] [blame] | 120 | else |
| 121 | { |
| 122 | activationProgress->progress(100); |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 123 | |
Adriana Kobylak | 4c3edc9 | 2018-01-24 14:50:15 -0600 | [diff] [blame] | 124 | activationBlocksTransition.reset(nullptr); |
| 125 | activationProgress.reset(nullptr); |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 126 | |
Adriana Kobylak | 4c3edc9 | 2018-01-24 14:50:15 -0600 | [diff] [blame] | 127 | rwVolumeCreated = false; |
| 128 | roVolumeCreated = false; |
| 129 | ubootEnvVarsUpdated = false; |
| 130 | Activation::unsubscribeFromSystemdSignals(); |
Michael Tritz | f2b5e0d | 2017-07-25 14:39:34 -0500 | [diff] [blame] | 131 | |
Adriana Kobylak | 4c3edc9 | 2018-01-24 14:50:15 -0600 | [diff] [blame] | 132 | // Remove version object from image manager |
| 133 | Activation::deleteImageManagerObject(); |
Michael Tritz | f2b5e0d | 2017-07-25 14:39:34 -0500 | [diff] [blame] | 134 | |
Adriana Kobylak | 4c3edc9 | 2018-01-24 14:50:15 -0600 | [diff] [blame] | 135 | // Create active association |
| 136 | parent.createActiveAssociation(path); |
Saqib Khan | ee13e83 | 2017-10-23 12:53:11 -0500 | [diff] [blame] | 137 | |
Adriana Kobylak | 4c3edc9 | 2018-01-24 14:50:15 -0600 | [diff] [blame] | 138 | return softwareServer::Activation::activation( |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 139 | softwareServer::Activation::Activations::Active); |
Adriana Kobylak | 4c3edc9 | 2018-01-24 14:50:15 -0600 | [diff] [blame] | 140 | } |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 141 | } |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 142 | } |
| 143 | else |
| 144 | { |
| 145 | activationBlocksTransition.reset(nullptr); |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 146 | activationProgress.reset(nullptr); |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 147 | } |
| 148 | return softwareServer::Activation::activation(value); |
| 149 | } |
| 150 | |
Saqib Khan | ee13e83 | 2017-10-23 12:53:11 -0500 | [diff] [blame] | 151 | void Activation::deleteImageManagerObject() |
| 152 | { |
Saqib Khan | ee13e83 | 2017-10-23 12:53:11 -0500 | [diff] [blame] | 153 | // Call the Delete object for <versionID> inside image_manager |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 154 | auto method = this->bus.new_method_call(VERSION_BUSNAME, path.c_str(), |
| 155 | "xyz.openbmc_project.Object.Delete", |
| 156 | "Delete"); |
Adriana Kobylak | 00bd902 | 2018-01-24 13:55:58 -0600 | [diff] [blame] | 157 | auto mapperResponseMsg = bus.call(method); |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 158 | // Check that the bus call didn't result in an error |
Saqib Khan | ee13e83 | 2017-10-23 12:53:11 -0500 | [diff] [blame] | 159 | if (mapperResponseMsg.is_method_error()) |
| 160 | { |
| 161 | log<level::ERR>("Error in Deleting image from image manager", |
Adriana Kobylak | 596466b | 2018-02-13 14:48:53 -0600 | [diff] [blame] | 162 | entry("VERSIONPATH=%s", path.c_str())); |
Saqib Khan | ee13e83 | 2017-10-23 12:53:11 -0500 | [diff] [blame] | 163 | return; |
| 164 | } |
| 165 | } |
| 166 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 167 | auto Activation::requestedActivation(RequestedActivations value) |
| 168 | -> RequestedActivations |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 169 | { |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 170 | rwVolumeCreated = false; |
| 171 | roVolumeCreated = false; |
Adriana Kobylak | 4c3edc9 | 2018-01-24 14:50:15 -0600 | [diff] [blame] | 172 | ubootEnvVarsUpdated = false; |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 173 | |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 174 | if ((value == softwareServer::Activation::RequestedActivations::Active) && |
| 175 | (softwareServer::Activation::requestedActivation() != |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 176 | softwareServer::Activation::RequestedActivations::Active)) |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 177 | { |
| 178 | if ((softwareServer::Activation::activation() == |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 179 | softwareServer::Activation::Activations::Ready) || |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 180 | (softwareServer::Activation::activation() == |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 181 | softwareServer::Activation::Activations::Failed)) |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 182 | { |
| 183 | Activation::activation( |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 184 | softwareServer::Activation::Activations::Activating); |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 185 | } |
| 186 | } |
| 187 | return softwareServer::Activation::requestedActivation(value); |
| 188 | } |
| 189 | |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 190 | uint8_t RedundancyPriority::priority(uint8_t value) |
| 191 | { |
Adriana Kobylak | b77551c | 2017-10-27 12:46:23 -0500 | [diff] [blame] | 192 | // Set the priority value so that the freePriority() function can order |
| 193 | // the versions by priority. |
| 194 | auto newPriority = softwareServer::RedundancyPriority::priority(value); |
Saqib Khan | 5d53267 | 2017-08-09 10:44:50 -0500 | [diff] [blame] | 195 | storeToFile(parent.versionId, value); |
Adriana Kobylak | b77551c | 2017-10-27 12:46:23 -0500 | [diff] [blame] | 196 | parent.parent.freePriority(value, parent.versionId); |
| 197 | return newPriority; |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 198 | } |
| 199 | |
Adriana Kobylak | b77551c | 2017-10-27 12:46:23 -0500 | [diff] [blame] | 200 | uint8_t RedundancyPriority::sdbusPriority(uint8_t value) |
Saqib Khan | f0382c3 | 2017-10-24 13:36:22 -0500 | [diff] [blame] | 201 | { |
Adriana Kobylak | b77551c | 2017-10-27 12:46:23 -0500 | [diff] [blame] | 202 | storeToFile(parent.versionId, value); |
| 203 | return softwareServer::RedundancyPriority::priority(value); |
Saqib Khan | f0382c3 | 2017-10-24 13:36:22 -0500 | [diff] [blame] | 204 | } |
| 205 | |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 206 | void Activation::unitStateChange(sdbusplus::message::message& msg) |
| 207 | { |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 208 | if (softwareServer::Activation::activation() != |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 209 | softwareServer::Activation::Activations::Activating) |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 210 | { |
| 211 | return; |
| 212 | } |
| 213 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 214 | uint32_t newStateID{}; |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 215 | sdbusplus::message::object_path newStateObjPath; |
| 216 | std::string newStateUnit{}; |
| 217 | std::string newStateResult{}; |
| 218 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 219 | // Read the msg and populate each variable |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 220 | msg.read(newStateID, newStateObjPath, newStateUnit, newStateResult); |
| 221 | |
| 222 | auto rwServiceFile = "obmc-flash-bmc-ubirw.service"; |
| 223 | auto roServiceFile = "obmc-flash-bmc-ubiro@" + versionId + ".service"; |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 224 | auto ubootVarsServiceFile = |
| 225 | "obmc-flash-bmc-updateubootvars@" + versionId + ".service"; |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 226 | |
Gunnar Mills | 3fa3820 | 2017-10-08 17:07:43 -0500 | [diff] [blame] | 227 | if (newStateUnit == rwServiceFile && newStateResult == "done") |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 228 | { |
| 229 | rwVolumeCreated = true; |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 230 | activationProgress->progress(activationProgress->progress() + 20); |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 231 | } |
| 232 | |
Gunnar Mills | 3fa3820 | 2017-10-08 17:07:43 -0500 | [diff] [blame] | 233 | if (newStateUnit == roServiceFile && newStateResult == "done") |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 234 | { |
| 235 | roVolumeCreated = true; |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 236 | activationProgress->progress(activationProgress->progress() + 50); |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 237 | } |
| 238 | |
Adriana Kobylak | 4c3edc9 | 2018-01-24 14:50:15 -0600 | [diff] [blame] | 239 | if (newStateUnit == ubootVarsServiceFile && newStateResult == "done") |
| 240 | { |
| 241 | ubootEnvVarsUpdated = true; |
| 242 | } |
| 243 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 244 | if (newStateUnit == rwServiceFile || newStateUnit == roServiceFile || |
Adriana Kobylak | 4c3edc9 | 2018-01-24 14:50:15 -0600 | [diff] [blame] | 245 | newStateUnit == ubootVarsServiceFile) |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 246 | { |
Adriana Kobylak | 8bd84c8 | 2018-01-24 14:19:24 -0600 | [diff] [blame] | 247 | if (newStateResult == "failed" || newStateResult == "dependency") |
| 248 | { |
| 249 | Activation::activation( |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 250 | softwareServer::Activation::Activations::Failed); |
Adriana Kobylak | 8bd84c8 | 2018-01-24 14:19:24 -0600 | [diff] [blame] | 251 | } |
Adriana Kobylak | 4c3edc9 | 2018-01-24 14:50:15 -0600 | [diff] [blame] | 252 | else if ((rwVolumeCreated && roVolumeCreated) || // Volumes were created |
| 253 | (ubootEnvVarsUpdated)) // Enviroment variables were updated |
Adriana Kobylak | 8bd84c8 | 2018-01-24 14:19:24 -0600 | [diff] [blame] | 254 | { |
| 255 | Activation::activation( |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 256 | softwareServer::Activation::Activations::Activating); |
Adriana Kobylak | 8bd84c8 | 2018-01-24 14:19:24 -0600 | [diff] [blame] | 257 | } |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 258 | } |
| 259 | |
| 260 | return; |
| 261 | } |
| 262 | |
Saqib Khan | f37cefc | 2017-09-12 08:44:41 -0500 | [diff] [blame] | 263 | void ActivationBlocksTransition::enableRebootGuard() |
| 264 | { |
| 265 | log<level::INFO>("BMC image activating - BMC reboots are disabled."); |
| 266 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 267 | auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, |
| 268 | SYSTEMD_INTERFACE, "StartUnit"); |
Saqib Khan | f37cefc | 2017-09-12 08:44:41 -0500 | [diff] [blame] | 269 | method.append("reboot-guard-enable.service", "replace"); |
| 270 | bus.call_noreply(method); |
| 271 | } |
| 272 | |
| 273 | void ActivationBlocksTransition::disableRebootGuard() |
| 274 | { |
| 275 | log<level::INFO>("BMC activation has ended - BMC reboots are re-enabled."); |
| 276 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 277 | auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, |
| 278 | SYSTEMD_INTERFACE, "StartUnit"); |
Saqib Khan | f37cefc | 2017-09-12 08:44:41 -0500 | [diff] [blame] | 279 | method.append("reboot-guard-disable.service", "replace"); |
| 280 | bus.call_noreply(method); |
| 281 | } |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 282 | |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 283 | } // namespace updater |
| 284 | } // namespace software |
| 285 | } // namespace phosphor |