summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorMartin Hundebøll <mnhu@prevas.dk>2017-11-23 13:24:10 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-06 10:13:56 +0000
commit63f07325fa9f624b03994fab04ba451075feca82 (patch)
treebc1a591762fbe6e494bbe6dda1b66db3496fea36 /meta/classes
parentdd6ba2aa9674fe37e71d42add60f445a41f92653 (diff)
downloadpoky-63f07325fa9f624b03994fab04ba451075feca82.tar.gz
systemd: allow dots in arguments to template units
When installing systemd template units with an argument, the current code removes characters between the '@' and the '.' from service names in SYSTEMD_SERVICE_${PN}, e.g.: getty@tty1.service -> getty@.service This fails for services with dots in the argument (which is perfectly legal in systemd), since the code searches only until the first dot. E.g.: vlan@eth0.1.service -> vlan@1.service This is obviously wrong, and fails in systemd_populate_packages(), where it fails to find the unit file. Fix this by reworking the removal of the argument part of the service name, so that parts before '@' and after teh last '.' are used as base name. (From OE-Core rev: e6fcc7d31b9105e518cf8a69d04f60291b7dd8fb) Signed-off-by: Martin Hundebøll <mnhu@prevas.dk> Signed-off-by: Ross Burton <ross.burton@intel.com> (cherry picked from commit 4704bd91458a728f28cbdc57dcf78f5d04cfd0cd) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/systemd.bbclass6
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
index c4b4bb9b70..1b134322fb 100644
--- a/meta/classes/systemd.bbclass
+++ b/meta/classes/systemd.bbclass
@@ -154,8 +154,10 @@ python systemd_populate_packages() {
154 # Deal with adding, for example, 'ifplugd@eth0.service' from 154 # Deal with adding, for example, 'ifplugd@eth0.service' from
155 # 'ifplugd@.service' 155 # 'ifplugd@.service'
156 base = None 156 base = None
157 if service.find('@') != -1: 157 at = service.find('@')
158 base = re.sub('@[^.]+.', '@.', service) 158 if at != -1:
159 ext = service.rfind('.')
160 base = service[:at] + '@' + service[ext:]
159 161
160 for path in searchpaths: 162 for path in searchpaths:
161 if os.path.exists(oe.path.join(d.getVar("D"), path, service)): 163 if os.path.exists(oe.path.join(d.getVar("D"), path, service)):