Patchwork [meta-oe,5/7] automatically install all *.service and *.socket supplied in recipe's SRC_URI

login
register
mail settings
Submitter Andreas Müller
Date Feb. 11, 2012, 2 a.m.
Message ID <1328925603-2967-5-git-send-email-schnitzeltony@googlemail.com>
Download mbox | patch
Permalink /patch/21159/
State Superseded
Headers show

Comments

Andreas Müller - Feb. 11, 2012, 2 a.m.
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
---
 meta-oe/classes/systemd.bbclass |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
Otavio Salvador - Feb. 11, 2012, 1:17 p.m.
Acked-by: Otavio Salvador <otavio@ossystems.com.br>

On Sat, Feb 11, 2012 at 00:00, Andreas Müller
<schnitzeltony@googlemail.com>wrote:

>
> Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
> ---
>  meta-oe/classes/systemd.bbclass |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/meta-oe/classes/systemd.bbclass
> b/meta-oe/classes/systemd.bbclass
> index ffcabe9..3c1ed14 100644
> --- a/meta-oe/classes/systemd.bbclass
> +++ b/meta-oe/classes/systemd.bbclass
> @@ -74,6 +74,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}${base_libdir}/systemd/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}${base_libdir}/systemd/system
> +       fi
> +    done
> +}
> +
>  python populate_packages_prepend () {
>        def systemd_prepost_instrm(pkg):
>                bb.debug(1, 'adding systemd calls to postinst/postrm for
> %s' % pkg)
> --
> 1.7.4.4
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>

Patch

diff --git a/meta-oe/classes/systemd.bbclass b/meta-oe/classes/systemd.bbclass
index ffcabe9..3c1ed14 100644
--- a/meta-oe/classes/systemd.bbclass
+++ b/meta-oe/classes/systemd.bbclass
@@ -74,6 +74,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}${base_libdir}/systemd/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}${base_libdir}/systemd/system
+	fi
+    done
+}
+
 python populate_packages_prepend () {
 	def systemd_prepost_instrm(pkg):
 		bb.debug(1, 'adding systemd calls to postinst/postrm for %s' % pkg)