summaryrefslogtreecommitdiffstats
path: root/meta-oe/classes
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2012-04-24 15:11:44 +0200
committerMartin Jansa <Martin.Jansa@gmail.com>2012-04-26 13:47:32 +0200
commit154d0bb399ce6a0bdc2bf756d1a8a9c77dd0a755 (patch)
tree223e5e4b232c60a83d3c8abd695477a43871645b /meta-oe/classes
parent21d048aecfe72b6f15965906db988e9300fad68a (diff)
downloadmeta-openembedded-154d0bb399ce6a0bdc2bf756d1a8a9c77dd0a755.tar.gz
systemd.bbclass: allow recipe to inherit systemd with empty SYSTEMD_SERVICE
* I have use case where common recipe does inherit systemd and only some BSP's are bbappending some SERVICEs to it * install was moved intentionaly, so that /lib/systemd/system is not created if there is no .service file (causing QA Warning about unpackaged dir) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/classes')
-rw-r--r--meta-oe/classes/systemd.bbclass11
1 files changed, 5 insertions, 6 deletions
diff --git a/meta-oe/classes/systemd.bbclass b/meta-oe/classes/systemd.bbclass
index d8e30f4af..db35717f6 100644
--- a/meta-oe/classes/systemd.bbclass
+++ b/meta-oe/classes/systemd.bbclass
@@ -58,8 +58,6 @@ def systemd_after_parse(d):
58 for pkg_systemd in systemd_pkgs.split(): 58 for pkg_systemd in systemd_pkgs.split():
59 service_pkg = 'SYSTEMD_SERVICE' + "_" + pkg_systemd 59 service_pkg = 'SYSTEMD_SERVICE' + "_" + pkg_systemd
60 systemd_services = d.getVar(service_pkg, 1) or d.getVar('SYSTEMD_SERVICE', 1) or "" 60 systemd_services = d.getVar(service_pkg, 1) or d.getVar('SYSTEMD_SERVICE', 1) or ""
61 if systemd_services == "":
62 raise bb.build.FuncFailed, "\n\n%s inherits systemd but doesn't set SYSTEMD_SERVICE / %s" % (bb_filename, service_pkg)
63 61
64 # prepend systemd-packages not already included 62 # prepend systemd-packages not already included
65 def systemd_create_package(pkg_systemd): 63 def systemd_create_package(pkg_systemd):
@@ -84,11 +82,11 @@ python __anonymous() {
84 82
85# automatically install all *.service and *.socket supplied in recipe's SRC_URI 83# automatically install all *.service and *.socket supplied in recipe's SRC_URI
86do_install_append() { 84do_install_append() {
87 install -d ${D}${systemd_unitdir}/system
88 for service in `find ${WORKDIR} -maxdepth 1 -name '*.service' -o -name '*.socket'` ; do 85 for service in `find ${WORKDIR} -maxdepth 1 -name '*.service' -o -name '*.socket'` ; do
89 # ensure installing systemd-files only (e.g not avahi *.service) 86 # ensure installing systemd-files only (e.g not avahi *.service)
90 if grep -q '\[Unit\]' $service ; then 87 if grep -q '\[Unit\]' $service ; then
91 install -m 644 $service ${D}${systemd_unitdir}/system 88 install -d ${D}${systemd_unitdir}/system
89 install -m 644 $service ${D}${systemd_unitdir}/system
92 fi 90 fi
93 done 91 done
94} 92}
@@ -203,7 +201,8 @@ python populate_packages_prepend () {
203 # run all modifications once when creating package 201 # run all modifications once when creating package
204 if os.path.exists('${D}'): 202 if os.path.exists('${D}'):
205 for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split(): 203 for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split():
206 systemd_generate_package_scripts(pkg_systemd) 204 if d.getVar('SYSTEMD_SERVICE' + "_" + pkg_systemd, 1) and d.getVar('SYSTEMD_SERVICE' + "_" + pkg_systemd, 1).strip():
207 systemd_add_rdepends(pkg_systemd) 205 systemd_generate_package_scripts(pkg_systemd)
206 systemd_add_rdepends(pkg_systemd)
208 systemd_check_services() 207 systemd_check_services()
209} 208}