osmo-*: Fix systemd services to run against old systemd

Change-Id: I821249615c7bc593cd5a68b1a9c48fe787016e87
Related: SYS#6340
diff --git a/recipes-osmocom/osmo-msc/osmo-msc.inc b/recipes-osmocom/osmo-msc/osmo-msc.inc
index 59280ce..c60fd07 100644
--- a/recipes-osmocom/osmo-msc/osmo-msc.inc
+++ b/recipes-osmocom/osmo-msc/osmo-msc.inc
@@ -5,7 +5,7 @@
 
 DEPENDS = "libdbi libosmocore libosmo-abis libosmo-sccp libosmo-netif osmo-mgw osmo-hlr"
 
-INC_PR="r2.${META_TELEPHONY_OSMO_INC}"
+INC_PR="r3.${META_TELEPHONY_OSMO_INC}"
 
 inherit autotools pkgconfig systemd
 
@@ -18,6 +18,12 @@
 PACKAGECONFIG[iu] = "--enable-iu,--disable-iu,libasn1c osmo-iuh,"
 PACKAGECONFIG[smpp] = "--enable-smpp,--disable-smpp,libsmpp34,"
 
+# StateDirectory requires systemd >= v235, but poky pyro ships with v232 (SYS#6340):
+do_install_append() {
+	sed -i '/^StateDirectory=/d' "${D}${systemd_system_unitdir}/${PN}.service"
+	sed -i '/^WorkingDirectory=/d' "${D}${systemd_system_unitdir}/${PN}.service"
+}
+
 RDEPENDS_${PN} = "libdbd-sqlite3"
 
 SYSTEMD_SERVICE_${PN} = "${PN}.service"