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