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