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