summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorEnrico Jorns <ejo@pengutronix.de>2016-01-12 13:55:43 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-30 11:37:02 +0000
commit593dcd4a2211ee2fcb726df6abf41f060f4d28a3 (patch)
treea43ade36345a9e361e50d0c2e622b222d8f7ddd7 /meta
parent3c90507fb151e279f3da4149bdaac41a7dbd7a33 (diff)
downloadpoky-593dcd4a2211ee2fcb726df6abf41f060f4d28a3.tar.gz
systemd: fix systemctl enable script for template units
The systemctl script supports enabling template units by evaluating "DefaultInstance" parameter. Unfortunately, due to the sed replacement mechanism, all escaping used in the DefaultInstance string, e.g. for giving path names with dashes, is expanded too early. Thus for DefaultInstance=-path\x2dwith\x2ddashes a path unit `foobar@.path` will be installed with a symlink named foobar@-path-with-dashed.path that is interpreted as the path `/path/with/dashes` instead of the intended path nam `/path-with-dashes`. To fix this behavior additional escaping of the backslashes in the `DefaultInstance` string is required so that sed does not expand the escaped characters. (From OE-Core rev: 8b9b9fd700b19731b14a7dcc51d0fa013a5e106a) Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rwxr-xr-xmeta/recipes-core/systemd/systemd-systemctl/systemctl2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl
index 6e163bd5c2..697fbd59df 100755
--- a/meta/recipes-core/systemd/systemd-systemctl/systemctl
+++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl
@@ -136,7 +136,7 @@ for service in $services; do
136 continue 136 continue
137 else 137 else
138 echo "Found DefaultInstance $default_instance, enabling it" 138 echo "Found DefaultInstance $default_instance, enabling it"
139 enable_service=$(echo $service | sed "s/@/@$default_instance/") 139 enable_service=$(echo $service | sed "s/@/@$(echo $default_instance | sed 's/\\/\\\\/g')/")
140 fi 140 fi
141 fi 141 fi
142 mkdir -p $ROOT/etc/systemd/system/$r.wants 142 mkdir -p $ROOT/etc/systemd/system/$r.wants