Remove version code
This code was moved to phosphor-bmc-code-mgmt in
https://gerrit.openbmc-project.xyz/#/c/3647/
Change-Id: I0d9ed8b02a1ac8b0e795bf75a7be432c2ed64036
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/.gitignore b/.gitignore
index ce77b9d..cf124c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,7 +40,6 @@
/config.h.in~
*.log
/config.status
-/openpower-version-host-software-manager
/openpower-update-manager
Makefile
.deps
diff --git a/Makefile.am b/Makefile.am
index f8ef52a..01dd6b8 100755
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,13 +3,8 @@
ACLOCAL_AMFLAGS = -Im4
sbin_PROGRAMS = \
- openpower-version-host-software-manager \
openpower-update-manager
-openpower_version_host_software_manager_SOURCES = \
- version_host_software_manager.cpp \
- version_host_software_manager_main.cpp
-
openpower_update_manager_SOURCES = \
activation.cpp \
item_updater.cpp \
@@ -26,8 +21,6 @@
$(SDBUSPLUS_LIBS) \
$(PHOSPHOR_LOGGING_LIBS)
-openpower_version_host_software_manager_CXXFLAGS = $(generic_cxxflags)
-openpower_version_host_software_manager_LDFLAGS = $(generic_ldflags)
openpower_update_manager_CXXFLAGS = $(generic_cxxflags)
openpower_update_manager_LDFLAGS = $(generic_ldflags)
diff --git a/configure.ac b/configure.ac
index c0ba7b4..cbbebef 100755
--- a/configure.ac
+++ b/configure.ac
@@ -48,11 +48,6 @@
AX_CXX_COMPILE_STDCXX_14([noext])
AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
-AC_ARG_VAR(VERSION_BUSNAME, [The Dbus busname to own])
-AS_IF([test "x$VERSION_BUSNAME" == "x"],
- [VERSION_BUSNAME="org.open_power.Software.Host.Version"])
-AC_DEFINE_UNQUOTED([VERSION_BUSNAME], ["$VERSION_BUSNAME"], [The DBus busname to own])
-
AC_ARG_VAR(SOFTWARE_OBJPATH, [The software manager Dbus root])
AS_IF([test "x$SOFTWARE_OBJPATH" == "x"], [SOFTWARE_OBJPATH="/xyz/openbmc_project/software"])
AC_DEFINE_UNQUOTED([SOFTWARE_OBJPATH], ["$SOFTWARE_OBJPATH"], [The software manager Dbus root])
diff --git a/version_host_software_manager.cpp b/version_host_software_manager.cpp
deleted file mode 100644
index 6b392d4..0000000
--- a/version_host_software_manager.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-#include <iostream>
-#include <string>
-#include <sstream>
-#include <fstream>
-#include <stdexcept>
-#include <phosphor-logging/log.hpp>
-#include "version_host_software_manager.hpp"
-
-namespace openpower
-{
-namespace software
-{
-namespace manager
-{
-
-using namespace phosphor::logging;
-
-std::string Version::getVersion(const std::string& manifestFilePath)
-{
- constexpr auto versionKey = "version=";
- constexpr auto versionKeySize = strlen(versionKey);
-
- if (manifestFilePath.empty())
- {
- log<level::ERR>("Error MANIFESTFilePath is empty");
- throw std::runtime_error("MANIFESTFilePath is empty");
- }
-
- std::string version{};
- std::ifstream efile;
- std::string line;
- efile.exceptions(std::ifstream::failbit
- | std::ifstream::badbit
- | std::ifstream::eofbit);
-
- // Too many GCC bugs (53984, 66145) to do this the right way...
- try
- {
- efile.open(manifestFilePath);
- while (getline(efile, line))
- {
- if (line.compare(0, versionKeySize, versionKey) == 0)
- {
- version = line.substr(versionKeySize);
- break;
- }
- }
- efile.close();
- }
- catch (const std::exception& e)
- {
- log<level::ERR>("Error in reading Host MANIFEST file");
- }
-
- return version;
-}
-
-std::string Version::getId(const std::string& version)
-{
- std::stringstream hexId;
-
- if (version.empty())
- {
- log<level::ERR>("Error Host version is empty");
- throw std::runtime_error("Host version is empty");
- }
-
- // Only want 8 hex digits.
- hexId << std::hex << ((std::hash<std::string> {}(
- version)) & 0xFFFFFFFF);
- return hexId.str();
-}
-
-} // namespace manager
-} // namespace software
-} // namepsace openpower
-
diff --git a/version_host_software_manager.hpp b/version_host_software_manager.hpp
deleted file mode 100755
index 74db7be..0000000
--- a/version_host_software_manager.hpp
+++ /dev/null
@@ -1,61 +0,0 @@
-#pragma once
-
-#include <sdbusplus/bus.hpp>
-#include "xyz/openbmc_project/Software/Version/server.hpp"
-
-namespace openpower
-{
-namespace software
-{
-namespace manager
-{
-
-using VersionInherit = sdbusplus::server::object::object<
- sdbusplus::xyz::openbmc_project::Software::server::Version>;
-
-/** @class Version
- * @brief OpenBMC version software management implementation.
- * @details A concrete implementation for xyz.openbmc_project.Software.Version
- * DBus API.
- */
-class Version : public VersionInherit
-{
- public:
- /** @brief Constructs Version Software Manager
- *
- * @param[in] bus - The Dbus bus object
- * @param[in] objPath - The Dbus object path
- * @param[in] versionId - The Host version identifier
- */
- Version(sdbusplus::bus::bus& bus,
- const std::string& objPath,
- const std::string& versionId) : VersionInherit(
- bus, (objPath).c_str(), true)
- {
- // Set properties.
- purpose(VersionPurpose::Host);
- version(versionId);
-
- // Emit deferred signal.
- emit_object_added();
- }
-
- /**
- * @brief Get the code version identifier.
- *
- * @return The version identifier.
- **/
- static std::string getVersion(const std::string& manifestFilePath);
-
- /**
- * @brief Get the Host Version id.
- *
- * @return The id.
- **/
- static std::string getId(const std::string& version);
-};
-
-} // namespace manager
-} // namespace software
-} // namespace openpower
-
diff --git a/version_host_software_manager_main.cpp b/version_host_software_manager_main.cpp
deleted file mode 100644
index 9db6b02..0000000
--- a/version_host_software_manager_main.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <sdbusplus/bus.hpp>
-#include <string>
-#include "config.h"
-#include "version_host_software_manager.hpp"
-
-int main(int argc, char* argv[])
-{
- auto bus = sdbusplus::bus::new_default();
-
- // Add sdbusplus ObjectManager.
- sdbusplus::server::manager::manager objManager(bus,
- SOFTWARE_OBJPATH);
-
- auto version = openpower::software::manager::Version::getVersion(MANIFEST_FILE);
- auto id = openpower::software::manager::Version::getId(version);
-
- openpower::software::manager::Version manager(bus,
- std::string{SOFTWARE_OBJPATH} + '/' + id, version);
-
- bus.request_name(VERSION_BUSNAME);
-
- while (true)
- {
- bus.process_discard();
- bus.wait();
- }
- return 0;
-}