19b21efc5SLei YU #pragma once
29b21efc5SLei YU 
39b21efc5SLei YU #include "activation.hpp"
49b21efc5SLei YU 
59b21efc5SLei YU namespace openpower
69b21efc5SLei YU {
79b21efc5SLei YU namespace software
89b21efc5SLei YU {
99b21efc5SLei YU namespace updater
109b21efc5SLei YU {
119b21efc5SLei YU 
12*2b2d2298SLei YU constexpr auto squashFSImage = "pnor.xz.squashfs";
13*2b2d2298SLei YU 
149b21efc5SLei YU class RedundancyPriorityUbi : public RedundancyPriority
159b21efc5SLei YU {
169b21efc5SLei YU   public:
17df7a6157SAdriana Kobylak     RedundancyPriorityUbi(sdbusplus::bus::bus& bus, const std::string& path,
18df7a6157SAdriana Kobylak                           Activation& parent, uint8_t value) :
19df7a6157SAdriana Kobylak         RedundancyPriority(bus, path, parent, value)
20df7a6157SAdriana Kobylak     {
21df7a6157SAdriana Kobylak         priority(value);
22df7a6157SAdriana Kobylak     }
239b21efc5SLei YU     virtual ~RedundancyPriorityUbi() = default;
249b21efc5SLei YU 
259b21efc5SLei YU     /** @brief Overloaded Priority property set function
269b21efc5SLei YU      *
279b21efc5SLei YU      *  @param[in] value - uint8_t
289b21efc5SLei YU      *
299b21efc5SLei YU      *  @return Success or exception thrown
309b21efc5SLei YU      */
319b21efc5SLei YU     uint8_t priority(uint8_t value) override;
329b21efc5SLei YU };
339b21efc5SLei YU 
349b21efc5SLei YU /** @class ActivationUbi
359b21efc5SLei YU  *  @brief OpenBMC activation software management implementation.
369b21efc5SLei YU  *  @details A concrete implementation for
379b21efc5SLei YU  *  xyz.openbmc_project.Software.Activation DBus API.
389b21efc5SLei YU  */
399b21efc5SLei YU class ActivationUbi : public Activation
409b21efc5SLei YU {
419b21efc5SLei YU   public:
429b21efc5SLei YU     using Activation::Activation;
439b21efc5SLei YU     virtual ~ActivationUbi() = default;
449b21efc5SLei YU 
459b21efc5SLei YU     /** @brief Overloaded Activation property setter function
469b21efc5SLei YU      *
479b21efc5SLei YU      *  @param[in] value - One of Activation::Activations
489b21efc5SLei YU      *
499b21efc5SLei YU      *  @return Success or exception thrown
509b21efc5SLei YU      */
519b21efc5SLei YU     Activations activation(Activations value) override;
529b21efc5SLei YU 
539b21efc5SLei YU     RequestedActivations
549b21efc5SLei YU         requestedActivation(RequestedActivations value) override;
559b21efc5SLei YU 
569b21efc5SLei YU   private:
579b21efc5SLei YU     /** @brief Tracks whether the read-only & read-write volumes have been
589b21efc5SLei YU      *created as part of the activation process. **/
599b21efc5SLei YU     bool ubiVolumesCreated = false;
609b21efc5SLei YU 
619b21efc5SLei YU     void unitStateChange(sdbusplus::message::message& msg) override;
629b21efc5SLei YU     void startActivation() override;
639b21efc5SLei YU     void finishActivation() override;
649b21efc5SLei YU };
659b21efc5SLei YU 
669b21efc5SLei YU } // namespace updater
679b21efc5SLei YU } // namespace software
689b21efc5SLei YU } // namespace openpower
69