blob: a6ef436c130cbc138486ca4efd8ed35e12eb23ed [file] [log] [blame]
Lei YU9b21efc2019-02-21 15:52:53 +08001#pragma once
2
3#include "activation.hpp"
4
5namespace openpower
6{
7namespace software
8{
9namespace updater
10{
11
Lei YU2b2d2292019-03-18 15:22:56 +080012constexpr auto squashFSImage = "pnor.xz.squashfs";
13
Lei YU9b21efc2019-02-21 15:52:53 +080014class RedundancyPriorityUbi : public RedundancyPriority
15{
16 public:
Adriana Kobylakdf7a6152019-03-25 14:06:49 -050017 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 YU9b21efc2019-02-21 15:52:53 +080023 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 */
39class 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