summaryrefslogtreecommitdiffstats
path: root/meta/classes/systemd.bbclass
diff options
context:
space:
mode:
authorBob Ham <bob.ham@collabora.com>2015-11-19 11:24:00 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-09 08:48:24 +0000
commit7cf7156b2c3413e90dc1d322c32620a8cab72fc6 (patch)
tree6a379807dc6056e8383526572f540ff9bb25913d /meta/classes/systemd.bbclass
parent551cda0bd5258f83e2cc35564ee1640b760ca722 (diff)
downloadpoky-7cf7156b2c3413e90dc1d322c32620a8cab72fc6.tar.gz
systemd.bbclass: Allow enabling of parameterised services
Currently the systemd.class will check whether a service exists when it is requested to enabled it. However, its check does not take into account that a service like 'foo@eth0.service' can be enabled from a service named 'foo@.service'. This patch alters the check function in systemd.class to look for 'foo@.service' if the normal check fails. (From OE-Core rev: 4ce15271dad3520e5de2500c609b05d5a511e453) Signed-off-by: Bob Ham <bob.ham@collabora.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/systemd.bbclass')
-rw-r--r--meta/classes/systemd.bbclass14
1 files changed, 14 insertions, 0 deletions
diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
index 46e72c7a4a..db7873fbe2 100644
--- a/meta/classes/systemd.bbclass
+++ b/meta/classes/systemd.bbclass
@@ -59,6 +59,8 @@ systemd_populate_packages[vardepsexclude] += "OVERRIDES"
59 59
60 60
61python systemd_populate_packages() { 61python systemd_populate_packages() {
62 import re
63
62 if not bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d): 64 if not bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
63 return 65 return
64 66
@@ -144,10 +146,22 @@ python systemd_populate_packages() {
144 for pkg_systemd in systemd_packages.split(): 146 for pkg_systemd in systemd_packages.split():
145 for service in get_package_var(d, 'SYSTEMD_SERVICE', pkg_systemd).split(): 147 for service in get_package_var(d, 'SYSTEMD_SERVICE', pkg_systemd).split():
146 path_found = '' 148 path_found = ''
149
150 # Deal with adding, for example, 'ifplugd@eth0.service' from
151 # 'ifplugd@.service'
152 base = None
153 if service.find('@') != -1:
154 base = re.sub('@[^.]+.', '@.', service)
155
147 for path in searchpaths: 156 for path in searchpaths:
148 if os.path.exists(oe.path.join(d.getVar("D", True), path, service)): 157 if os.path.exists(oe.path.join(d.getVar("D", True), path, service)):
149 path_found = path 158 path_found = path
150 break 159 break
160 elif base is not None:
161 if os.path.exists(oe.path.join(d.getVar("D", True), path, base)):
162 path_found = path
163 break
164
151 if path_found != '': 165 if path_found != '':
152 systemd_add_files_and_parse(pkg_systemd, path_found, service, keys) 166 systemd_add_files_and_parse(pkg_systemd, path_found, service, keys)
153 else: 167 else: