Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 3 | #include <sdbusplus/server.hpp> |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 4 | #include <xyz/openbmc_project/Software/Activation/server.hpp> |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 5 | #include <xyz/openbmc_project/Software/ActivationBlocksTransition/server.hpp> |
Adriana Kobylak | 9f89e2e | 2018-05-30 13:16:20 -0500 | [diff] [blame] | 6 | #include "flash.hpp" |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 7 | #include "xyz/openbmc_project/Software/RedundancyPriority/server.hpp" |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 8 | #include "xyz/openbmc_project/Software/ActivationProgress/server.hpp" |
Gunnar Mills | f5eaf39 | 2017-08-22 16:36:55 -0500 | [diff] [blame] | 9 | #include "org/openbmc/Associations/server.hpp" |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 10 | |
Lei YU | 9053225 | 2018-05-24 11:15:24 +0800 | [diff] [blame] | 11 | #include "config.h" |
| 12 | |
| 13 | #ifdef WANT_SIGNATURE_VERIFY |
| 14 | #include <experimental/filesystem> |
| 15 | #endif |
| 16 | |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 17 | namespace phosphor |
| 18 | { |
| 19 | namespace software |
| 20 | { |
| 21 | namespace updater |
| 22 | { |
| 23 | |
Lei YU | 9053225 | 2018-05-24 11:15:24 +0800 | [diff] [blame] | 24 | #ifdef WANT_SIGNATURE_VERIFY |
| 25 | namespace fs = std::experimental::filesystem; |
| 26 | #endif |
| 27 | |
Gunnar Mills | b60add1 | 2017-08-24 16:41:42 -0500 | [diff] [blame] | 28 | using AssociationList = |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 29 | std::vector<std::tuple<std::string, std::string, std::string>>; |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 30 | using ActivationInherit = sdbusplus::server::object::object< |
Gunnar Mills | f5eaf39 | 2017-08-22 16:36:55 -0500 | [diff] [blame] | 31 | sdbusplus::xyz::openbmc_project::Software::server::Activation, |
Michael Tritz | 4254bec | 2017-10-03 17:18:22 -0500 | [diff] [blame] | 32 | sdbusplus::org::openbmc::server::Associations>; |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 33 | using ActivationBlocksTransitionInherit = sdbusplus::server::object::object< |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 34 | sdbusplus::xyz::openbmc_project::Software::server:: |
| 35 | ActivationBlocksTransition>; |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 36 | using RedundancyPriorityInherit = sdbusplus::server::object::object< |
| 37 | sdbusplus::xyz::openbmc_project::Software::server::RedundancyPriority>; |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 38 | using ActivationProgressInherit = sdbusplus::server::object::object< |
| 39 | sdbusplus::xyz::openbmc_project::Software::server::ActivationProgress>; |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 40 | |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 41 | namespace sdbusRule = sdbusplus::bus::match::rules; |
| 42 | |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 43 | class ItemUpdater; |
| 44 | class Activation; |
| 45 | class RedundancyPriority; |
| 46 | |
| 47 | /** @class RedundancyPriority |
| 48 | * @brief OpenBMC RedundancyPriority implementation |
| 49 | * @details A concrete implementation for |
| 50 | * xyz.openbmc_project.Software.RedundancyPriority DBus API. |
| 51 | */ |
| 52 | class RedundancyPriority : public RedundancyPriorityInherit |
| 53 | { |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 54 | public: |
| 55 | /** @brief Constructs RedundancyPriority. |
| 56 | * |
| 57 | * @param[in] bus - The Dbus bus object |
| 58 | * @param[in] path - The Dbus object path |
| 59 | * @param[in] parent - Parent object. |
| 60 | * @param[in] value - The redundancyPriority value |
| 61 | * @param[in] freePriority - Call freePriorioty, default to true |
| 62 | */ |
| 63 | RedundancyPriority(sdbusplus::bus::bus& bus, const std::string& path, |
| 64 | Activation& parent, uint8_t value, |
| 65 | bool freePriority = true) : |
| 66 | RedundancyPriorityInherit(bus, path.c_str(), true), |
| 67 | parent(parent), bus(bus), path(path) |
| 68 | { |
| 69 | // Set Property |
| 70 | if (freePriority) |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 71 | { |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 72 | priority(value); |
| 73 | } |
| 74 | else |
| 75 | { |
| 76 | sdbusPriority(value); |
Saqib Khan | 140fcb1 | 2017-08-07 09:06:57 -0500 | [diff] [blame] | 77 | } |
| 78 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 79 | std::vector<std::string> interfaces({interface}); |
| 80 | bus.emit_interfaces_added(path.c_str(), interfaces); |
| 81 | } |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 82 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 83 | ~RedundancyPriority() |
| 84 | { |
| 85 | std::vector<std::string> interfaces({interface}); |
| 86 | bus.emit_interfaces_removed(path.c_str(), interfaces); |
| 87 | } |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 88 | |
Gunnar Mills | e11a202 | 2018-03-23 12:04:48 -0500 | [diff] [blame] | 89 | /** @brief Overridden Priority property set function, calls freePriority |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 90 | * to bump the duplicated priority values. |
| 91 | * |
| 92 | * @param[in] value - uint8_t |
| 93 | * |
| 94 | * @return Success or exception thrown |
| 95 | */ |
| 96 | uint8_t priority(uint8_t value) override; |
Adriana Kobylak | b77551c | 2017-10-27 12:46:23 -0500 | [diff] [blame] | 97 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 98 | /** @brief Non-Overriden Priority property set function |
| 99 | * |
| 100 | * @param[in] value - uint8_t |
| 101 | * |
| 102 | * @return Success or exception thrown |
| 103 | */ |
| 104 | uint8_t sdbusPriority(uint8_t value); |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 105 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 106 | /** @brief Priority property get function |
| 107 | * |
| 108 | * @returns uint8_t - The Priority value |
| 109 | */ |
| 110 | using RedundancyPriorityInherit::priority; |
Saqib Khan | 140fcb1 | 2017-08-07 09:06:57 -0500 | [diff] [blame] | 111 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 112 | /** @brief Parent Object. */ |
| 113 | Activation& parent; |
| 114 | |
| 115 | private: |
| 116 | // TODO Remove once openbmc/openbmc#1975 is resolved |
| 117 | static constexpr auto interface = |
| 118 | "xyz.openbmc_project.Software.RedundancyPriority"; |
| 119 | sdbusplus::bus::bus& bus; |
| 120 | std::string path; |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 121 | }; |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 122 | |
| 123 | /** @class ActivationBlocksTransition |
| 124 | * @brief OpenBMC ActivationBlocksTransition implementation. |
| 125 | * @details A concrete implementation for |
| 126 | * xyz.openbmc_project.Software.ActivationBlocksTransition DBus API. |
| 127 | */ |
| 128 | class ActivationBlocksTransition : public ActivationBlocksTransitionInherit |
| 129 | { |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 130 | public: |
| 131 | /** @brief Constructs ActivationBlocksTransition. |
| 132 | * |
| 133 | * @param[in] bus - The Dbus bus object |
| 134 | * @param[in] path - The Dbus object path |
| 135 | */ |
| 136 | ActivationBlocksTransition(sdbusplus::bus::bus& bus, |
| 137 | const std::string& path) : |
| 138 | ActivationBlocksTransitionInherit(bus, path.c_str(), true), |
| 139 | bus(bus), path(path) |
| 140 | { |
| 141 | std::vector<std::string> interfaces({interface}); |
| 142 | bus.emit_interfaces_added(path.c_str(), interfaces); |
| 143 | enableRebootGuard(); |
| 144 | } |
Saqib Khan | 140fcb1 | 2017-08-07 09:06:57 -0500 | [diff] [blame] | 145 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 146 | ~ActivationBlocksTransition() |
| 147 | { |
| 148 | std::vector<std::string> interfaces({interface}); |
| 149 | bus.emit_interfaces_removed(path.c_str(), interfaces); |
| 150 | disableRebootGuard(); |
| 151 | } |
Saqib Khan | 140fcb1 | 2017-08-07 09:06:57 -0500 | [diff] [blame] | 152 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 153 | private: |
| 154 | // TODO Remove once openbmc/openbmc#1975 is resolved |
| 155 | static constexpr auto interface = |
| 156 | "xyz.openbmc_project.Software.ActivationBlocksTransition"; |
| 157 | sdbusplus::bus::bus& bus; |
| 158 | std::string path; |
Saqib Khan | f37cefc | 2017-09-12 08:44:41 -0500 | [diff] [blame] | 159 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 160 | /** @brief Enables a Guard that blocks any BMC reboot commands */ |
| 161 | void enableRebootGuard(); |
Saqib Khan | f37cefc | 2017-09-12 08:44:41 -0500 | [diff] [blame] | 162 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 163 | /** @brief Disables any guard that was blocking the BMC reboot */ |
| 164 | void disableRebootGuard(); |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 165 | }; |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 166 | |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 167 | class ActivationProgress : public ActivationProgressInherit |
| 168 | { |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 169 | public: |
| 170 | /** @brief Constructs ActivationProgress. |
| 171 | * |
| 172 | * @param[in] bus - The Dbus bus object |
| 173 | * @param[in] path - The Dbus object path |
| 174 | */ |
| 175 | ActivationProgress(sdbusplus::bus::bus& bus, const std::string& path) : |
| 176 | ActivationProgressInherit(bus, path.c_str(), true), bus(bus), path(path) |
| 177 | { |
| 178 | progress(0); |
| 179 | std::vector<std::string> interfaces({interface}); |
| 180 | bus.emit_interfaces_added(path.c_str(), interfaces); |
| 181 | } |
Saqib Khan | 140fcb1 | 2017-08-07 09:06:57 -0500 | [diff] [blame] | 182 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 183 | ~ActivationProgress() |
| 184 | { |
| 185 | std::vector<std::string> interfaces({interface}); |
| 186 | bus.emit_interfaces_removed(path.c_str(), interfaces); |
| 187 | } |
Saqib Khan | 140fcb1 | 2017-08-07 09:06:57 -0500 | [diff] [blame] | 188 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 189 | private: |
| 190 | // TODO Remove once openbmc/openbmc#1975 is resolved |
| 191 | static constexpr auto interface = |
| 192 | "xyz.openbmc_project.Software.ActivationProgress"; |
| 193 | sdbusplus::bus::bus& bus; |
| 194 | std::string path; |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 195 | }; |
| 196 | |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 197 | /** @class Activation |
| 198 | * @brief OpenBMC activation software management implementation. |
| 199 | * @details A concrete implementation for |
| 200 | * xyz.openbmc_project.Software.Activation DBus API. |
| 201 | */ |
Lei YU | 1be8d50 | 2018-06-20 11:48:36 +0800 | [diff] [blame] | 202 | class Activation : public ActivationInherit, public Flash |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 203 | { |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 204 | public: |
| 205 | /** @brief Constructs Activation Software Manager |
| 206 | * |
| 207 | * @param[in] bus - The Dbus bus object |
| 208 | * @param[in] path - The Dbus object path |
| 209 | * @param[in] parent - Parent object. |
| 210 | * @param[in] versionId - The software version id |
| 211 | * @param[in] activationStatus - The status of Activation |
| 212 | * @param[in] assocs - Association objects |
| 213 | */ |
| 214 | Activation(sdbusplus::bus::bus& bus, const std::string& path, |
| 215 | ItemUpdater& parent, std::string& versionId, |
| 216 | sdbusplus::xyz::openbmc_project::Software::server::Activation:: |
| 217 | Activations activationStatus, |
| 218 | AssociationList& assocs) : |
| 219 | ActivationInherit(bus, path.c_str(), true), |
| 220 | bus(bus), path(path), parent(parent), versionId(versionId), |
| 221 | systemdSignals( |
| 222 | bus, |
| 223 | sdbusRule::type::signal() + sdbusRule::member("JobRemoved") + |
| 224 | sdbusRule::path("/org/freedesktop/systemd1") + |
| 225 | sdbusRule::interface("org.freedesktop.systemd1.Manager"), |
| 226 | std::bind(std::mem_fn(&Activation::unitStateChange), this, |
| 227 | std::placeholders::_1)) |
| 228 | { |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 229 | // Set Properties. |
| 230 | activation(activationStatus); |
| 231 | associations(assocs); |
Gunnar Mills | b60add1 | 2017-08-24 16:41:42 -0500 | [diff] [blame] | 232 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 233 | // Emit deferred signal. |
| 234 | emit_object_added(); |
| 235 | } |
Gunnar Mills | 2ce7da2 | 2017-05-04 15:37:56 -0500 | [diff] [blame] | 236 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 237 | /** @brief Overloaded Activation property setter function |
| 238 | * |
| 239 | * @param[in] value - One of Activation::Activations |
| 240 | * |
| 241 | * @return Success or exception thrown |
| 242 | */ |
| 243 | Activations activation(Activations value) override; |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 244 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 245 | /** @brief Activation */ |
| 246 | using ActivationInherit::activation; |
Leonel Gonzalez | e423368 | 2017-07-07 14:38:25 -0500 | [diff] [blame] | 247 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 248 | /** @brief Overloaded requestedActivation property setter function |
| 249 | * |
| 250 | * @param[in] value - One of Activation::RequestedActivations |
| 251 | * |
| 252 | * @return Success or exception thrown |
| 253 | */ |
| 254 | RequestedActivations |
| 255 | requestedActivation(RequestedActivations value) override; |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 256 | |
Adriana Kobylak | 9f89e2e | 2018-05-30 13:16:20 -0500 | [diff] [blame] | 257 | /** @brief Overloaded write flash function */ |
| 258 | void flashWrite() override; |
| 259 | |
Adriana Kobylak | 3ce563a | 2018-06-06 16:41:15 -0500 | [diff] [blame] | 260 | /** @brief Overloaded function that acts on service file state changes */ |
| 261 | void onStateChanges(sdbusplus::message::message&) override; |
| 262 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 263 | /** @brief Check if systemd state change is relevant to this object |
| 264 | * |
| 265 | * Instance specific interface to handle the detected systemd state |
| 266 | * change |
| 267 | * |
| 268 | * @param[in] msg - Data associated with subscribed signal |
| 269 | * |
| 270 | */ |
| 271 | void unitStateChange(sdbusplus::message::message& msg); |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 272 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 273 | /** |
| 274 | * @brief subscribe to the systemd signals |
| 275 | * |
| 276 | * This object needs to capture when it's systemd targets complete |
| 277 | * so it can keep it's state updated |
| 278 | * |
| 279 | */ |
| 280 | void subscribeToSystemdSignals(); |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 281 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 282 | /** |
| 283 | * @brief unsubscribe from the systemd signals |
| 284 | * |
| 285 | * systemd signals are only of interest during the activation process. |
| 286 | * Once complete, we want to unsubscribe to avoid unnecessary calls of |
| 287 | * unitStateChange(). |
| 288 | * |
| 289 | */ |
| 290 | void unsubscribeFromSystemdSignals(); |
Michael Tritz | f2b5e0d | 2017-07-25 14:39:34 -0500 | [diff] [blame] | 291 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 292 | /** |
| 293 | * @brief Deletes the version from Image Manager and the |
| 294 | * untar image from image upload dir. |
| 295 | */ |
| 296 | void deleteImageManagerObject(); |
Saqib Khan | ee13e83 | 2017-10-23 12:53:11 -0500 | [diff] [blame] | 297 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 298 | /** @brief Persistent sdbusplus DBus bus connection */ |
| 299 | sdbusplus::bus::bus& bus; |
Gunnar Mills | 2ce7da2 | 2017-05-04 15:37:56 -0500 | [diff] [blame] | 300 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 301 | /** @brief Persistent DBus object path */ |
| 302 | std::string path; |
Gunnar Mills | 2ce7da2 | 2017-05-04 15:37:56 -0500 | [diff] [blame] | 303 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 304 | /** @brief Parent Object. */ |
| 305 | ItemUpdater& parent; |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 306 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 307 | /** @brief Version id */ |
| 308 | std::string versionId; |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 309 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 310 | /** @brief Persistent ActivationBlocksTransition dbus object */ |
| 311 | std::unique_ptr<ActivationBlocksTransition> activationBlocksTransition; |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 312 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 313 | /** @brief Persistent RedundancyPriority dbus object */ |
| 314 | std::unique_ptr<RedundancyPriority> redundancyPriority; |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 315 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 316 | /** @brief Persistent ActivationProgress dbus object */ |
| 317 | std::unique_ptr<ActivationProgress> activationProgress; |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 318 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 319 | /** @brief Used to subscribe to dbus systemd signals **/ |
| 320 | sdbusplus::bus::match_t systemdSignals; |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 321 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 322 | /** @brief Tracks whether the read-write volume has been created as |
| 323 | * part of the activation process. **/ |
| 324 | bool rwVolumeCreated = false; |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 325 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 326 | /** @brief Tracks whether the read-only volume has been created as |
| 327 | * part of the activation process. **/ |
| 328 | bool roVolumeCreated = false; |
Adriana Kobylak | 166bdf3 | 2018-04-09 14:24:06 -0500 | [diff] [blame] | 329 | |
| 330 | /** @brief Tracks if the service that updates the U-Boot environment |
| 331 | * variables has completed. **/ |
| 332 | bool ubootEnvVarsUpdated = false; |
Lei YU | 9053225 | 2018-05-24 11:15:24 +0800 | [diff] [blame] | 333 | |
| 334 | #ifdef WANT_SIGNATURE_VERIFY |
| 335 | private: |
| 336 | /** @brief Verify signature of the images. |
| 337 | * |
| 338 | * @param[in] imageDir - The path of images to verify |
| 339 | * @param[in] confDir - The path of configs for verification |
| 340 | * |
| 341 | * @return true if verification successful and false otherwise |
| 342 | */ |
| 343 | bool verifySignature(const fs::path& imageDir, const fs::path& confDir); |
| 344 | |
| 345 | /** @brief Called when image verification fails. */ |
| 346 | void onVerifyFailed(); |
| 347 | #endif |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 348 | }; |
| 349 | |
| 350 | } // namespace updater |
| 351 | } // namespace software |
| 352 | } // namespace phosphor |