summaryrefslogtreecommitdiff
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:47:27 +0000
commit4ce15271dad3520e5de2500c609b05d5a511e453 (patch)
tree118ae66e5eb6bce881e5331258aa7a28c9688e15 /meta/classes/systemd.bbclass
parent55ca1fb8f0e81ff739b3c46897e43356d1f760c3 (diff)
downloadopenembedded-core-4ce15271dad3520e5de2500c609b05d5a511e453.tar.gz
openembedded-core-4ce15271dad3520e5de2500c609b05d5a511e453.tar.bz2
openembedded-core-4ce15271dad3520e5de2500c609b05d5a511e453.zip
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. Signed-off-by: Bob Ham <bob.ham@collabora.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
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"
python systemd_populate_packages() {
+ import re
+
if not bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
return
@@ -144,10 +146,22 @@ python systemd_populate_packages() {
for pkg_systemd in systemd_packages.split():
for service in get_package_var(d, 'SYSTEMD_SERVICE', pkg_systemd).split():
path_found = ''
+
+ # Deal with adding, for example, 'ifplugd@eth0.service' from
+ # 'ifplugd@.service'
+ base = None
+ if service.find('@') != -1:
+ base = re.sub('@[^.]+.', '@.', service)
+
for path in searchpaths:
if os.path.exists(oe.path.join(d.getVar("D", True), path, service)):
path_found = path
break
+ elif base is not None:
+ if os.path.exists(oe.path.join(d.getVar("D", True), path, base)):
+ path_found = path
+ break
+
if path_found != '':
systemd_add_files_and_parse(pkg_systemd, path_found, service, keys)
else: