Lei YU | 9b21efc | 2019-02-21 15:52:53 +0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "activation.hpp" |
| 4 | |
| 5 | namespace openpower |
| 6 | { |
| 7 | namespace software |
| 8 | { |
| 9 | namespace updater |
| 10 | { |
| 11 | |
Lei YU | 2b2d229 | 2019-03-18 15:22:56 +0800 | [diff] [blame] | 12 | constexpr auto squashFSImage = "pnor.xz.squashfs"; |
| 13 | |
Lei YU | 9b21efc | 2019-02-21 15:52:53 +0800 | [diff] [blame] | 14 | class RedundancyPriorityUbi : public RedundancyPriority |
| 15 | { |
| 16 | public: |
Adriana Kobylak | df7a615 | 2019-03-25 14:06:49 -0500 | [diff] [blame] | 17 | RedundancyPriorityUbi(sdbusplus::bus::bus& bus, const std::string& path, |
| 18 | Activation& parent, uint8_t value) : |
| 19 | RedundancyPriority(bus, path, parent, value) |
| 20 | { |
| 21 | priority(value); |
| 22 | } |
Lei YU | 9b21efc | 2019-02-21 15:52:53 +0800 | [diff] [blame] | 23 | virtual ~RedundancyPriorityUbi() = default; |
| 24 | |
| 25 | /** @brief Overloaded Priority property set function |
| 26 | * |
| 27 | * @param[in] value - uint8_t |
| 28 | * |
| 29 | * @return Success or exception thrown |
| 30 | */ |
| 31 | uint8_t priority(uint8_t value) override; |
| 32 | }; |
| 33 | |
| 34 | /** @class ActivationUbi |
| 35 | * @brief OpenBMC activation software management implementation. |
| 36 | * @details A concrete implementation for |
| 37 | * xyz.openbmc_project.Software.Activation DBus API. |
| 38 | */ |
| 39 | class ActivationUbi : public Activation |
| 40 | { |
| 41 | public: |
| 42 | using Activation::Activation; |
| 43 | virtual ~ActivationUbi() = default; |
| 44 | |
| 45 | /** @brief Overloaded Activation property setter function |
| 46 | * |
| 47 | * @param[in] value - One of Activation::Activations |
| 48 | * |
| 49 | * @return Success or exception thrown |
| 50 | */ |
| 51 | Activations activation(Activations value) override; |
| 52 | |
| 53 | RequestedActivations |
| 54 | requestedActivation(RequestedActivations value) override; |
| 55 | |
| 56 | private: |
| 57 | /** @brief Tracks whether the read-only & read-write volumes have been |
| 58 | *created as part of the activation process. **/ |
| 59 | bool ubiVolumesCreated = false; |
| 60 | |
| 61 | void unitStateChange(sdbusplus::message::message& msg) override; |
| 62 | void startActivation() override; |
| 63 | void finishActivation() override; |
| 64 | }; |
| 65 | |
| 66 | } // namespace updater |
| 67 | } // namespace software |
| 68 | } // namespace openpower |