Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 1 | #include "activation.hpp" |
Gunnar Mills | b0ce996 | 2018-09-07 13:39:10 -0500 | [diff] [blame] | 2 | |
Lei YU | 1be8d50 | 2018-06-20 11:48:36 +0800 | [diff] [blame] | 3 | #include "images.hpp" |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 4 | #include "item_updater.hpp" |
Saqib Khan | 5d53267 | 2017-08-09 10:44:50 -0500 | [diff] [blame] | 5 | #include "serialize.hpp" |
Gunnar Mills | b0ce996 | 2018-09-07 13:39:10 -0500 | [diff] [blame] | 6 | |
Saqib Khan | b9da663 | 2017-09-13 09:48:37 -0500 | [diff] [blame] | 7 | #include <phosphor-logging/log.hpp> |
Adriana Kobylak | aea48f2 | 2018-07-10 10:20:56 -0500 | [diff] [blame] | 8 | #include <sdbusplus/exception.hpp> |
Saqib Khan | b9da663 | 2017-09-13 09:48:37 -0500 | [diff] [blame] | 9 | |
Jayanth Othayoth | 0e0c127 | 2018-02-21 05:46:36 -0600 | [diff] [blame] | 10 | #ifdef WANT_SIGNATURE_VERIFY |
Jayanth Othayoth | 0e0c127 | 2018-02-21 05:46:36 -0600 | [diff] [blame] | 11 | #include "image_verify.hpp" |
Gunnar Mills | b0ce996 | 2018-09-07 13:39:10 -0500 | [diff] [blame] | 12 | |
| 13 | #include <phosphor-logging/elog-errors.hpp> |
| 14 | #include <phosphor-logging/elog.hpp> |
| 15 | #include <xyz/openbmc_project/Common/error.hpp> |
Jayanth Othayoth | 0e0c127 | 2018-02-21 05:46:36 -0600 | [diff] [blame] | 16 | #endif |
| 17 | |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 18 | namespace phosphor |
| 19 | { |
| 20 | namespace software |
| 21 | { |
| 22 | namespace updater |
| 23 | { |
| 24 | |
| 25 | namespace softwareServer = sdbusplus::xyz::openbmc_project::Software::server; |
| 26 | |
Saqib Khan | b9da663 | 2017-09-13 09:48:37 -0500 | [diff] [blame] | 27 | using namespace phosphor::logging; |
Adriana Kobylak | aea48f2 | 2018-07-10 10:20:56 -0500 | [diff] [blame] | 28 | using sdbusplus::exception::SdBusError; |
Saqib Khan | b9da663 | 2017-09-13 09:48:37 -0500 | [diff] [blame] | 29 | |
Jayanth Othayoth | 0e0c127 | 2018-02-21 05:46:36 -0600 | [diff] [blame] | 30 | #ifdef WANT_SIGNATURE_VERIFY |
| 31 | using InternalFailure = |
| 32 | sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure; |
Jayanth Othayoth | 9a9d7c2 | 2018-03-28 10:05:26 -0500 | [diff] [blame] | 33 | namespace control = sdbusplus::xyz::openbmc_project::Control::server; |
Jayanth Othayoth | 0e0c127 | 2018-02-21 05:46:36 -0600 | [diff] [blame] | 34 | #endif |
| 35 | |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 36 | void Activation::subscribeToSystemdSignals() |
| 37 | { |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 38 | auto method = this->bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, |
| 39 | SYSTEMD_INTERFACE, "Subscribe"); |
Adriana Kobylak | aea48f2 | 2018-07-10 10:20:56 -0500 | [diff] [blame] | 40 | try |
| 41 | { |
| 42 | this->bus.call_noreply(method); |
| 43 | } |
| 44 | catch (const SdBusError& e) |
| 45 | { |
| 46 | if (e.name() != nullptr && |
| 47 | strcmp("org.freedesktop.systemd1.AlreadySubscribed", e.name()) == 0) |
| 48 | { |
| 49 | // If an Activation attempt fails, the Unsubscribe method is not |
| 50 | // called. This may lead to an AlreadySubscribed error if the |
| 51 | // Activation is re-attempted. |
| 52 | } |
| 53 | else |
| 54 | { |
| 55 | log<level::ERR>("Error subscribing to systemd", |
| 56 | entry("ERROR=%s", e.what())); |
| 57 | } |
| 58 | } |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 59 | |
| 60 | return; |
| 61 | } |
| 62 | |
Michael Tritz | f2b5e0d | 2017-07-25 14:39:34 -0500 | [diff] [blame] | 63 | void Activation::unsubscribeFromSystemdSignals() |
| 64 | { |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 65 | auto method = this->bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, |
| 66 | SYSTEMD_INTERFACE, "Unsubscribe"); |
Michael Tritz | f2b5e0d | 2017-07-25 14:39:34 -0500 | [diff] [blame] | 67 | this->bus.call_noreply(method); |
| 68 | |
| 69 | return; |
| 70 | } |
| 71 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 72 | auto Activation::activation(Activations value) -> Activations |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 73 | { |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 74 | |
Adriana Kobylak | 8bd84c8 | 2018-01-24 14:19:24 -0600 | [diff] [blame] | 75 | if ((value != softwareServer::Activation::Activations::Active) && |
| 76 | (value != softwareServer::Activation::Activations::Activating)) |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 77 | { |
| 78 | redundancyPriority.reset(nullptr); |
| 79 | } |
| 80 | |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 81 | if (value == softwareServer::Activation::Activations::Activating) |
| 82 | { |
Lei YU | a7853ee | 2018-05-23 11:13:12 +0800 | [diff] [blame] | 83 | #ifdef UBIFS_LAYOUT |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 84 | if (rwVolumeCreated == false && roVolumeCreated == false) |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 85 | { |
Adriana Kobylak | aea48f2 | 2018-07-10 10:20:56 -0500 | [diff] [blame] | 86 | // Enable systemd signals |
| 87 | Activation::subscribeToSystemdSignals(); |
| 88 | |
Adriana Kobylak | a696359 | 2018-09-07 14:13:29 -0500 | [diff] [blame^] | 89 | parent.freeSpace(*this); |
Adriana Kobylak | 204e1e7 | 2018-01-24 16:00:05 -0600 | [diff] [blame] | 90 | |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 91 | if (!activationProgress) |
| 92 | { |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 93 | activationProgress = |
| 94 | std::make_unique<ActivationProgress>(bus, path); |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 95 | } |
| 96 | |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 97 | if (!activationBlocksTransition) |
| 98 | { |
| 99 | activationBlocksTransition = |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 100 | std::make_unique<ActivationBlocksTransition>(bus, path); |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 101 | } |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 102 | |
Jayanth Othayoth | 0e0c127 | 2018-02-21 05:46:36 -0600 | [diff] [blame] | 103 | #ifdef WANT_SIGNATURE_VERIFY |
Jayanth Othayoth | 0e0c127 | 2018-02-21 05:46:36 -0600 | [diff] [blame] | 104 | fs::path uploadDir(IMG_UPLOAD_DIR); |
Lei YU | 9053225 | 2018-05-24 11:15:24 +0800 | [diff] [blame] | 105 | if (!verifySignature(uploadDir / versionId, SIGNED_IMAGE_CONF_PATH)) |
Jayanth Othayoth | 0e0c127 | 2018-02-21 05:46:36 -0600 | [diff] [blame] | 106 | { |
Lei YU | 9053225 | 2018-05-24 11:15:24 +0800 | [diff] [blame] | 107 | onVerifyFailed(); |
Jayanth Othayoth | 9a9d7c2 | 2018-03-28 10:05:26 -0500 | [diff] [blame] | 108 | // Stop the activation process, if fieldMode is enabled. |
| 109 | if (parent.control::FieldMode::fieldModeEnabled()) |
| 110 | { |
| 111 | // Cleanup |
| 112 | activationBlocksTransition.reset(nullptr); |
| 113 | activationProgress.reset(nullptr); |
Jayanth Othayoth | 9a9d7c2 | 2018-03-28 10:05:26 -0500 | [diff] [blame] | 114 | return softwareServer::Activation::activation( |
| 115 | softwareServer::Activation::Activations::Failed); |
| 116 | } |
Jayanth Othayoth | 0e0c127 | 2018-02-21 05:46:36 -0600 | [diff] [blame] | 117 | } |
| 118 | #endif |
| 119 | |
Adriana Kobylak | 9f89e2e | 2018-05-30 13:16:20 -0500 | [diff] [blame] | 120 | flashWrite(); |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 121 | |
| 122 | activationProgress->progress(10); |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 123 | } |
| 124 | else if (rwVolumeCreated == true && roVolumeCreated == true) |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 125 | { |
Adriana Kobylak | 166bdf3 | 2018-04-09 14:24:06 -0500 | [diff] [blame] | 126 | if (ubootEnvVarsUpdated == false) |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 127 | { |
Adriana Kobylak | 166bdf3 | 2018-04-09 14:24:06 -0500 | [diff] [blame] | 128 | activationProgress->progress(90); |
| 129 | |
| 130 | if (!redundancyPriority) |
| 131 | { |
| 132 | redundancyPriority = std::make_unique<RedundancyPriority>( |
| 133 | bus, path, *this, 0); |
| 134 | } |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 135 | } |
Adriana Kobylak | 166bdf3 | 2018-04-09 14:24:06 -0500 | [diff] [blame] | 136 | else |
| 137 | { |
| 138 | activationProgress->progress(100); |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 139 | |
Adriana Kobylak | 166bdf3 | 2018-04-09 14:24:06 -0500 | [diff] [blame] | 140 | activationBlocksTransition.reset(nullptr); |
| 141 | activationProgress.reset(nullptr); |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 142 | |
Adriana Kobylak | 166bdf3 | 2018-04-09 14:24:06 -0500 | [diff] [blame] | 143 | rwVolumeCreated = false; |
| 144 | roVolumeCreated = false; |
| 145 | ubootEnvVarsUpdated = false; |
| 146 | Activation::unsubscribeFromSystemdSignals(); |
Michael Tritz | f2b5e0d | 2017-07-25 14:39:34 -0500 | [diff] [blame] | 147 | |
Adriana Kobylak | 166bdf3 | 2018-04-09 14:24:06 -0500 | [diff] [blame] | 148 | // Remove version object from image manager |
| 149 | Activation::deleteImageManagerObject(); |
Michael Tritz | f2b5e0d | 2017-07-25 14:39:34 -0500 | [diff] [blame] | 150 | |
Adriana Kobylak | 166bdf3 | 2018-04-09 14:24:06 -0500 | [diff] [blame] | 151 | // Create active association |
| 152 | parent.createActiveAssociation(path); |
Saqib Khan | ee13e83 | 2017-10-23 12:53:11 -0500 | [diff] [blame] | 153 | |
Adriana Kobylak | 166bdf3 | 2018-04-09 14:24:06 -0500 | [diff] [blame] | 154 | return softwareServer::Activation::activation( |
| 155 | softwareServer::Activation::Activations::Active); |
| 156 | } |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 157 | } |
Lei YU | a7853ee | 2018-05-23 11:13:12 +0800 | [diff] [blame] | 158 | #else // !UBIFS_LAYOUT |
| 159 | |
Lei YU | 9053225 | 2018-05-24 11:15:24 +0800 | [diff] [blame] | 160 | #ifdef WANT_SIGNATURE_VERIFY |
| 161 | fs::path uploadDir(IMG_UPLOAD_DIR); |
| 162 | if (!verifySignature(uploadDir / versionId, SIGNED_IMAGE_CONF_PATH)) |
| 163 | { |
| 164 | onVerifyFailed(); |
| 165 | // Stop the activation process, if fieldMode is enabled. |
| 166 | if (parent.control::FieldMode::fieldModeEnabled()) |
| 167 | { |
| 168 | return softwareServer::Activation::activation( |
| 169 | softwareServer::Activation::Activations::Failed); |
| 170 | } |
| 171 | } |
| 172 | #endif |
Adriana Kobylak | a696359 | 2018-09-07 14:13:29 -0500 | [diff] [blame^] | 173 | parent.freeSpace(*this); |
Lei YU | a7853ee | 2018-05-23 11:13:12 +0800 | [diff] [blame] | 174 | |
| 175 | flashWrite(); |
| 176 | |
| 177 | if (!redundancyPriority) |
| 178 | { |
| 179 | redundancyPriority = |
| 180 | std::make_unique<RedundancyPriority>(bus, path, *this, 0); |
| 181 | } |
| 182 | |
| 183 | // Remove version object from image manager |
| 184 | Activation::deleteImageManagerObject(); |
| 185 | |
| 186 | // Create active association |
| 187 | parent.createActiveAssociation(path); |
| 188 | |
| 189 | log<level::INFO>("BMC image ready, need reboot to get activated."); |
| 190 | return softwareServer::Activation::activation( |
| 191 | softwareServer::Activation::Activations::Active); |
| 192 | #endif |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 193 | } |
| 194 | else |
| 195 | { |
| 196 | activationBlocksTransition.reset(nullptr); |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 197 | activationProgress.reset(nullptr); |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 198 | } |
| 199 | return softwareServer::Activation::activation(value); |
| 200 | } |
| 201 | |
Saqib Khan | ee13e83 | 2017-10-23 12:53:11 -0500 | [diff] [blame] | 202 | void Activation::deleteImageManagerObject() |
| 203 | { |
Saqib Khan | ee13e83 | 2017-10-23 12:53:11 -0500 | [diff] [blame] | 204 | // Call the Delete object for <versionID> inside image_manager |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 205 | auto method = this->bus.new_method_call(VERSION_BUSNAME, path.c_str(), |
| 206 | "xyz.openbmc_project.Object.Delete", |
| 207 | "Delete"); |
Adriana Kobylak | 00bd902 | 2018-01-24 13:55:58 -0600 | [diff] [blame] | 208 | auto mapperResponseMsg = bus.call(method); |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 209 | // Check that the bus call didn't result in an error |
Saqib Khan | ee13e83 | 2017-10-23 12:53:11 -0500 | [diff] [blame] | 210 | if (mapperResponseMsg.is_method_error()) |
| 211 | { |
| 212 | log<level::ERR>("Error in Deleting image from image manager", |
Adriana Kobylak | 596466b | 2018-02-13 14:48:53 -0600 | [diff] [blame] | 213 | entry("VERSIONPATH=%s", path.c_str())); |
Saqib Khan | ee13e83 | 2017-10-23 12:53:11 -0500 | [diff] [blame] | 214 | return; |
| 215 | } |
| 216 | } |
| 217 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 218 | auto Activation::requestedActivation(RequestedActivations value) |
| 219 | -> RequestedActivations |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 220 | { |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 221 | rwVolumeCreated = false; |
| 222 | roVolumeCreated = false; |
Adriana Kobylak | 166bdf3 | 2018-04-09 14:24:06 -0500 | [diff] [blame] | 223 | ubootEnvVarsUpdated = false; |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 224 | |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 225 | if ((value == softwareServer::Activation::RequestedActivations::Active) && |
| 226 | (softwareServer::Activation::requestedActivation() != |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 227 | softwareServer::Activation::RequestedActivations::Active)) |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 228 | { |
| 229 | if ((softwareServer::Activation::activation() == |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 230 | softwareServer::Activation::Activations::Ready) || |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 231 | (softwareServer::Activation::activation() == |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 232 | softwareServer::Activation::Activations::Failed)) |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 233 | { |
| 234 | Activation::activation( |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 235 | softwareServer::Activation::Activations::Activating); |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 236 | } |
| 237 | } |
| 238 | return softwareServer::Activation::requestedActivation(value); |
| 239 | } |
| 240 | |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 241 | uint8_t RedundancyPriority::priority(uint8_t value) |
| 242 | { |
Adriana Kobylak | b77551c | 2017-10-27 12:46:23 -0500 | [diff] [blame] | 243 | // Set the priority value so that the freePriority() function can order |
| 244 | // the versions by priority. |
| 245 | auto newPriority = softwareServer::RedundancyPriority::priority(value); |
Adriana Kobylak | bbcb7be | 2018-07-17 15:47:34 -0500 | [diff] [blame] | 246 | parent.parent.savePriority(parent.versionId, value); |
Adriana Kobylak | b77551c | 2017-10-27 12:46:23 -0500 | [diff] [blame] | 247 | parent.parent.freePriority(value, parent.versionId); |
| 248 | return newPriority; |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 249 | } |
| 250 | |
Adriana Kobylak | b77551c | 2017-10-27 12:46:23 -0500 | [diff] [blame] | 251 | uint8_t RedundancyPriority::sdbusPriority(uint8_t value) |
Saqib Khan | f0382c3 | 2017-10-24 13:36:22 -0500 | [diff] [blame] | 252 | { |
Adriana Kobylak | bbcb7be | 2018-07-17 15:47:34 -0500 | [diff] [blame] | 253 | parent.parent.savePriority(parent.versionId, value); |
Adriana Kobylak | b77551c | 2017-10-27 12:46:23 -0500 | [diff] [blame] | 254 | return softwareServer::RedundancyPriority::priority(value); |
Saqib Khan | f0382c3 | 2017-10-24 13:36:22 -0500 | [diff] [blame] | 255 | } |
| 256 | |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 257 | void Activation::unitStateChange(sdbusplus::message::message& msg) |
| 258 | { |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 259 | if (softwareServer::Activation::activation() != |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 260 | softwareServer::Activation::Activations::Activating) |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 261 | { |
| 262 | return; |
| 263 | } |
| 264 | |
Adriana Kobylak | 3ce563a | 2018-06-06 16:41:15 -0500 | [diff] [blame] | 265 | onStateChanges(msg); |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 266 | |
| 267 | return; |
| 268 | } |
| 269 | |
Lei YU | 9053225 | 2018-05-24 11:15:24 +0800 | [diff] [blame] | 270 | #ifdef WANT_SIGNATURE_VERIFY |
| 271 | bool Activation::verifySignature(const fs::path& imageDir, |
| 272 | const fs::path& confDir) |
| 273 | { |
| 274 | using Signature = phosphor::software::image::Signature; |
| 275 | |
| 276 | Signature signature(imageDir, confDir); |
| 277 | |
| 278 | return signature.verify(); |
| 279 | } |
| 280 | |
| 281 | void Activation::onVerifyFailed() |
| 282 | { |
| 283 | log<level::ERR>("Error occurred during image validation"); |
| 284 | report<InternalFailure>(); |
| 285 | } |
| 286 | #endif |
| 287 | |
Saqib Khan | f37cefc | 2017-09-12 08:44:41 -0500 | [diff] [blame] | 288 | void ActivationBlocksTransition::enableRebootGuard() |
| 289 | { |
| 290 | log<level::INFO>("BMC image activating - BMC reboots are disabled."); |
| 291 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 292 | auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, |
| 293 | SYSTEMD_INTERFACE, "StartUnit"); |
Saqib Khan | f37cefc | 2017-09-12 08:44:41 -0500 | [diff] [blame] | 294 | method.append("reboot-guard-enable.service", "replace"); |
| 295 | bus.call_noreply(method); |
| 296 | } |
| 297 | |
| 298 | void ActivationBlocksTransition::disableRebootGuard() |
| 299 | { |
| 300 | log<level::INFO>("BMC activation has ended - BMC reboots are re-enabled."); |
| 301 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 302 | auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, |
| 303 | SYSTEMD_INTERFACE, "StartUnit"); |
Saqib Khan | f37cefc | 2017-09-12 08:44:41 -0500 | [diff] [blame] | 304 | method.append("reboot-guard-disable.service", "replace"); |
| 305 | bus.call_noreply(method); |
| 306 | } |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 307 | |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 308 | } // namespace updater |
| 309 | } // namespace software |
| 310 | } // namespace phosphor |