[meta-ti] Jacob Stiffler : multiprocmgr: add systemd service
Arago Project git
git at arago-project.org
Mon Oct 24 19:29:33 PDT 2016
Module: meta-ti
Branch: master
Commit: 882eb9e79960cb6a4d659ac98709e01d0bebd8d9
URL: http://arago-project.org/git/meta-ti.git?a=commit;h=882eb9e79960cb6a4d659ac98709e01d0bebd8d9
Author: Jacob Stiffler <j-stiffler at ti.com>
Date: Mon Oct 10 20:55:36 2016 +0000
multiprocmgr: add systemd service
* The multiprocmgr's mpmsrv daemon requires a set of kernel modules to
be loaded prior to initialization.
* Add a systemd service so that these dependencies may be specified.
Signed-off-by: Jacob Stiffler <j-stiffler at ti.com>
Signed-off-by: Denys Dmytriyenko <denys at ti.com>
---
.../multiprocmgr/mpmsrv-daemon.service | 14 ++++++++++++++
recipes-ti/multiprocmgr/multiprocmgr_git.bb | 19 +++++++++++++++----
2 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/recipes-ti/multiprocmgr/multiprocmgr/mpmsrv-daemon.service b/recipes-ti/multiprocmgr/multiprocmgr/mpmsrv-daemon.service
new file mode 100644
index 0000000..40eb465
--- /dev/null
+++ b/recipes-ti/multiprocmgr/multiprocmgr/mpmsrv-daemon.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=TI Multiproc Manager
+
+[Service]
+ExecStartPre=/sbin/modprobe keystone_remoteproc
+ExecStartPre=/sbin/modprobe keystone_dsp_mem
+ExecStartPre=/sbin/modprobe uio_module_drv
+
+Type=forking
+PIDFile=/var/run/mpm/pid
+ExecStart=/usr/bin/mpmsrv
+
+[Install]
+WantedBy=basic.target
diff --git a/recipes-ti/multiprocmgr/multiprocmgr_git.bb b/recipes-ti/multiprocmgr/multiprocmgr_git.bb
index 38d4ceb..2960ee3 100644
--- a/recipes-ti/multiprocmgr/multiprocmgr_git.bb
+++ b/recipes-ti/multiprocmgr/multiprocmgr_git.bb
@@ -3,7 +3,9 @@ SUMMARY = "Provides download, debug and other utilities for other cores in the S
include multiprocmgr.inc
-PR = "${INC_PR}.0"
+SRC_URI_append = " file://mpmsrv-daemon.service"
+
+PR = "${INC_PR}.1"
DEPENDS = "mpm-transport libdaemon virtual/kernel"
RDEPENDS_${PN} = "syslog-ng"
@@ -15,15 +17,24 @@ CC += "-I${STAGING_KERNEL_DIR}/include"
INITSCRIPT_NAME = "mpmsrv-daemon.sh"
INITSCRIPT_PARAMS = "defaults 10"
-inherit update-rc.d
+SYSTEMD_SERVICE_${PN} = "mpmsrv-daemon.service"
+
+inherit update-rc.d systemd
do_install() {
install -d ${D}${bindir}/
install -c -m 755 ${S}/bin/mpmsrv ${D}${bindir}/mpmsrv
install -c -m 755 ${S}/bin/mpmcl ${D}${bindir}/mpmcl
- install -d ${D}${sysconfdir}/init.d/
- install -c -m 755 ${S}/scripts/mpmsrv-daemon.sh ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
+ systemd_enabled=${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '1', '0', d)}
+ if [ ${systemd_enabled} -eq 1 ]
+ then
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/mpmsrv-daemon.service ${D}${systemd_system_unitdir}
+ else
+ install -d ${D}${sysconfdir}/init.d/
+ install -c -m 755 ${S}/scripts/mpmsrv-daemon.sh ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
+ fi
install -d ${D}${sysconfdir}/mpm/
install -c -m 755 ${S}/scripts/crash_callback.sh ${D}${sysconfdir}/mpm/crash_callback.sh
More information about the meta-ti
mailing list