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