#include "fw_update_watch.hpp" #include #include #include namespace openpower { namespace phal { namespace fwupdate { using namespace phosphor::logging; using Message = std::string; using Attributes = std::variant; using PropertyName = std::string; using PropertyMap = std::map; using InterfaceName = std::string; using InterfaceMap = std::map; void Watch::fwIntfAddedCallback(sdbusplus::message::message& msg) { // DBusInterfaceAdded interfaces; sdbusplus::message::object_path objectPath; InterfaceMap interfaceMap; try { msg.read(objectPath, interfaceMap); } catch (const sdbusplus::exception::SdBusError& e) { log(fmt::format("Failed to parse software add signal" "Exception [{}] REPLY_SIG [{}]", e.what(), msg.get_signature()) .c_str()); return; } auto iter = interfaceMap.find("xyz.openbmc_project.Software.Activation"); if (iter == interfaceMap.end()) { // Skip not related Software Activation return; } auto attr = iter->second.find("Activation"); if (attr == iter->second.end()) { // Skip not related to Activation property. return; } auto& imageProperty = std::get(attr->second); if (imageProperty.empty()) { // Skip, no image property return; } if (imageProperty == "xyz.openbmc_project.Software.Activation.Activations.Ready" && !isSoftwareUpdateInProgress()) { log("Software path interface add signal received"); // Set status to code update in progress. // Interface added signal triggered multiple times in code update path, // it's due to additional interfaces added by the software manager app // after the version interface is created. // Device tree data collection is required only for the first trigger setSoftwareUpdateProgress(true); // Colect device tree data openpower::phal::fwupdate::exportDevtree(); } return; } void exportDevtree() {} } // namespace fwupdate } // namespace phal } // namespace openpower