blob: 26d4209be7281fb0cc9f54b1fd2347dab6dbe163 [file] [log] [blame]
Lei YU9b21efc2019-02-21 15:52:53 +08001#pragma once
2
3#include "activation.hpp"
4
Andrew Geisslerab139ce2020-05-16 13:22:09 -05005#include <string>
6
Lei YU9b21efc2019-02-21 15:52:53 +08007namespace openpower
8{
9namespace software
10{
11namespace updater
12{
13
Lei YU2b2d2292019-03-18 15:22:56 +080014constexpr auto squashFSImage = "pnor.xz.squashfs";
15
Lei YU9b21efc2019-02-21 15:52:53 +080016class RedundancyPriorityUbi : public RedundancyPriority
17{
18 public:
Patrick Williams0dea1992022-07-22 19:26:52 -050019 RedundancyPriorityUbi(sdbusplus::bus_t& bus, const std::string& path,
Adriana Kobylakdf7a6152019-03-25 14:06:49 -050020 Activation& parent, uint8_t value) :
21 RedundancyPriority(bus, path, parent, value)
22 {
23 priority(value);
24 }
Lei YU9b21efc2019-02-21 15:52:53 +080025 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 */
41class 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
Patrick Williams0dea1992022-07-22 19:26:52 -050063 void unitStateChange(sdbusplus::message_t& msg) override;
Lei YU9b21efc2019-02-21 15:52:53 +080064 void startActivation() override;
65 void finishActivation() override;
66};
67
68} // namespace updater
69} // namespace software
70} // namespace openpower