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

Change-Id: I821249615c7bc593cd5a68b1a9c48fe787016e87
Related: SYS#6340
diff --git a/recipes-osmocom/osmo-bsc/osmo-bsc.inc b/recipes-osmocom/osmo-bsc/osmo-bsc.inc
index 484a779..50e8f9b 100644
--- a/recipes-osmocom/osmo-bsc/osmo-bsc.inc
+++ b/recipes-osmocom/osmo-bsc/osmo-bsc.inc
@@ -5,7 +5,7 @@
 
 DEPENDS = "sqlite3 libpcap libosmocore libosmo-abis libosmo-sccp libosmo-netif osmo-mgw"
 
-INC_PR="r1.${META_TELEPHONY_OSMO_INC}"
+INC_PR="r2.${META_TELEPHONY_OSMO_INC}"
 
 inherit autotools pkgconfig systemd
 
@@ -14,6 +14,12 @@
     "
 PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir},--without-systemdsystemunitdir"
 
+# 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"
+}
+
 PACKAGES =+ "meas-utils ipaccess-utils bs11-utils abisip-find"
 SYSTEMD_PACKAGES = "osmo-bsc"
 SYSTEMD_SERVICE_osmo-bsc = "osmo-bsc.service"