From c50e63d55038169db1727ff25d8768ed49f4022d Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 17 Jul 2017 13:38:39 +0200 Subject: [PATCH] Adjust systemd dependencies * use systemd class to auto-enable installed services * make sure lc15-sysdev-remap is started before lc15bts-mgr * keep BTS-specific name to enable adjustment via service file template in future versions --- .../files/lc15-sysdev-remap.service | 2 +- .../lc15-sysdev-remap_1.0.bb | 12 +++++----- recipes-sysmobts/osmo-bts/osmo-bts_git.bb | 22 ++++++++----------- recipes-sysmobts/osmo-pcu/osmo-pcu_git.bb | 11 +++++----- 4 files changed, 22 insertions(+), 25 deletions(-) diff --git a/recipes-support/lc15-sysdev-remap/files/lc15-sysdev-remap.service b/recipes-support/lc15-sysdev-remap/files/lc15-sysdev-remap.service index 206494c..a8fa1da 100644 --- a/recipes-support/lc15-sysdev-remap/files/lc15-sysdev-remap.service +++ b/recipes-support/lc15-sysdev-remap/files/lc15-sysdev-remap.service @@ -11,4 +11,4 @@ ExecStart=/usr/bin/lc15-sysdev-remap RemainAfterExit=true [Install] -WantedBy=multi-user.target +WantedBy=multi-user.target lc15bts-mgr.service diff --git a/recipes-support/lc15-sysdev-remap/lc15-sysdev-remap_1.0.bb b/recipes-support/lc15-sysdev-remap/lc15-sysdev-remap_1.0.bb index 5e42f68..c3b5b31 100644 --- a/recipes-support/lc15-sysdev-remap/lc15-sysdev-remap_1.0.bb +++ b/recipes-support/lc15-sysdev-remap/lc15-sysdev-remap_1.0.bb @@ -11,7 +11,7 @@ SRC_URI = "file://lc15-sysdev-remap \ S = "${WORKDIR}" -inherit gitver-repo +inherit gitver-repo systemd REPODIR = "${THISDIR}" REPOFILE = "lc15-sysdev-remap_1.0.bb" @@ -21,22 +21,22 @@ REPODIR = "${THISDIR}/files" REPOFILE = "" PR := "${PR}.${REPOGITFN}" +SYSTEMD_PACKAGES = "${PN}" +SYSTEMD_AUTO_ENABLE_${PN}="enable" +SYSTEMD_SERVICE_${PN} = "lc15-sysdev-remap.service mnt-rom-factory.automount mnt-rom-factory.mount mnt-storage.automount mnt-storage.mount" + do_install() { install -d ${D}${bindir} - install -d ${D}${systemd_unitdir}/system/multi-user.target.wants/ + install -d ${D}/${systemd_unitdir}/system install -m 0755 ${S}/lc15-sysdev-remap ${D}${bindir}/lc15-sysdev-remap install -m 0644 ${S}/lc15-sysdev-remap.service ${D}${systemd_unitdir}/system/ - ln -sf ../lc15-sysdev-remap.service ${D}${systemd_unitdir}/system/multi-user.target.wants/ install -m 0644 ${S}/mnt-rom-factory.automount ${D}${systemd_unitdir}/system/ install -m 0644 ${S}/mnt-rom-factory.mount ${D}${systemd_unitdir}/system/ install -m 0644 ${S}/mnt-storage.automount ${D}${systemd_unitdir}/system/ install -m 0644 ${S}/mnt-storage.mount ${D}${systemd_unitdir}/system/ - ln -sf ../mnt-rom-factory.automount ${D}${systemd_unitdir}/system/multi-user.target.wants/ - ln -sf ../mnt-storage.automount ${D}${systemd_unitdir}/system/multi-user.target.wants/ } FILES_${PN} += "${bindir} \ - ${systemd_unitdir} \ ${sysconfdir}" INSANE_SKIP_${PN} = "arch" diff --git a/recipes-sysmobts/osmo-bts/osmo-bts_git.bb b/recipes-sysmobts/osmo-bts/osmo-bts_git.bb index d5d59b6..d440598 100644 --- a/recipes-sysmobts/osmo-bts/osmo-bts_git.bb +++ b/recipes-sysmobts/osmo-bts/osmo-bts_git.bb @@ -26,8 +26,10 @@ RDEPENDS_${PN}_append_sysmobts2100 = " lc15-firmware" EXTRA_OECONF_sysmobts-v2 += "--enable-sysmocom-bts" EXTRA_OECONF_sysmobts2100 += "--enable-litecell15" -inherit autotools pkgconfig +inherit autotools pkgconfig systemd +SYSTEMD_PACKAGES = "${PN}" +SYSTEMD_AUTO_ENABLE_${PN}="enable" # Select the API version inherit femtobts_api @@ -44,9 +46,7 @@ do_compile_append_sysmobts-v2() { do_install_append() { install -d ${D}${sysconfdir}/osmocom - - # Future sysmobts-mgr handling - install -d ${D}${systemd_unitdir}/system/multi-user.target.wants/ + install -d ${D}/${systemd_unitdir}/system } do_install_append_sysmobts-v2() { @@ -55,30 +55,27 @@ do_install_append_sysmobts-v2() { install -m 0660 ${S}/doc/examples/sysmo/osmo-bts.cfg ${D}${sysconfdir}/osmocom # Install systemd and enable on sysinit - install -d ${D}${systemd_unitdir}/system/multi-user.target.wants/ + install -m 0660 ${S}/doc/examples/sysmo/sysmobts-mgr.cfg ${D}${sysconfdir}/osmocom install -m 0644 ${S}/contrib/sysmobts-mgr.service ${D}${systemd_unitdir}/system/ - ln -sf ../sysmobts-mgr.service ${D}${systemd_unitdir}/system/multi-user.target.wants/ install -m 0644 ${S}/contrib/osmo-bts-sysmo.service ${D}${systemd_unitdir}/system/ - ln -sf ../osmo-bts-sysmo.service ${D}${systemd_unitdir}/system/multi-user.target.wants/ } do_install_append_sysmobts2100() { install -m 0660 ${S}/doc/examples/litecell15/osmo-bts.cfg ${D}${sysconfdir}/osmocom # ensure consistent naming - mv ${D}/${bindir}/lc15bts-util ${D}/${bindir}/sysmobts-util - mv ${D}/${bindir}/lc15bts-mgr ${D}/${bindir}/sysmobts-mgr + cp ${D}/${bindir}/lc15bts-util ${D}/${bindir}/sysmobts-util + cp ${D}/${bindir}/lc15bts-mgr ${D}/${bindir}/sysmobts-mgr # Install systemd and enable on sysinit - install -d ${D}${systemd_unitdir}/system/multi-user.target.wants/ install -m 0644 ${S}/contrib/sysmobts-mgr.service ${D}${systemd_unitdir}/system/lc15bts-mgr.service - ln -sf ../lc15bts-mgr.service ${D}${systemd_unitdir}/system/multi-user.target.wants/ install -m 0660 ${S}/doc/examples/litecell15/lc15bts-mgr.cfg ${D}${sysconfdir}/osmocom/ install -m 0644 ${S}/contrib/osmo-bts-lc15.service ${D}${systemd_unitdir}/system/ - ln -sf ../osmo-bts-lc15.service ${D}${systemd_unitdir}/system/multi-user.target.wants/ } +SYSTEMD_SERVICE_${PN}_append_sysmobts-v2 = "sysmobts-mgr.service osmo-bts-sysmo.service" +SYSTEMD_SERVICE_${PN}_append_sysmobts2100 = "lc15bts-mgr.service osmo-bts-lc15.service" CONFFILES_${PN} = "${sysconfdir}/osmocom/osmo-bts.cfg" CONFFILES_${PN}_append_sysmobts-v2 = " ${sysconfdir}/osmocom/sysmobts-mgr.cfg" @@ -87,7 +84,6 @@ CONFFILES_${PN}_append_sysmobts-v2 = " ${sysconfdir}/osmocom/sysmobts-mgr.cfg" #PACKAGES_append_sysmobts-v2 = " osmo-bts-remote sysmobts-calib sysmobts-util" PACKAGES =+ "osmo-bts-remote sysmobts-calib sysmobts-util" -FILES_${PN} += "${systemd_unitdir}" FILES_osmo-bts-remote_sysmobts-v2 = " ${bindir}/osmo-bts-sysmo-remote " FILES_sysmobts-calib_sysmobts-v2 = " ${bindir}/sysmobts-calib " FILES_sysmobts-util = " ${bindir}/sysmobts-util " diff --git a/recipes-sysmobts/osmo-pcu/osmo-pcu_git.bb b/recipes-sysmobts/osmo-pcu/osmo-pcu_git.bb index 1e6ef44..7413a7f 100644 --- a/recipes-sysmobts/osmo-pcu/osmo-pcu_git.bb +++ b/recipes-sysmobts/osmo-pcu/osmo-pcu_git.bb @@ -20,7 +20,11 @@ EXTRA_OECONF_sysmobts-v2 += "--enable-sysmocom-bts --enable-sysmocom-dsp" EXTRA_OECONF_litecell15 += "--enable-lc15bts-phy" EXTRA_OECONF_sysmobts2100 += "--enable-lc15bts-phy" -inherit autotools pkgconfig +inherit autotools pkgconfig systemd + +SYSTEMD_PACKAGES = "${PN}" +SYSTEMD_AUTO_ENABLE_${PN}="enable" +SYSTEMD_SERVICE_${PN} = "osmo-pcu.service" # Select the API version inherit femtobts_api @@ -28,9 +32,6 @@ CPPFLAGS_append_sysmobts-v2 = " ${BTS_HW_VERSION} " do_install_append() { # Install systemd and enable on sysinit - install -d ${D}${systemd_unitdir}/system/multi-user.target.wants/ + install -d ${D}/${systemd_unitdir}/system install -m 0644 ${S}/contrib/osmo-pcu.service ${D}${systemd_unitdir}/system/ - ln -sf ../osmo-pcu.service ${D}${systemd_unitdir}/system/multi-user.target.wants/ } - -FILES_${PN} += "${systemd_unitdir}"