Merge pull request #463 from bradbishop/systemd

classes-systemd: bug fix and best practices.
diff --git a/classes/config-in-skeleton.bbclass b/classes/config-in-skeleton.bbclass
index 72249ff..907f226 100644
--- a/classes/config-in-skeleton.bbclass
+++ b/classes/config-in-skeleton.bbclass
@@ -4,9 +4,13 @@
 inherit allarch
 inherit setuptools
 inherit pythonnative
+inherit skeleton-rev
+inherit obmc-phosphor-license
+
+HOMEPAGE = "http://github.com/openbmc/skeleton"
 
 DEPENDS += "python"
-SRC_URI += "git://github.com/openbmc/skeleton;subpath=configs"
+SRC_URI += "${SKELETON_URI};subpath=configs"
 S = "${WORKDIR}/configs"
 
 python() {
diff --git a/classes/obmc-phosphor-utils.bbclass b/classes/obmc-phosphor-utils.bbclass
index 4f55629..44ca7ad 100644
--- a/classes/obmc-phosphor-utils.bbclass
+++ b/classes/obmc-phosphor-utils.bbclass
@@ -2,13 +2,16 @@
 
 inherit utils
 
+
 def df_enabled(feature, value, d):
-        return base_contains("DISTRO_FEATURES", feature, value, "", d)
+    return base_contains("DISTRO_FEATURES", feature, value, "", d)
+
 
 def mf_enabled(feature, value, d):
-        return base_contains("MACHINE_FEATURES", feature, value, "", d)
+    return base_contains("MACHINE_FEATURES", feature, value, "", d)
+
 
 def cf_enabled(feature, value, d):
-        return value if df_enabled(feature, value, d) \
-                and mf_enabled(feature, value, d) \
-                        else ""
+    return value if df_enabled(feature, value, d) \
+        and mf_enabled(feature, value, d) \
+            else ""
diff --git a/classes/skeleton-rev.bbclass b/classes/skeleton-rev.bbclass
new file mode 100644
index 0000000..93544de
--- /dev/null
+++ b/classes/skeleton-rev.bbclass
@@ -0,0 +1,2 @@
+SRCREV ?= "b4140b888f586c98c5d03893166c5074a98cf951"
+SKELETON_URI ?= "git://github.com/openbmc/skeleton"
diff --git a/classes/skeleton.bbclass b/classes/skeleton.bbclass
index 3faaa15..1f67333 100644
--- a/classes/skeleton.bbclass
+++ b/classes/skeleton.bbclass
@@ -1,7 +1,7 @@
 inherit obmc-phosphor-license
+inherit skeleton-rev
 
 HOMEPAGE = "http://github.com/openbmc/skeleton"
 
-SRCREV ??= "1bbc820f2b595b7a674e52bee1775c877b35b61e"
-SRC_URI += "git://github.com/openbmc/skeleton"
+SRC_URI += "${SKELETON_URI}"
 S = "${WORKDIR}/git/${SKELETON_DIR}"
diff --git a/common/recipes-phosphor/host-ipmid/host-ipmid.bb b/common/recipes-phosphor/host-ipmid/host-ipmid.bb
index 2a761de..a891df6 100644
--- a/common/recipes-phosphor/host-ipmid/host-ipmid.bb
+++ b/common/recipes-phosphor/host-ipmid/host-ipmid.bb
@@ -19,7 +19,7 @@
 RDEPENDS_${PN} += "network"
 SRC_URI += "git://github.com/openbmc/phosphor-host-ipmid"
 
-SRCREV = "b7bcda57ee39616e8937194d281e2476e6ea8df2"
+SRCREV = "87e080b537aff3fd22ec56ef72660937bed38422"
 
 S = "${WORKDIR}/git"
 INSTALL_NAME = "ipmid"
diff --git a/common/recipes-phosphor/obmc-phosphor-example-pydbus/files/obmc-phosphor-example-pydbus.py b/common/recipes-phosphor/obmc-phosphor-example-pydbus/files/obmc-phosphor-example-pydbus.py
index 2b59b58..1f4ce90 100644
--- a/common/recipes-phosphor/obmc-phosphor-example-pydbus/files/obmc-phosphor-example-pydbus.py
+++ b/common/recipes-phosphor/obmc-phosphor-example-pydbus/files/obmc-phosphor-example-pydbus.py
@@ -86,8 +86,7 @@
 	bus = dbus.SystemBus()
 
 	services = []
-	services.append(dbus.service.BusName(SERVICE_PREFIX + '.PythonService0', bus))
-	services.append(dbus.service.BusName(SERVICE_PREFIX + '.PythonService1', bus))
+	services.append(dbus.service.BusName(SERVICE_PREFIX + '.PythonService', bus))
 
 	objs = []
 	objs.append(SampleObjectOne(bus, BASE_OBJ_PATH + 'path0/PythonObj'))
diff --git a/common/recipes-phosphor/obmc-phosphor-example-sdbus/files/org.openbmc.examples.SDBusService0.conf b/common/recipes-phosphor/obmc-phosphor-example-pydbus/files/org.openbmc.examples.PythonService.conf
similarity index 63%
rename from common/recipes-phosphor/obmc-phosphor-example-sdbus/files/org.openbmc.examples.SDBusService0.conf
rename to common/recipes-phosphor/obmc-phosphor-example-pydbus/files/org.openbmc.examples.PythonService.conf
index 45af4f4..6c4a713 100644
--- a/common/recipes-phosphor/obmc-phosphor-example-sdbus/files/org.openbmc.examples.SDBusService0.conf
+++ b/common/recipes-phosphor/obmc-phosphor-example-pydbus/files/org.openbmc.examples.PythonService.conf
@@ -2,7 +2,7 @@
  "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
 <busconfig>
   <policy user="root">
-    <allow own="org.openbmc.examples.SDBusService0"/>
-    <allow send_destination="org.openbmc.examples.SDBusService0"/>
+    <allow own="org.openbmc.examples.PythonService"/>
+    <allow send_destination="org.openbmc.examples.PythonService"/>
   </policy>
 </busconfig>
diff --git a/common/recipes-phosphor/obmc-phosphor-example-pydbus/files/org.openbmc.examples.PythonService0.conf b/common/recipes-phosphor/obmc-phosphor-example-pydbus/files/org.openbmc.examples.PythonService0.conf
deleted file mode 100644
index fad0b81..0000000
--- a/common/recipes-phosphor/obmc-phosphor-example-pydbus/files/org.openbmc.examples.PythonService0.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
-  <policy user="root">
-    <allow own="org.openbmc.examples.PythonService0"/>
-    <allow send_destination="org.openbmc.examples.PythonService0"/>
-  </policy>
-</busconfig>
diff --git a/common/recipes-phosphor/obmc-phosphor-example-pydbus/files/org.openbmc.examples.PythonService1.conf b/common/recipes-phosphor/obmc-phosphor-example-pydbus/files/org.openbmc.examples.PythonService1.conf
deleted file mode 100644
index 0f7114e..0000000
--- a/common/recipes-phosphor/obmc-phosphor-example-pydbus/files/org.openbmc.examples.PythonService1.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
-  <policy user="root">
-    <allow own="org.openbmc.examples.PythonService1"/>
-    <allow send_destination="org.openbmc.examples.PythonService1"/>
-  </policy>
-</busconfig>
diff --git a/common/recipes-phosphor/obmc-phosphor-example-pydbus/files/pyclient-sample.py b/common/recipes-phosphor/obmc-phosphor-example-pydbus/files/pyclient-sample.py
index e1010a5..138865d 100644
--- a/common/recipes-phosphor/obmc-phosphor-example-pydbus/files/pyclient-sample.py
+++ b/common/recipes-phosphor/obmc-phosphor-example-pydbus/files/pyclient-sample.py
@@ -36,9 +36,9 @@
 
 	bus = dbus.SystemBus()
 
-	obj0 = bus.get_object(SERVICE_PREFIX + '.PythonService0',
+	obj0 = bus.get_object(SERVICE_PREFIX + '.PythonService',
 		                      BASE_OBJ_PATH + 'path0/PythonObj')
-	obj1 = bus.get_object(SERVICE_PREFIX + '.PythonService1',
+	obj1 = bus.get_object(SERVICE_PREFIX + '.PythonService',
 		                      BASE_OBJ_PATH + 'path1/PythonObj')
 	echo0= dbus.Interface(obj0,
 		    dbus_interface=IFACE_PREFIX + '.Echo')
diff --git a/common/recipes-phosphor/obmc-phosphor-example-pydbus/obmc-phosphor-example-pydbus.bb b/common/recipes-phosphor/obmc-phosphor-example-pydbus/obmc-phosphor-example-pydbus.bb
index 1446a73..57e27cf 100644
--- a/common/recipes-phosphor/obmc-phosphor-example-pydbus/obmc-phosphor-example-pydbus.bb
+++ b/common/recipes-phosphor/obmc-phosphor-example-pydbus/obmc-phosphor-example-pydbus.bb
@@ -3,8 +3,7 @@
 PR = "r1"
 
 DBUS_SERVICES = " \
-        org.openbmc.examples.PythonService0 \
-        org.openbmc.examples.PythonService1 \
+        org.openbmc.examples.PythonService \
         "
 
 inherit obmc-phosphor-pydbus-service
diff --git a/common/recipes-phosphor/obmc-phosphor-example-sdbus/files/obmc-phosphor-example-sdbus.c b/common/recipes-phosphor/obmc-phosphor-example-sdbus/files/obmc-phosphor-example-sdbus.c
index a66bb55..769a208 100644
--- a/common/recipes-phosphor/obmc-phosphor-example-sdbus/files/obmc-phosphor-example-sdbus.c
+++ b/common/recipes-phosphor/obmc-phosphor-example-sdbus/files/obmc-phosphor-example-sdbus.c
@@ -79,13 +79,7 @@
 	}
 
 	/* Take a well-known service name so that clients can find us */
-	r = sd_bus_request_name(bus, "org.openbmc.examples.SDBusService0", 0);
-	if (r < 0) {
-		fprintf(stderr, "Failed to acquire service name: %s\n", strerror(-r));
-		goto finish;
-	}
-
-	r = sd_bus_request_name(bus, "org.openbmc.examples.SDBusService1", 0);
+	r = sd_bus_request_name(bus, "org.openbmc.examples.SDBusService", 0);
 	if (r < 0) {
 		fprintf(stderr, "Failed to acquire service name: %s\n", strerror(-r));
 		goto finish;
diff --git a/common/recipes-phosphor/obmc-phosphor-example-sdbus/files/org.openbmc.examples.SDBusService0.conf b/common/recipes-phosphor/obmc-phosphor-example-sdbus/files/org.openbmc.examples.SDBusService.conf
similarity index 62%
copy from common/recipes-phosphor/obmc-phosphor-example-sdbus/files/org.openbmc.examples.SDBusService0.conf
copy to common/recipes-phosphor/obmc-phosphor-example-sdbus/files/org.openbmc.examples.SDBusService.conf
index 45af4f4..86e2a53 100644
--- a/common/recipes-phosphor/obmc-phosphor-example-sdbus/files/org.openbmc.examples.SDBusService0.conf
+++ b/common/recipes-phosphor/obmc-phosphor-example-sdbus/files/org.openbmc.examples.SDBusService.conf
@@ -2,7 +2,7 @@
  "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
 <busconfig>
   <policy user="root">
-    <allow own="org.openbmc.examples.SDBusService0"/>
-    <allow send_destination="org.openbmc.examples.SDBusService0"/>
+    <allow own="org.openbmc.examples.SDBusService"/>
+    <allow send_destination="org.openbmc.examples.SDBusService"/>
   </policy>
 </busconfig>
diff --git a/common/recipes-phosphor/obmc-phosphor-example-sdbus/files/org.openbmc.examples.SDBusService1.conf b/common/recipes-phosphor/obmc-phosphor-example-sdbus/files/org.openbmc.examples.SDBusService1.conf
deleted file mode 100644
index 5a7bfb8..0000000
--- a/common/recipes-phosphor/obmc-phosphor-example-sdbus/files/org.openbmc.examples.SDBusService1.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
-  <policy user="root">
-    <allow own="org.openbmc.examples.SDBusService1"/>
-    <allow send_destination="org.openbmc.examples.SDBusService1"/>
-  </policy>
-</busconfig>
diff --git a/common/recipes-phosphor/obmc-phosphor-example-sdbus/obmc-phosphor-example-sdbus.bb b/common/recipes-phosphor/obmc-phosphor-example-sdbus/obmc-phosphor-example-sdbus.bb
index f1a9eb9..9a3018d 100644
--- a/common/recipes-phosphor/obmc-phosphor-example-sdbus/obmc-phosphor-example-sdbus.bb
+++ b/common/recipes-phosphor/obmc-phosphor-example-sdbus/obmc-phosphor-example-sdbus.bb
@@ -3,8 +3,7 @@
 PR = "r1"
 
 DBUS_SERVICES = " \
-        org.openbmc.examples.SDBusService0 \
-        org.openbmc.examples.SDBusService1 \
+        org.openbmc.examples.SDBusService \
         "
 
 S = "${WORKDIR}"
diff --git a/common/recipes-phosphor/obmc-phosphor-flash/obmc-flash-bmc.bb b/common/recipes-phosphor/obmc-phosphor-flash/obmc-flash-bmc.bb
index 80bd1bf..3c41220 100644
--- a/common/recipes-phosphor/obmc-phosphor-flash/obmc-flash-bmc.bb
+++ b/common/recipes-phosphor/obmc-phosphor-flash/obmc-flash-bmc.bb
@@ -9,6 +9,8 @@
         python-compression \
         python-shell \
         python-pygobject \
+        python-subprocess \
+        python-io \
         pyphosphor \
         "