diff options
-rwxr-xr-x | Makefile.am | 20 | ||||
-rwxr-xr-x | bootstrap.sh | 18 | ||||
-rw-r--r-- | configure.ac | 35 | ||||
-rw-r--r-- | dump_entry.cpp | 18 | ||||
-rw-r--r-- | dump_entry.hpp | 49 | ||||
-rw-r--r-- | dump_manager_main.cpp | 21 |
6 files changed, 161 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am new file mode 100755 index 0000000..212a10f --- /dev/null +++ b/Makefile.am @@ -0,0 +1,20 @@ +AM_DEFAULT_SOURCE_EXT = .cpp + +# Build these headers, don't install them +noinst_HEADERS = \ + dump_entry.hpp + +sbin_PROGRAMS = \ + phosphor-dump-manager + +phosphor_dump_manager_SOURCES = \ + dump_manager_main.cpp \ + dump_entry.cpp + +phosphor_dump_manager_CXXFLAGS = \ + $(PHOSPHOR_DBUS_INTERFACES_CFLAGS) \ + $(SDBUSPLUS_CFLAGS) + +phosphor_dump_manager_LDADD = \ + $(PHOSPHOR_DBUS_INTERFACES_LIBS) \ + $(SDBUSPLUS_LIBS) diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 0000000..f861496 --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,18 @@ +#!/bin/sh -xe + +AUTOCONF_FILES="Makefile.in aclocal.m4 ar-lib autom4te.cache compile \ + config.guess config.h.in config.sub configure depcomp install-sh \ + ltmain.sh missing *libtool test-driver" + +case $1 in + clean) + test -f Makefile && make maintainer-clean + for file in ${AUTOCONF_FILES}; do + find -name "$file" | xargs -r rm -rf + done + exit 0 + ;; +esac + +autoreconf -i +echo 'Run "./configure ${CONFIGURE_FLAGS} && make"' diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..4082293 --- /dev/null +++ b/configure.ac @@ -0,0 +1,35 @@ +AC_PREREQ([2.69]) +AC_INIT([phosphor-debug-collector], [1.0], [https://github.com/openbmc/phosphor-debug-collector/issues]) +AC_LANG([C++]) +AC_CONFIG_HEADERS([config.h]) +AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) +AM_SILENT_RULES([yes]) + +# Checks for programs +AC_PROG_CXX +AC_PROG_INSTALL #Checks/sets the install variable to be used +AC_PROG_MAKE_SET + +# Check for libraries +PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\ + AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."])) +PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, + AC_MSG_ERROR(["Requires sdbusplus package."])) + +# Checks for library functions +LT_INIT # Required for systemd linking + +# Checks for typedefs, structures, and compiler characteristics. +AX_CXX_COMPILE_STDCXX_14([noext]) +AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) + +AC_ARG_VAR(DUMP_BUSNAME, [The Dbus busname to own]) +AS_IF([test "x$DUMP_BUSNAME" == "x"], [DUMP_BUSNAME="xyz.openbmc_project.Dump"]) +AC_DEFINE_UNQUOTED([DUMP_BUSNAME], ["$DUMP_BUSNAME"], [The DBus busname to own]) + +AC_ARG_VAR(DUMP_OBJPATH, [The Dump manager Dbus root]) +AS_IF([test "x$DUMP_OBJPATH" == "x"], [DUMP_OBJPATH="/xyz/openbmc_project/dump"]) +AC_DEFINE_UNQUOTED([DUMP_OBJPATH], ["$DUMP_OBJPATH"], [The dump manager Dbus root]) + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/dump_entry.cpp b/dump_entry.cpp new file mode 100644 index 0000000..75c1358 --- /dev/null +++ b/dump_entry.cpp @@ -0,0 +1,18 @@ +#include "dump_entry.hpp" + +namespace phosphor +{ +namespace dump +{ + +Entry::Entry(sdbusplus::bus::bus& bus, const char* obj): EntryIfaces(bus, obj) +{ +} + + +void Entry::delete_() +{ +} + +} // namespace dump +} // namepsace phosphor diff --git a/dump_entry.hpp b/dump_entry.hpp new file mode 100644 index 0000000..d276f0d --- /dev/null +++ b/dump_entry.hpp @@ -0,0 +1,49 @@ +#pragma once + +#include <sdbusplus/server/object.hpp> +#include "xyz/openbmc_project/Dump/Entry/server.hpp" +#include "xyz/openbmc_project/Object/Delete/server.hpp" +#include "xyz/openbmc_project/Time/EpochTime/server.hpp" + +namespace phosphor +{ +namespace dump +{ + +template <typename T> +using ServerObject = typename sdbusplus::server::object::object<T>; + +using EntryIfaces = sdbusplus::server::object::object< + sdbusplus::xyz::openbmc_project::Dump::server::Entry, + sdbusplus::xyz::openbmc_project::Object::server::Delete, + sdbusplus::xyz::openbmc_project::Time::server::EpochTime>; + +/** @class Entry + * @brief OpenBMC Dump Entry implementation. + * @details A concrete implementation for the + * xyz.openbmc_project.Dump.Entry DBus API + */ +class Entry : public EntryIfaces +{ + public: + Entry() = delete; + Entry(const Entry&) = delete; + Entry& operator=(const Entry&) = delete; + Entry(Entry&&) = delete; + Entry& operator=(Entry&&) = delete; + virtual ~Entry() = default; + + /** @brief Constructor for the Dump Entry Object + * @param[in] bus - Bus to attach to. + * @param[in] obj - Object path to attach to + */ + Entry(sdbusplus::bus::bus& bus, const char* obj); + + /** @brief Delete this d-bus object. + */ + void delete_() override ; + +}; + +} // namespace dump +} // namespace phosphor diff --git a/dump_manager_main.cpp b/dump_manager_main.cpp new file mode 100644 index 0000000..39398e7 --- /dev/null +++ b/dump_manager_main.cpp @@ -0,0 +1,21 @@ +#include <sdbusplus/bus.hpp> +#include <sdbusplus/server/manager.hpp> +#include "config.h" + +int main(int argc, char *argv[]) +{ + auto bus = sdbusplus::bus::new_default(); + + // Add sdbusplus ObjectManager for the 'root' path of the DUMP manager. + sdbusplus::server::manager::manager objManager(bus, DUMP_OBJPATH); + + bus.request_name(DUMP_BUSNAME); + + while(true) + { + bus.process_discard(); + bus.wait(); + } + + return 0; +} |