1 #pragma once
2 
3 #include "activation.hpp"
4 
5 #include <string>
6 
7 namespace openpower
8 {
9 namespace software
10 {
11 namespace updater
12 {
13 
14 constexpr auto squashFSImage = "pnor.xz.squashfs";
15 
16 class RedundancyPriorityUbi : public RedundancyPriority
17 {
18   public:
RedundancyPriorityUbi(sdbusplus::bus_t & bus,const std::string & path,Activation & parent,uint8_t value)19     RedundancyPriorityUbi(sdbusplus::bus_t& bus, const std::string& path,
20                           Activation& parent, uint8_t value) :
21         RedundancyPriority(bus, path, parent, value)
22     {
23         priority(value);
24     }
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_t& msg) override;
64     void startActivation() override;
65     void finishActivation() override;
66 };
67 
68 } // namespace updater
69 } // namespace software
70 } // namespace openpower
71