summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Kosenkov <NKosenkov@IBS.RU>2022-09-22 12:04:27 +0300
committerNikita Kosenkov <NKosenkov@IBS.RU>2022-09-22 12:04:27 +0300
commit20c98fe3cdc88a518c8375149076bfaf751f14a3 (patch)
treec3883b1128ec43e5a7a92cee16c3fb9263f83d25
parentf0cf8c6502475a5c0b9f851aeeaea76fb0cfad4e (diff)
downloadopenbmc-20c98fe3cdc88a518c8375149076bfaf751f14a3.tar.xz
Revert "phosphor-ipmi-host: Added set and save BIOS version"
This reverts commit f0cf8c6502475a5c0b9f851aeeaea76fb0cfad4e.
-rw-r--r--meta-ibs/meta-cp2-5422/recipes-phosphor/flash/phosphor-software-manager/0002-Added-reading-BIOS-version-from-file.patch97
-rw-r--r--meta-ibs/meta-cp2-5422/recipes-phosphor/flash/phosphor-software-manager_%.bbappend1
-rw-r--r--meta-ibs/meta-cp2-5422/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Add-set-BIOS-version-support.patch82
-rw-r--r--meta-ibs/meta-cp2-5422/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend11
4 files changed, 0 insertions, 191 deletions
diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/flash/phosphor-software-manager/0002-Added-reading-BIOS-version-from-file.patch b/meta-ibs/meta-cp2-5422/recipes-phosphor/flash/phosphor-software-manager/0002-Added-reading-BIOS-version-from-file.patch
deleted file mode 100644
index e1a395565b..0000000000
--- a/meta-ibs/meta-cp2-5422/recipes-phosphor/flash/phosphor-software-manager/0002-Added-reading-BIOS-version-from-file.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From ef7f6eb7107c2c7116ddc20de8d251d6a55db75f Mon Sep 17 00:00:00 2001
-From: Nikita Kosenkov <NKosenkov@IBS.RU>
-Date: Thu, 22 Sep 2022 11:46:44 +0300
-Subject: [PATCH] Added reading BIOS version from file
-
----
- item_updater.cpp | 9 ++++++++-
- version.cpp | 11 +++++++++--
- version.hpp | 10 ++++++++++
- 3 files changed, 27 insertions(+), 3 deletions(-)
-
-diff --git a/item_updater.cpp b/item_updater.cpp
-index 96782f2..48fb698 100644
---- a/item_updater.cpp
-+++ b/item_updater.cpp
-@@ -849,7 +849,6 @@ void ItemUpdater::createBIOSObject()
- createFunctionalAssociation(path);
-
- auto versionId = path.substr(pos + 1);
-- auto version = "null";
- AssociationList assocs = {};
- biosActivation = std::make_unique<Activation>(
- bus, path, *this, versionId, server::Activation::Activations::Active,
-@@ -857,6 +856,14 @@ void ItemUpdater::createBIOSObject()
- auto dummyErase = [](std::string /*entryId*/) {
- // Do nothing;
- };
-+
-+ auto version = VersionClass::getVersion(
-+ "/var/lib/phosphor-bmc-code-mgmt/bios-release");
-+ if(version.empty())
-+ {
-+ version = "null";
-+ }
-+
- biosVersion = std::make_unique<VersionClass>(
- bus, path, version, VersionPurpose::Host, "", "",
- std::vector<std::string>(),
-diff --git a/version.cpp b/version.cpp
-index 847148e..523a855 100644
---- a/version.cpp
-+++ b/version.cpp
-@@ -179,14 +179,14 @@ std::string Version::getBMCExtendedVersion(const std::string& releaseFilePath)
- return extendedVersion;
- }
-
--std::string Version::getBMCVersion(const std::string& releaseFilePath)
-+std::string Version::getVersion(const std::string& versionFilePath)
- {
- std::string versionKey = "VERSION_ID=";
- std::string versionValue{};
- std::string version{};
- std::ifstream efile;
- std::string line;
-- efile.open(releaseFilePath);
-+ efile.open(versionFilePath);
-
- while (getline(efile, line))
- {
-@@ -216,6 +216,13 @@ std::string Version::getBMCVersion(const std::string& releaseFilePath)
- }
- efile.close();
-
-+ return version;
-+}
-+
-+std::string Version::getBMCVersion(const std::string& releaseFilePath)
-+{
-+ auto version = getVersion(releaseFilePath);
-+
- if (version.empty())
- {
- error("BMC current version is empty");
-diff --git a/version.hpp b/version.hpp
-index 5c74f99..e8956fa 100644
---- a/version.hpp
-+++ b/version.hpp
-@@ -150,6 +150,16 @@ class Version : public VersionInherit
- static std::string
- getBMCExtendedVersion(const std::string& releaseFilePath);
-
-+ /**
-+ * @brief Get the active VERSION_ID string.
-+ *
-+ * @param[in] releaseFilePath - The path to the file which contains
-+ * the release version string.
-+ *
-+ * @return The version string (e.g. v1.99.10-19).
-+ */
-+ static std::string getVersion(const std::string& versionFilePath);
-+
- /**
- * @brief Get the active BMC version string.
- *
---
-2.35.1
-
diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/flash/phosphor-software-manager_%.bbappend b/meta-ibs/meta-cp2-5422/recipes-phosphor/flash/phosphor-software-manager_%.bbappend
index 60cad71b43..aedba88044 100644
--- a/meta-ibs/meta-cp2-5422/recipes-phosphor/flash/phosphor-software-manager_%.bbappend
+++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/flash/phosphor-software-manager_%.bbappend
@@ -5,7 +5,6 @@ PACKAGECONFIG:append = " verify_signature flash_bios"
SRC_URI:append = " \
file://gen-bios-tarball \
file://0001-IBS-Use-usr-bin-flash-bios-tool-for-BIOS-update.patch \
- file://0002-Added-reading-BIOS-version-from-file.patch \
"
EXTRA_OEMESON += "\
diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Add-set-BIOS-version-support.patch b/meta-ibs/meta-cp2-5422/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Add-set-BIOS-version-support.patch
deleted file mode 100644
index 1911dc6199..0000000000
--- a/meta-ibs/meta-cp2-5422/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Add-set-BIOS-version-support.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From 1ff24df3b9517f1f28ff282e7230b4ef82b89e78 Mon Sep 17 00:00:00 2001
-From: Brian Ma <chma0@nuvoton.com>
-Date: Fri, 13 May 2022 10:30:14 +0800
-Subject: [PATCH] Add set BIOS version support
-
----
- apphandler.cpp | 45 +++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 45 insertions(+)
-
-diff --git a/apphandler.cpp b/apphandler.cpp
-index 0577c07..615c329 100644
---- a/apphandler.cpp
-+++ b/apphandler.cpp
-@@ -50,6 +50,8 @@ static constexpr auto versionIntf = "xyz.openbmc_project.Software.Version";
- static constexpr auto activationIntf =
- "xyz.openbmc_project.Software.Activation";
- static constexpr auto softwareRoot = "/xyz/openbmc_project/software";
-+static constexpr auto biosObjPath = "/xyz/openbmc_project/software/bios_active";
-+static constexpr auto biosFile = "/var/lib/phosphor-bmc-code-mgmt/bios-release";
-
- void register_netfn_app_functions() __attribute__((constructor));
-
-@@ -1366,6 +1368,46 @@ ipmi::RspType<uint8_t, // Parameter revision
- return ipmi::responseSuccess(paramRevision, setSelector, configData);
- }
-
-+void handleFirmwareVersion(uint8_t paramSelector, std::string version){
-+ // only handle FW version
-+ if (paramSelector != IPMI_SYSINFO_SYSTEM_FW_VERSION)
-+ {
-+ return;
-+ }
-+ sdbusplus::bus::bus bus{ipmid_get_sd_bus_connection()};
-+
-+ log<level::INFO>(("ipmid get BIOS version:" + version).c_str());
-+
-+ // update host version to software manager
-+ std::string service;
-+ try
-+ {
-+ service = ipmi::getService(bus, versionIntf, biosObjPath);
-+ ipmi::setDbusProperty(bus, service, biosObjPath, versionIntf,
-+ "Version", version);
-+ }
-+ catch (const std::runtime_error& e)
-+ {
-+ log<level::ERR>("Cannot get service for update version",
-+ entry("ERROR=%s", e.what()),
-+ entry("INTERFACE=%s", versionIntf));
-+ }
-+ catch (sdbusplus::exception::SdBusError& e)
-+ {
-+ log<level::ERR>("sdbusplus exception - Unable to update BIOS version",
-+ entry("ERROR=%s", e.what()),
-+ entry("INTERFACE=%s", versionIntf),
-+ entry("SERVICE=%s", service.c_str()));
-+ }
-+ // write version file to storage
-+ log<level::DEBUG>("write BIOS version file.");
-+ std::ofstream myfile(biosFile, std::ofstream::out);
-+ std::string ver = "VERSION_ID=\"" + version + "\"";
-+ myfile << ver << std::endl;
-+ myfile.close();
-+}
-+
-+
- ipmi::RspType<> ipmiAppSetSystemInfo(uint8_t paramSelector, uint8_t data1,
- std::vector<uint8_t> configData)
- {
-@@ -1455,6 +1497,9 @@ ipmi::RspType<> ipmiAppSetSystemInfo(uint8_t paramSelector, uint8_t data1,
- std::copy_n(configData.begin(), count, paramString.begin() + offset);
- }
- sysInfoParamStore->update(paramSelector, paramString);
-+
-+ // update BIOS version
-+ handleFirmwareVersion(paramSelector, paramString);
- return ipmi::responseSuccess();
- }
-
---
-2.17.1
-
diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend b/meta-ibs/meta-cp2-5422/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend
deleted file mode 100644
index 3fb847f145..0000000000
--- a/meta-ibs/meta-cp2-5422/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend
+++ /dev/null
@@ -1,11 +0,0 @@
-FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
-
-SRC_URI:append = " \
- file://0001-Add-set-BIOS-version-support.patch \
- "
-
-do_install:append:ibs(){
- install -d ${D}${includedir}/phosphor-ipmi-host
- install -m 0644 -D ${S}/sensorhandler.hpp ${D}${includedir}/phosphor-ipmi-host
- install -m 0644 -D ${S}/selutility.hpp ${D}${includedir}/phosphor-ipmi-host
-}