From 450417617adf21de5ba01a06294515a51939ea75 Mon Sep 17 00:00:00 2001 From: Andreas Müller Date: Thu, 16 Feb 2012 02:02:59 +0000 Subject: systemd.bbclass: automatically install all *.service and *.socket supplied in recipe's SRC_URI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas Müller Signed-off-by: Koen Kooi --- meta-oe/classes/systemd.bbclass | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/meta-oe/classes/systemd.bbclass b/meta-oe/classes/systemd.bbclass index e779bef29..b2d4191d1 100644 --- a/meta-oe/classes/systemd.bbclass +++ b/meta-oe/classes/systemd.bbclass @@ -80,6 +80,17 @@ python __anonymous() { systemd_after_parse(d) } +# automatically install all *.service and *.socket supplied in recipe's SRC_URI +do_install_append() { + install -d ${D}${systemd_unitdir}/system + for service in `find ${WORKDIR} -maxdepth 1 -name '*.service' -o -name '*.socket'` ; do + # ensure installing systemd-files only (e.g not avahi *.service) + if grep -q '\[Unit\]' $service ; then + install -m 644 $service ${D}${systemd_unitdir}/system + fi + done +} + python populate_packages_prepend () { def systemd_generate_package_scripts(pkg): bb.debug(1, 'adding systemd calls to postinst/postrm for %s' % pkg) -- cgit v1.2.3-54-g00ecf