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" |
Jayashankar Padath | a013560 | 2019-04-22 16:22:58 +0530 | [diff] [blame] | 6 | #include "utils.hpp" |
Gunnar Mills | b0ce996 | 2018-09-07 13:39:10 -0500 | [diff] [blame] | 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> |
John Wang | 85c356f | 2019-09-11 16:20:13 +0800 | [diff] [blame] | 11 | #include <xyz/openbmc_project/Association/Definitions/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, |
John Wang | 85c356f | 2019-09-11 16:20:13 +0800 | [diff] [blame] | 34 | sdbusplus::xyz::openbmc_project::Association::server::Definitions>; |
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 | |
Vijay Khemka | e9f6c84 | 2020-01-14 14:32:39 -0800 | [diff] [blame] | 269 | #ifdef HOST_BIOS_UPGRADE |
| 270 | /* @brief write to Host flash function */ |
| 271 | void flashWriteHost(); |
| 272 | |
| 273 | /** @brief Function that acts on Bios upgrade service file state changes */ |
| 274 | void onStateChangesBios(sdbusplus::message::message&); |
| 275 | #endif |
| 276 | |
Adriana Kobylak | 3ce563a | 2018-06-06 16:41:15 -0500 | [diff] [blame] | 277 | /** @brief Overloaded function that acts on service file state changes */ |
| 278 | void onStateChanges(sdbusplus::message::message&) override; |
| 279 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 280 | /** @brief Check if systemd state change is relevant to this object |
| 281 | * |
| 282 | * Instance specific interface to handle the detected systemd state |
| 283 | * change |
| 284 | * |
| 285 | * @param[in] msg - Data associated with subscribed signal |
| 286 | * |
| 287 | */ |
| 288 | void unitStateChange(sdbusplus::message::message& msg); |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 289 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 290 | /** |
| 291 | * @brief subscribe to the systemd signals |
| 292 | * |
| 293 | * This object needs to capture when it's systemd targets complete |
| 294 | * so it can keep it's state updated |
| 295 | * |
| 296 | */ |
| 297 | void subscribeToSystemdSignals(); |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 298 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 299 | /** |
| 300 | * @brief unsubscribe from the systemd signals |
| 301 | * |
| 302 | * systemd signals are only of interest during the activation process. |
| 303 | * Once complete, we want to unsubscribe to avoid unnecessary calls of |
| 304 | * unitStateChange(). |
| 305 | * |
| 306 | */ |
| 307 | void unsubscribeFromSystemdSignals(); |
Michael Tritz | f2b5e0d | 2017-07-25 14:39:34 -0500 | [diff] [blame] | 308 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 309 | /** |
| 310 | * @brief Deletes the version from Image Manager and the |
| 311 | * untar image from image upload dir. |
| 312 | */ |
| 313 | void deleteImageManagerObject(); |
Saqib Khan | ee13e83 | 2017-10-23 12:53:11 -0500 | [diff] [blame] | 314 | |
Jayashankar Padath | a013560 | 2019-04-22 16:22:58 +0530 | [diff] [blame] | 315 | /** |
| 316 | * @brief Determine the configured image apply time value |
| 317 | * |
| 318 | * @return true if the image apply time value is immediate |
| 319 | **/ |
| 320 | bool checkApplyTimeImmediate(); |
| 321 | |
| 322 | /** |
| 323 | * @brief Reboot the BMC. Called when ApplyTime is immediate. |
| 324 | * |
| 325 | * @return none |
| 326 | **/ |
| 327 | void rebootBmc(); |
| 328 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 329 | /** @brief Persistent sdbusplus DBus bus connection */ |
| 330 | sdbusplus::bus::bus& bus; |
Gunnar Mills | 2ce7da2 | 2017-05-04 15:37:56 -0500 | [diff] [blame] | 331 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 332 | /** @brief Persistent DBus object path */ |
| 333 | std::string path; |
Gunnar Mills | 2ce7da2 | 2017-05-04 15:37:56 -0500 | [diff] [blame] | 334 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 335 | /** @brief Parent Object. */ |
| 336 | ItemUpdater& parent; |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 337 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 338 | /** @brief Version id */ |
| 339 | std::string versionId; |
Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 340 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 341 | /** @brief Persistent ActivationBlocksTransition dbus object */ |
| 342 | std::unique_ptr<ActivationBlocksTransition> activationBlocksTransition; |
Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 343 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 344 | /** @brief Persistent RedundancyPriority dbus object */ |
| 345 | std::unique_ptr<RedundancyPriority> redundancyPriority; |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 346 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 347 | /** @brief Persistent ActivationProgress dbus object */ |
| 348 | std::unique_ptr<ActivationProgress> activationProgress; |
Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 349 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 350 | /** @brief Used to subscribe to dbus systemd signals **/ |
| 351 | sdbusplus::bus::match_t systemdSignals; |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 352 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 353 | /** @brief Tracks whether the read-write volume has been created as |
| 354 | * part of the activation process. **/ |
| 355 | bool rwVolumeCreated = false; |
Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 356 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 357 | /** @brief Tracks whether the read-only volume has been created as |
| 358 | * part of the activation process. **/ |
| 359 | bool roVolumeCreated = false; |
Adriana Kobylak | 166bdf3 | 2018-04-09 14:24:06 -0500 | [diff] [blame] | 360 | |
| 361 | /** @brief Tracks if the service that updates the U-Boot environment |
| 362 | * variables has completed. **/ |
| 363 | bool ubootEnvVarsUpdated = false; |
Lei YU | 9053225 | 2018-05-24 11:15:24 +0800 | [diff] [blame] | 364 | |
| 365 | #ifdef WANT_SIGNATURE_VERIFY |
| 366 | private: |
| 367 | /** @brief Verify signature of the images. |
| 368 | * |
| 369 | * @param[in] imageDir - The path of images to verify |
| 370 | * @param[in] confDir - The path of configs for verification |
| 371 | * |
| 372 | * @return true if verification successful and false otherwise |
| 373 | */ |
| 374 | bool verifySignature(const fs::path& imageDir, const fs::path& confDir); |
| 375 | |
| 376 | /** @brief Called when image verification fails. */ |
| 377 | void onVerifyFailed(); |
| 378 | #endif |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 379 | }; |
| 380 | |
| 381 | } // namespace updater |
| 382 | } // namespace software |
| 383 | } // namespace phosphor |