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
This commit is contained in:
Max 2017-07-17 13:38:39 +02:00 committed by Pau Espin Pedrol
parent 62f1eaed42
commit c50e63d550
4 changed files with 22 additions and 25 deletions

View File

@ -11,4 +11,4 @@ ExecStart=/usr/bin/lc15-sysdev-remap
RemainAfterExit=true
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target lc15bts-mgr.service

View File

@ -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"

View File

@ -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 "

View File

@ -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}"