From 042e47233150dbd8fe0a1bed47b47340ef4860b5 Mon Sep 17 00:00:00 2001 From: Patrick Venture Date: Mon, 7 Jan 2019 07:42:11 -0800 Subject: move service file, dbus conf into repo Move the service file for phosphor-networkd from the bitbake recipe to the source repository. Move the dbus configuration file for phosphor-network from a generated file to the source repository. Tested: Verified dbus conf and service file were installed where expected. Change-Id: Idd1a1872aeb020f6b0e2eb9dba7c2e96198be2af Signed-off-by: Patrick Venture --- Makefile.am | 8 ++++++++ configure.ac | 33 +++++++++++++++++++++++++++++++++ xyz.openbmc_project.Network.conf.in | 8 ++++++++ xyz.openbmc_project.Network.service.in | 16 ++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 xyz.openbmc_project.Network.conf.in create mode 100644 xyz.openbmc_project.Network.service.in diff --git a/Makefile.am b/Makefile.am index 43f4643..8e5c191 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,6 +3,14 @@ nobase_nodist_include_HEADERS = \ xyz/openbmc_project/Network/VLAN/Create/server.hpp \ xyz/openbmc_project/Network/IP/Create/server.hpp +if HAVE_SYSTEMD +systemdsystemunit_DATA = \ + xyz.openbmc_project.Network.service + +dbuspolicy_DATA = \ + xyz.openbmc_project.Network.conf +endif + sbin_PROGRAMS = phosphor-network-manager ncsi-netlink noinst_HEADERS = \ diff --git a/configure.ac b/configure.ac index 1bc24c7..14ed382 100644 --- a/configure.ac +++ b/configure.ac @@ -55,6 +55,34 @@ AX_APPEND_COMPILE_FLAGS([-Wall -Werror -Wno-unused-result], [CFLAGS]) # Checks for library functions. LT_INIT # Removes 'unrecognized options: --with-libtool-sysroot' +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"]) + +AC_ARG_WITH([dbuspolicydir], + AS_HELP_STRING([--with-dbuspolicydir=DIR], [Directory for D-Bus system policy files]) +) +AS_IF([test "x$with_dbuspolicydir" = "x"], + [with_dbuspolicydir="${sysconfdir}/dbus-1/system.d"] +) +AC_SUBST([dbuspolicydir], [$with_dbuspolicydir]) # Check/set gtest specific functions. AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-GTEST_HAS_PTHREAD=0"]) @@ -106,10 +134,15 @@ AC_ARG_VAR(NETWORK_CONF_DIR, [Network configuration directory]) AS_IF([test "x$NETWORK_CONF_DIR" == "x"], [NETWORK_CONF_DIR="/etc/systemd/network"]) AC_DEFINE_UNQUOTED([NETWORK_CONF_DIR], ["$NETWORK_CONF_DIR"], [Network configuration directory]) +AC_ARG_VAR(SYSTEMD_TARGET, "Target for starting this service") +AS_IF([test "x$SYSTEMD_TARGET" == "x"], [SYSTEMD_TARGET="multi-user.target"]) + AC_DEFINE(SYSTEMD_BUSNAME, "org.freedesktop.systemd1", [systemd busname.]) AC_DEFINE(SYSTEMD_PATH, "/org/freedesktop/systemd1", [systemd path.]) AC_DEFINE(SYSTEMD_INTERFACE, "org.freedesktop.systemd1.Manager", [systemd interface.]) # Create configured output. AC_CONFIG_FILES([Makefile test/Makefile]) +AC_CONFIG_FILES([xyz.openbmc_project.Network.service]) +AC_CONFIG_FILES([xyz.openbmc_project.Network.conf]) AC_OUTPUT diff --git a/xyz.openbmc_project.Network.conf.in b/xyz.openbmc_project.Network.conf.in new file mode 100644 index 0000000..a81f2b0 --- /dev/null +++ b/xyz.openbmc_project.Network.conf.in @@ -0,0 +1,8 @@ + + + + + + + diff --git a/xyz.openbmc_project.Network.service.in b/xyz.openbmc_project.Network.service.in new file mode 100644 index 0000000..65c57ce --- /dev/null +++ b/xyz.openbmc_project.Network.service.in @@ -0,0 +1,16 @@ +[Unit] +Description=Phosphor Network Manager +After=obmc-mapper.target + +[Service] +ExecStart=/usr/bin/env phosphor-network-manager +SyslogIdentifier=phosphor-network-manager +Restart=always +Type=dbus +BusName=@BUSNAME_NETWORK@ +RuntimeDirectory = network +RuntimeDirectoryPreserve = yes +StateDirectory = network + +[Install] +WantedBy=@SYSTEMD_TARGET@ -- cgit v1.2.1