| 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 | 
| Adriana Kobylak | c98d912 | 2020-05-05 10:36:01 -0500 | [diff] [blame] | 16 | #include <filesystem> | 
| Lei YU | 9053225 | 2018-05-24 11:15:24 +0800 | [diff] [blame] | 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 | 
| Adriana Kobylak | c98d912 | 2020-05-05 10:36:01 -0500 | [diff] [blame] | 27 | namespace fs = std::filesystem; | 
| Lei YU | 9053225 | 2018-05-24 11:15:24 +0800 | [diff] [blame] | 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) : | 
| Lei YU | 29d84b0 | 2020-02-13 15:13:09 +0800 | [diff] [blame] | 75 |         RedundancyPriorityInherit(bus, path.c_str(), | 
 | 76 |                                   action::emit_interface_added), | 
 | 77 |         parent(parent) | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 78 |     { | 
 | 79 |         // Set Property | 
 | 80 |         if (freePriority) | 
| Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 81 |         { | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 82 |             priority(value); | 
 | 83 |         } | 
 | 84 |         else | 
 | 85 |         { | 
 | 86 |             sdbusPriority(value); | 
| Saqib Khan | 140fcb1 | 2017-08-07 09:06:57 -0500 | [diff] [blame] | 87 |         } | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 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; | 
| Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 115 | }; | 
| Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 116 |  | 
 | 117 | /** @class ActivationBlocksTransition | 
 | 118 |  *  @brief OpenBMC ActivationBlocksTransition implementation. | 
 | 119 |  *  @details A concrete implementation for | 
 | 120 |  *  xyz.openbmc_project.Software.ActivationBlocksTransition DBus API. | 
 | 121 |  */ | 
 | 122 | class ActivationBlocksTransition : public ActivationBlocksTransitionInherit | 
 | 123 | { | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 124 |   public: | 
 | 125 |     /** @brief Constructs ActivationBlocksTransition. | 
 | 126 |      * | 
 | 127 |      *  @param[in] bus    - The Dbus bus object | 
 | 128 |      *  @param[in] path   - The Dbus object path | 
 | 129 |      */ | 
 | 130 |     ActivationBlocksTransition(sdbusplus::bus::bus& bus, | 
 | 131 |                                const std::string& path) : | 
| Lei YU | 29d84b0 | 2020-02-13 15:13:09 +0800 | [diff] [blame] | 132 |         ActivationBlocksTransitionInherit(bus, path.c_str(), | 
 | 133 |                                           action::emit_interface_added), | 
 | 134 |         bus(bus) | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 135 |     { | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 136 |         enableRebootGuard(); | 
 | 137 |     } | 
| Saqib Khan | 140fcb1 | 2017-08-07 09:06:57 -0500 | [diff] [blame] | 138 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 139 |     ~ActivationBlocksTransition() | 
 | 140 |     { | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 141 |         disableRebootGuard(); | 
 | 142 |     } | 
| Saqib Khan | 140fcb1 | 2017-08-07 09:06:57 -0500 | [diff] [blame] | 143 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 144 |   private: | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 145 |     sdbusplus::bus::bus& bus; | 
| Saqib Khan | f37cefc | 2017-09-12 08:44:41 -0500 | [diff] [blame] | 146 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 147 |     /** @brief Enables a Guard that blocks any BMC reboot commands */ | 
 | 148 |     void enableRebootGuard(); | 
| Saqib Khan | f37cefc | 2017-09-12 08:44:41 -0500 | [diff] [blame] | 149 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 150 |     /** @brief Disables any guard that was blocking the BMC reboot */ | 
 | 151 |     void disableRebootGuard(); | 
| Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 152 | }; | 
| Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 153 |  | 
| Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 154 | class ActivationProgress : public ActivationProgressInherit | 
 | 155 | { | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 156 |   public: | 
 | 157 |     /** @brief Constructs ActivationProgress. | 
 | 158 |      * | 
 | 159 |      * @param[in] bus    - The Dbus bus object | 
 | 160 |      * @param[in] path   - The Dbus object path | 
 | 161 |      */ | 
 | 162 |     ActivationProgress(sdbusplus::bus::bus& bus, const std::string& path) : | 
| Lei YU | 29d84b0 | 2020-02-13 15:13:09 +0800 | [diff] [blame] | 163 |         ActivationProgressInherit(bus, path.c_str(), | 
 | 164 |                                   action::emit_interface_added) | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 165 |     { | 
 | 166 |         progress(0); | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 167 |     } | 
| Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 168 | }; | 
 | 169 |  | 
| Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 170 | /** @class Activation | 
 | 171 |  *  @brief OpenBMC activation software management implementation. | 
 | 172 |  *  @details A concrete implementation for | 
 | 173 |  *  xyz.openbmc_project.Software.Activation DBus API. | 
 | 174 |  */ | 
| Lei YU | 1be8d50 | 2018-06-20 11:48:36 +0800 | [diff] [blame] | 175 | class Activation : public ActivationInherit, public Flash | 
| Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 176 | { | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 177 |   public: | 
 | 178 |     /** @brief Constructs Activation Software Manager | 
 | 179 |      * | 
 | 180 |      * @param[in] bus    - The Dbus bus object | 
 | 181 |      * @param[in] path   - The Dbus object path | 
 | 182 |      * @param[in] parent - Parent object. | 
 | 183 |      * @param[in] versionId  - The software version id | 
 | 184 |      * @param[in] activationStatus - The status of Activation | 
 | 185 |      * @param[in] assocs - Association objects | 
 | 186 |      */ | 
 | 187 |     Activation(sdbusplus::bus::bus& bus, const std::string& path, | 
 | 188 |                ItemUpdater& parent, std::string& versionId, | 
 | 189 |                sdbusplus::xyz::openbmc_project::Software::server::Activation:: | 
 | 190 |                    Activations activationStatus, | 
 | 191 |                AssociationList& assocs) : | 
| Patrick Williams | 35aa9a8 | 2022-04-05 15:55:30 -0500 | [diff] [blame] | 192 |         ActivationInherit(bus, path.c_str(), | 
 | 193 |                           ActivationInherit::action::defer_emit), | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 194 |         bus(bus), path(path), parent(parent), versionId(versionId), | 
 | 195 |         systemdSignals( | 
 | 196 |             bus, | 
 | 197 |             sdbusRule::type::signal() + sdbusRule::member("JobRemoved") + | 
 | 198 |                 sdbusRule::path("/org/freedesktop/systemd1") + | 
 | 199 |                 sdbusRule::interface("org.freedesktop.systemd1.Manager"), | 
 | 200 |             std::bind(std::mem_fn(&Activation::unitStateChange), this, | 
 | 201 |                       std::placeholders::_1)) | 
 | 202 |     { | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 203 |         // Set Properties. | 
 | 204 |         activation(activationStatus); | 
 | 205 |         associations(assocs); | 
| Gunnar Mills | b60add1 | 2017-08-24 16:41:42 -0500 | [diff] [blame] | 206 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 207 |         // Emit deferred signal. | 
 | 208 |         emit_object_added(); | 
 | 209 |     } | 
| Gunnar Mills | 2ce7da2 | 2017-05-04 15:37:56 -0500 | [diff] [blame] | 210 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 211 |     /** @brief Overloaded Activation property setter function | 
 | 212 |      * | 
 | 213 |      * @param[in] value - One of Activation::Activations | 
 | 214 |      * | 
 | 215 |      * @return Success or exception thrown | 
 | 216 |      */ | 
 | 217 |     Activations activation(Activations value) override; | 
| Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 218 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 219 |     /** @brief Activation */ | 
 | 220 |     using ActivationInherit::activation; | 
| Leonel Gonzalez | e423368 | 2017-07-07 14:38:25 -0500 | [diff] [blame] | 221 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 222 |     /** @brief Overloaded requestedActivation property setter function | 
 | 223 |      * | 
 | 224 |      * @param[in] value - One of Activation::RequestedActivations | 
 | 225 |      * | 
 | 226 |      * @return Success or exception thrown | 
 | 227 |      */ | 
 | 228 |     RequestedActivations | 
 | 229 |         requestedActivation(RequestedActivations value) override; | 
| Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 230 |  | 
| Adriana Kobylak | 9f89e2e | 2018-05-30 13:16:20 -0500 | [diff] [blame] | 231 |     /** @brief Overloaded write flash function */ | 
 | 232 |     void flashWrite() override; | 
 | 233 |  | 
| Adriana Kobylak | b824b2f | 2020-05-14 14:57:53 -0500 | [diff] [blame] | 234 |     /** | 
 | 235 |      * @brief Handle the success of the flashWrite() function | 
 | 236 |      * | 
 | 237 |      * @details Perform anything that is necessary to mark the activation | 
 | 238 |      * successful after the image has been written to flash. Sets the Activation | 
 | 239 |      * value to Active. | 
 | 240 |      */ | 
 | 241 |     void onFlashWriteSuccess(); | 
 | 242 |  | 
| Vijay Khemka | e9f6c84 | 2020-01-14 14:32:39 -0800 | [diff] [blame] | 243 | #ifdef HOST_BIOS_UPGRADE | 
 | 244 |     /* @brief write to Host flash function */ | 
 | 245 |     void flashWriteHost(); | 
 | 246 |  | 
 | 247 |     /** @brief Function that acts on Bios upgrade service file state changes */ | 
 | 248 |     void onStateChangesBios(sdbusplus::message::message&); | 
 | 249 | #endif | 
 | 250 |  | 
| Adriana Kobylak | 3ce563a | 2018-06-06 16:41:15 -0500 | [diff] [blame] | 251 |     /** @brief Overloaded function that acts on service file state changes */ | 
 | 252 |     void onStateChanges(sdbusplus::message::message&) override; | 
 | 253 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 254 |     /** @brief Check if systemd state change is relevant to this object | 
 | 255 |      * | 
 | 256 |      * Instance specific interface to handle the detected systemd state | 
 | 257 |      * change | 
 | 258 |      * | 
 | 259 |      * @param[in]  msg       - Data associated with subscribed signal | 
 | 260 |      * | 
 | 261 |      */ | 
 | 262 |     void unitStateChange(sdbusplus::message::message& msg); | 
| Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 263 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 264 |     /** | 
 | 265 |      * @brief subscribe to the systemd signals | 
 | 266 |      * | 
 | 267 |      * This object needs to capture when it's systemd targets complete | 
 | 268 |      * so it can keep it's state updated | 
 | 269 |      * | 
 | 270 |      */ | 
 | 271 |     void subscribeToSystemdSignals(); | 
| 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 unsubscribe from the systemd signals | 
 | 275 |      * | 
 | 276 |      * systemd signals are only of interest during the activation process. | 
 | 277 |      * Once complete, we want to unsubscribe to avoid unnecessary calls of | 
 | 278 |      * unitStateChange(). | 
 | 279 |      * | 
 | 280 |      */ | 
 | 281 |     void unsubscribeFromSystemdSignals(); | 
| Michael Tritz | f2b5e0d | 2017-07-25 14:39:34 -0500 | [diff] [blame] | 282 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 283 |     /** | 
 | 284 |      * @brief Deletes the version from Image Manager and the | 
 | 285 |      *        untar image from image upload dir. | 
 | 286 |      */ | 
 | 287 |     void deleteImageManagerObject(); | 
| Saqib Khan | ee13e83 | 2017-10-23 12:53:11 -0500 | [diff] [blame] | 288 |  | 
| Jayashankar Padath | a013560 | 2019-04-22 16:22:58 +0530 | [diff] [blame] | 289 |     /** | 
 | 290 |      * @brief Determine the configured image apply time value | 
 | 291 |      * | 
 | 292 |      * @return true if the image apply time value is immediate | 
 | 293 |      **/ | 
 | 294 |     bool checkApplyTimeImmediate(); | 
 | 295 |  | 
 | 296 |     /** | 
 | 297 |      * @brief Reboot the BMC. Called when ApplyTime is immediate. | 
 | 298 |      * | 
 | 299 |      * @return none | 
 | 300 |      **/ | 
 | 301 |     void rebootBmc(); | 
 | 302 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 303 |     /** @brief Persistent sdbusplus DBus bus connection */ | 
 | 304 |     sdbusplus::bus::bus& bus; | 
| Gunnar Mills | 2ce7da2 | 2017-05-04 15:37:56 -0500 | [diff] [blame] | 305 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 306 |     /** @brief Persistent DBus object path */ | 
 | 307 |     std::string path; | 
| Gunnar Mills | 2ce7da2 | 2017-05-04 15:37:56 -0500 | [diff] [blame] | 308 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 309 |     /** @brief Parent Object. */ | 
 | 310 |     ItemUpdater& parent; | 
| Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 311 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 312 |     /** @brief Version id */ | 
 | 313 |     std::string versionId; | 
| Saqib Khan | b077470 | 2017-05-23 16:02:41 -0500 | [diff] [blame] | 314 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 315 |     /** @brief Persistent ActivationBlocksTransition dbus object */ | 
 | 316 |     std::unique_ptr<ActivationBlocksTransition> activationBlocksTransition; | 
| Saqib Khan | 4c1aec0 | 2017-07-06 11:46:13 -0500 | [diff] [blame] | 317 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 318 |     /** @brief Persistent RedundancyPriority dbus object */ | 
 | 319 |     std::unique_ptr<RedundancyPriority> redundancyPriority; | 
| Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 320 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 321 |     /** @brief Persistent ActivationProgress dbus object */ | 
 | 322 |     std::unique_ptr<ActivationProgress> activationProgress; | 
| Michael Tritz | 0edd4ad | 2017-07-26 14:27:42 -0500 | [diff] [blame] | 323 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 324 |     /** @brief Used to subscribe to dbus systemd signals **/ | 
 | 325 |     sdbusplus::bus::match_t systemdSignals; | 
| 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-write volume has been created as | 
 | 328 |      * part of the activation process. **/ | 
 | 329 |     bool rwVolumeCreated = false; | 
| Michael Tritz | bed88af | 2017-07-19 16:00:06 -0500 | [diff] [blame] | 330 |  | 
| Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 331 |     /** @brief Tracks whether the read-only volume has been created as | 
 | 332 |      * part of the activation process. **/ | 
 | 333 |     bool roVolumeCreated = false; | 
| Adriana Kobylak | 166bdf3 | 2018-04-09 14:24:06 -0500 | [diff] [blame] | 334 |  | 
 | 335 |     /** @brief Tracks if the service that updates the U-Boot environment | 
 | 336 |      *         variables has completed. **/ | 
 | 337 |     bool ubootEnvVarsUpdated = false; | 
| Lei YU | 9053225 | 2018-05-24 11:15:24 +0800 | [diff] [blame] | 338 |  | 
 | 339 | #ifdef WANT_SIGNATURE_VERIFY | 
 | 340 |   private: | 
 | 341 |     /** @brief Verify signature of the images. | 
 | 342 |      * | 
 | 343 |      * @param[in] imageDir - The path of images to verify | 
 | 344 |      * @param[in] confDir - The path of configs for verification | 
 | 345 |      * | 
 | 346 |      * @return true if verification successful and false otherwise | 
 | 347 |      */ | 
 | 348 |     bool verifySignature(const fs::path& imageDir, const fs::path& confDir); | 
 | 349 |  | 
 | 350 |     /** @brief Called when image verification fails. */ | 
 | 351 |     void onVerifyFailed(); | 
 | 352 | #endif | 
| Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 353 | }; | 
 | 354 |  | 
 | 355 | } // namespace updater | 
 | 356 | } // namespace software | 
 | 357 | } // namespace phosphor |