phosphor-mapper: Add service namespaces

The c++ mapper implements a dbus service namespace whitelist instead of
a path namespace whitelist.  A service namespace whitelist significantly
reduces the amount of introspection required by the mapper as compared
to path namespaces.

Add the service namespace whitelist to the mapper command line in the
mapper systemd unit and extend the existing framework for specifying
mapper command line arguments to include a service namespace whitelist.

Note that support for a _service_ blacklist is added and _path_ and
_interface_ blacklists are not being re-introduced.

Change-Id: Ia4636d338af2f87c7bc2a5041bcb685bca895060
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/classes/phosphor-mapper.bbclass b/classes/phosphor-mapper.bbclass
index 7bafecb..97da850 100644
--- a/classes/phosphor-mapper.bbclass
+++ b/classes/phosphor-mapper.bbclass
@@ -7,17 +7,23 @@
 # interfaces it will keep track of.
 #
 # The Phosphor layer by default configures the mapper to
-# watch xyz.openbmc_project interfaces and paths only.  This
-# configuration file is intended to be inherited by
-# native recipes in other layers that wish to add namespaces
+# watch xyz.openbmc_project services, interfaces and paths
+# only.  This configuration file is intended to be inherited
+# by native recipes in other layers that wish to add namespaces
 # or interfaces to the mapper watchlist.
 
 # Add path namespaces to be monitored:
 # PHOSPHOR_MAPPER_NAMESPACE_append = " /foo/bar"
 
+# Add service namespaces to be monitored:
+# PHOSPHOR_MAPPER_SERVICE_append = " foo.bar"
+
 # Add interfaces to be monitored:
 # PHOSPHOR_MAPPER_INTERFACE_append = " foo.bar"
 
+# Blacklist services from being monitored:
+# PHOSPHOR_MAPPER_SERVICE_BLACKLIST_append = " foo.bar"
+
 inherit phosphor-mapperdir
 inherit obmc-phosphor-utils
 
@@ -34,9 +40,13 @@
                 pass
 
     process_var(d, 'PHOSPHOR_MAPPER_NAMESPACE', 'namespace_dir')
+    process_var(d, 'PHOSPHOR_MAPPER_SERVICE', 'service_dir')
     process_var(d, 'PHOSPHOR_MAPPER_INTERFACE', 'interface_dir')
+    process_var(d, 'PHOSPHOR_MAPPER_SERVICE_BLACKLIST', 'serviceblacklist_dir')
 }
 
 do_install[vardeps] += "PHOSPHOR_MAPPER_NAMESPACE"
+do_install[vardeps] += "PHOSPHOR_MAPPER_SERVICE"
 do_install[vardeps] += "PHOSPHOR_MAPPER_INTERFACE"
+do_install[vardeps] += "PHOSPHOR_MAPPER_SERVICE_BLACKLIST"
 do_install[postfuncs] += "phosphor_mapper_do_postinst"