From 1778f7f9d94583d3d3f50ebb5bffb45e93ab38dc Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 14 Feb 2023 11:32:47 +0100 Subject: [PATCH] osmo-{bts,pcu}: Fix systemd services to run against old systemd Related: SYS#6340 --- recipes-sysmobts/osmo-bts/osmo-bts_git.bb | 22 +++++++++++++++++++++- recipes-sysmobts/osmo-pcu/osmo-pcu_git.bb | 8 +++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/recipes-sysmobts/osmo-bts/osmo-bts_git.bb b/recipes-sysmobts/osmo-bts/osmo-bts_git.bb index 4c394f9..e332efc 100644 --- a/recipes-sysmobts/osmo-bts/osmo-bts_git.bb +++ b/recipes-sysmobts/osmo-bts/osmo-bts_git.bb @@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" SRCREV = "1.6.0" SRC_URI = "git://gerrit.osmocom.org/osmo-bts;protocol=https;destsuffix=git;tag=${SRCREV};nobranch=1" PV = "${SRCREV}+git${SRCPV}" -PR = "r0.${META_TELEPHONY_OSMO_INC}" +PR = "r1.${META_TELEPHONY_OSMO_INC}" S = "${WORKDIR}/git" DEPENDS = "libosmocore libosmo-abis libosmo-netif femtobts-api gpsd" @@ -32,6 +32,26 @@ PACKAGECONFIG ??= "\ " PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir},--without-systemdsystemunitdir" +# StateDirectory requires systemd >= v235, but poky pyro ships with v232 (SYS#6340): +do_install_append_sysmobts-v2() { + sed -i '/^StateDirectory=/d' ${D}${systemd_system_unitdir}/osmo-bts-sysmo.service + sed -i '/^WorkingDirectory=/d' ${D}${systemd_system_unitdir}/osmo-bts-sysmo.service + sed -i '/^StateDirectory=/d' ${D}${systemd_system_unitdir}/sysmobts-mgr.service + sed -i '/^WorkingDirectory=/d' ${D}${systemd_system_unitdir}/sysmobts-mgr.service +} +do_install_append_sysmobts2100() { + sed -i '/^StateDirectory=/d' ${D}${systemd_system_unitdir}/osmo-bts-lc15.service + sed -i '/^WorkingDirectory=/d' ${D}${systemd_system_unitdir}/osmo-bts-lc15.service + sed -i '/^StateDirectory=/d' ${D}${systemd_system_unitdir}/lc15bts-mgr.service + sed -i '/^WorkingDirectory=/d' ${D}${systemd_system_unitdir}/lc15bts-mgr.service +} +do_install_append_oc2g() { + sed -i '/^StateDirectory=/d' ${D}${systemd_system_unitdir}/osmo-bts-oc2g.service + sed -i '/^WorkingDirectory=/d' ${D}${systemd_system_unitdir}/osmo-bts-oc2g.service + sed -i '/^StateDirectory=/d' ${D}${systemd_system_unitdir}/oc2gbts-mgr.service + sed -i '/^WorkingDirectory=/d' ${D}${systemd_system_unitdir}/oc2gbts-mgr.service +} + SYSTEMD_PACKAGES = "${PN} osmo-bts-virtual" SYSTEMD_AUTO_ENABLE_${PN}="enable" diff --git a/recipes-sysmobts/osmo-pcu/osmo-pcu_git.bb b/recipes-sysmobts/osmo-pcu/osmo-pcu_git.bb index c6263de..2cef0c9 100644 --- a/recipes-sysmobts/osmo-pcu/osmo-pcu_git.bb +++ b/recipes-sysmobts/osmo-pcu/osmo-pcu_git.bb @@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" SRCREV = "1.2.0" SRC_URI = "git://gerrit.osmocom.org/osmo-pcu;protocol=https;branch=master;nobranch=1" PV = "${SRCREV}+git${SRCPV}" -PR = "r0.${META_TELEPHONY_OSMO_INC}" +PR = "r1.${META_TELEPHONY_OSMO_INC}" S = "${WORKDIR}/git" DEPENDS = "libosmocore osmo-bts" @@ -29,6 +29,12 @@ PACKAGECONFIG ??= "\ " PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir},--without-systemdsystemunitdir" +do_install_append() { + # StateDirectory requires systemd >= v235, but poky pyro ships with v232 (SYS#6340): + sed -i '/^StateDirectory=/d' ${D}${systemd_system_unitdir}/osmo-pcu.service + sed -i '/^WorkingDirectory=/d' ${D}${systemd_system_unitdir}/osmo-pcu.service +} + SYSTEMD_PACKAGES = "${PN}" SYSTEMD_AUTO_ENABLE_${PN}="enable" SYSTEMD_SERVICE_${PN} = "osmo-pcu.service"