diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | bmc/Makefile.am | 7 | ||||
-rw-r--r-- | bmc/phosphor-ipmi-flash-bmc-prepare.target.in | 2 | ||||
-rw-r--r-- | bmc/phosphor-ipmi-flash-bmc-update.target.in | 2 | ||||
-rw-r--r-- | bmc/phosphor-ipmi-flash-bmc-verify.target.in | 2 | ||||
-rw-r--r-- | configure.ac | 46 |
7 files changed, 53 insertions, 13 deletions
@@ -48,6 +48,7 @@ test-driver test-suite.log # Custom generated files +*.target # Output binaries burn_my_bmc @@ -180,10 +180,10 @@ Variable | Default | Meaning `STATIC_HANDLER_STAGED_NAME` | `/run/initramfs/bmc-image` | The filename where to write the staged firmware image for static updates. `TARBALL_STAGED_NAME` | `/tmp/image-update.tar` | The filename where to write the UBI update tarball. `HASH_FILENAME` | `/tmp/bmc.sig` | The file to use for the hash provided. -`PREPARATION_DBUS_SERVICE` | `prepare_update.service` | The systemd service started when the host starts to send an update. +`PREPARATION_DBUS_SERVICE` | `phosphor-ipmi-flash-bmc-prepare.target` | The systemd service started when the host starts to send an update. `VERIFY_STATUS_FILENAME` | `/tmp/bmc.verify` | The file checked for the verification status. -`VERIFY_DBUS_SERVICE` | `verify_image.service` | The systemd service started for verification. -`UPDATE_DBUS_SERVICE` | `update_bmc.service` | The systemd service started for updating the BMC. +`VERIFY_DBUS_SERVICE` | `phosphor-ipmi-flash-bmc-verify.target` | The systemd service started for verification. +`UPDATE_DBUS_SERVICE` | `phosphor-ipmi-flash-bmc-update.target` | The systemd service started for updating the BMC. ## Flash State Machine Details diff --git a/bmc/Makefile.am b/bmc/Makefile.am index 7e03384..6378ffb 100644 --- a/bmc/Makefile.am +++ b/bmc/Makefile.am @@ -1,5 +1,12 @@ AM_DEFAULT_SOURCE_EXT = .cpp +if HAVE_SYSTEMD +systemdsystemunit_DATA = \ + phosphor-ipmi-flash-bmc-prepare.target \ + phosphor-ipmi-flash-bmc-verify.target \ + phosphor-ipmi-flash-bmc-update.target +endif + noinst_LTLIBRARIES = libfirmwareblob_common.la libfirmwareblob_common_la_SOURCES = \ firmware_handler.cpp \ diff --git a/bmc/phosphor-ipmi-flash-bmc-prepare.target.in b/bmc/phosphor-ipmi-flash-bmc-prepare.target.in new file mode 100644 index 0000000..7f0cbd9 --- /dev/null +++ b/bmc/phosphor-ipmi-flash-bmc-prepare.target.in @@ -0,0 +1,2 @@ +[Unit] +Description=Phosphor-ipmi-flash Prepare BMC to receive update diff --git a/bmc/phosphor-ipmi-flash-bmc-update.target.in b/bmc/phosphor-ipmi-flash-bmc-update.target.in new file mode 100644 index 0000000..a7335b0 --- /dev/null +++ b/bmc/phosphor-ipmi-flash-bmc-update.target.in @@ -0,0 +1,2 @@ +[Unit] +Description=Phosphor-ipmi-flash update the BMC image diff --git a/bmc/phosphor-ipmi-flash-bmc-verify.target.in b/bmc/phosphor-ipmi-flash-bmc-verify.target.in new file mode 100644 index 0000000..d45da94 --- /dev/null +++ b/bmc/phosphor-ipmi-flash-bmc-verify.target.in @@ -0,0 +1,2 @@ +[Unit] +Description=Phosphor-ipmi-flash verify the image contents diff --git a/configure.ac b/configure.ac index 2334814..e6a1a8b 100644 --- a/configure.ac +++ b/configure.ac @@ -44,7 +44,7 @@ AX_CXX_COMPILE_STDCXX_17([noext]) AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) # Checks for library functions. -LT_INIT # Required for systemd linking +LT_INIT # Enable building the host tool (default: yes) AC_ARG_ENABLE([build-host-tool], @@ -60,6 +60,8 @@ AM_CONDITIONAL([BUILD_BMC_HANDLER], [test "x$enable_build_bmc_blob_handler" != " # Build the BMC by default, so check if set to no. AS_IF([test "x$enable_build_bmc_blob_handler" != "xno"], [ + PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221]) + PKG_CHECK_MODULES( [SDBUSPLUS], [sdbusplus], @@ -74,6 +76,27 @@ AS_IF([test "x$enable_build_bmc_blob_handler" != "xno"], [ [], [AC_MSG_ERROR(["phosphor-ipmi-blobs required and not found."])] ) + + PKG_PROG_PKG_CONFIG + AC_ARG_WITH([systemdsystemunitdir], + [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])], + [], + [with_systemdsystemunitdir=auto] + ) + AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], + [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) + AS_IF([test "x$def_systemdsystemunitdir" = "x"], + [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"], + [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])] + ) + with_systemdsystemunitdir=no], + [with_systemdsystemunitdir="$def_systemdsystemunitdir"] + )] + ) + AS_IF([test "x$with_systemdsystemunitdir" != "xno"], + [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])] + ) + AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"]) ]) # If not building the host-tool, we're building the BMC. @@ -246,16 +269,16 @@ AC_DEFINE_UNQUOTED( AC_ARG_VAR( PREPARATION_DBUS_SERVICE, - [The systemd service started when the host starts to send an update.] + [The systemd target started when the host starts to send an update.] ) AS_IF( [test "x$PREPARATION_DBUS_SERVICE" == "x"], - [PREPARATION_DBUS_SERVICE="prepare_update.service"] + [PREPARATION_DBUS_SERVICE="phosphor-ipmi-flash-bmc-prepare.target"] ) AC_DEFINE_UNQUOTED( [PREPARATION_DBUS_SERVICE], ["$PREPARATION_DBUS_SERVICE"], - [The systemd service started when the host starts to send an update.] + [The systemd target started when the host starts to send an update.] ) AC_ARG_VAR( @@ -274,30 +297,30 @@ AC_DEFINE_UNQUOTED( AC_ARG_VAR( VERIFY_DBUS_SERVICE, - [The systemd service started for verification.] + [The systemd target started for verification.] ) AS_IF( [test "x$VERIFY_DBUS_SERVICE" == "x"], - [VERIFY_DBUS_SERVICE="verify_image.service"] + [VERIFY_DBUS_SERVICE="phosphor-ipmi-flash-bmc-verify.target"] ) AC_DEFINE_UNQUOTED( [VERIFY_DBUS_SERVICE], ["$VERIFY_DBUS_SERVICE"], - [The systemd service started for verification.] + [The systemd target started for verification.] ) AC_ARG_VAR( UPDATE_DBUS_SERVICE, - [The systemd service started for updating the BMC.] + [The systemd target started for updating the BMC.] ) AS_IF( [test "x$UPDATE_DBUS_SERVICE" == "x"], - [UPDATE_DBUS_SERVICE="update_bmc.service"] + [UPDATE_DBUS_SERVICE="phosphor-ipmi-flash-bmc-update.target"] ) AC_DEFINE_UNQUOTED( [UPDATE_DBUS_SERVICE], ["$UPDATE_DBUS_SERVICE"], - [The systemd service started for updating the BMC.] + [The systemd target started for updating the BMC.] ) AC_CHECK_HEADER(linux/ipmi.h, [HAVE_LINUX_IPMI_H=""], [HAVE_LINUX_IPMI_H="-I linux/ipmi.h"]) @@ -432,4 +455,7 @@ AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([bmc/Makefile bmc/test/Makefile]) AC_CONFIG_FILES([tools/Makefile tools/test/Makefile]) AC_CONFIG_FILES([cleanup/Makefile cleanup/test/Makefile]) +AC_CONFIG_FILES([bmc/phosphor-ipmi-flash-bmc-prepare.target]) +AC_CONFIG_FILES([bmc/phosphor-ipmi-flash-bmc-verify.target]) +AC_CONFIG_FILES([bmc/phosphor-ipmi-flash-bmc-update.target]) AC_OUTPUT |