summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2019-02-12 19:47:51 -0800
committerWilliam A. Kennington III <wak@google.com>2019-03-12 12:51:58 -0700
commit5f1eb46840818b0b9545ddd2ebd5ac709bb9d57a (patch)
treed5387fcc7dd11492a80a347f36e27b7a6675de81
parent483e777fd4161ba063ac67a8114429c9b2078352 (diff)
downloadphosphor-networkd-5f1eb46840818b0b9545ddd2ebd5ac709bb9d57a.tar.gz
phosphor-networkd-5f1eb46840818b0b9545ddd2ebd5ac709bb9d57a.zip
configure: Cleanup dbus variables
These are realistically not configurable by the end user and could be provided as a runtime configuration if needed so that custom networkd binaries are not needed for each different busname. Configure variable substitution was kept to ensure the value is consistent between all of the source files. Change-Id: Ic6d50a80b48e2cfc07e48067089236010894e71b Signed-off-by: William A. Kennington III <wak@google.com>
-rw-r--r--configure.ac10
-rw-r--r--network_manager_main.cpp8
-rw-r--r--xyz.openbmc_project.Network.conf.in4
-rw-r--r--xyz.openbmc_project.Network.service.in2
4 files changed, 11 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac
index f8c2ef8..a6cdc3d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -105,13 +105,9 @@ if test "x$enable_link_local_autoconfiguration" = "xyes"; then
AC_DEFINE([LINK_LOCAL_AUTOCONFIGURATION], [1], [Enable link-local IP address autoconfiguration])
fi
-AC_ARG_VAR(BUSNAME_NETWORK, [The Dbus busname to own])
-AS_IF([test "x$BUSNAME_NETWORK" == "x"], [BUSNAME_NETWORK="xyz.openbmc_project.Network"])
-AC_DEFINE_UNQUOTED([BUSNAME_NETWORK], ["$BUSNAME_NETWORK"], [The DBus busname to own])
-
-AC_ARG_VAR(OBJ_NETWORK, [The network manager DBus object path])
-AS_IF([test "x$OBJ_NETWORK" == "x"], [OBJ_NETWORK="/xyz/openbmc_project/network"])
-AC_DEFINE_UNQUOTED([OBJ_NETWORK], ["$OBJ_NETWORK"], [The network manager DBus object path])
+DEFAULT_BUSNAME='xyz.openbmc_project.Network'
+AC_DEFINE_UNQUOTED([DEFAULT_BUSNAME], ["$DEFAULT_BUSNAME"], [The DBus busname to own])
+AC_SUBST(DEFAULT_BUSNAME, ["$DEFAULT_BUSNAME"])
AC_ARG_VAR(SYSTEMD_TARGET, "Target for starting this service")
AS_IF([test "x$SYSTEMD_TARGET" == "x"], [SYSTEMD_TARGET="multi-user.target"])
diff --git a/network_manager_main.cpp b/network_manager_main.cpp
index 3dcefe5..1b85bfa 100644
--- a/network_manager_main.cpp
+++ b/network_manager_main.cpp
@@ -26,6 +26,8 @@ using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
constexpr char NETWORK_STATE_FILE[] = "/run/systemd/netif/state";
constexpr char NETWORK_CONF_DIR[] = "/etc/systemd/network";
+constexpr char DEFAULT_OBJPATH[] = "/xyz/openbmc_project/network";
+
namespace phosphor
{
namespace network
@@ -101,11 +103,11 @@ int main(int argc, char* argv[])
bus.attach_event(eventPtr.get(), SD_EVENT_PRIORITY_NORMAL);
// Add sdbusplus Object Manager for the 'root' path of the network manager.
- sdbusplus::server::manager::manager objManager(bus, OBJ_NETWORK);
- bus.request_name(BUSNAME_NETWORK);
+ sdbusplus::server::manager::manager objManager(bus, DEFAULT_OBJPATH);
+ bus.request_name(DEFAULT_BUSNAME);
phosphor::network::manager = std::make_unique<phosphor::network::Manager>(
- bus, OBJ_NETWORK, NETWORK_CONF_DIR);
+ bus, DEFAULT_OBJPATH, NETWORK_CONF_DIR);
// create the default network files if the network file
// is not there for any interface.
diff --git a/xyz.openbmc_project.Network.conf.in b/xyz.openbmc_project.Network.conf.in
index a81f2b0..b34fe6c 100644
--- a/xyz.openbmc_project.Network.conf.in
+++ b/xyz.openbmc_project.Network.conf.in
@@ -2,7 +2,7 @@
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<policy user="root">
- <allow own="@BUSNAME_NETWORK@"/>
- <allow send_destination="@BUSNAME_NETWORK@"/>
+ <allow own="@DEFAULT_BUSNAME@"/>
+ <allow send_destination="@DEFAULT_BUSNAME@"/>
</policy>
</busconfig>
diff --git a/xyz.openbmc_project.Network.service.in b/xyz.openbmc_project.Network.service.in
index 65c57ce..a478462 100644
--- a/xyz.openbmc_project.Network.service.in
+++ b/xyz.openbmc_project.Network.service.in
@@ -7,7 +7,7 @@ ExecStart=/usr/bin/env phosphor-network-manager
SyslogIdentifier=phosphor-network-manager
Restart=always
Type=dbus
-BusName=@BUSNAME_NETWORK@
+BusName=@DEFAULT_BUSNAME@
RuntimeDirectory = network
RuntimeDirectoryPreserve = yes
StateDirectory = network
OpenPOWER on IntegriCloud