summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2013-12-18 16:20:06 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-18 17:08:06 +0000
commit402308cfe2ef7777342c2af807b494ac921e81d6 (patch)
treeb1324038d1d2a7e9703dfe41d38fcfb174d23a4f /meta
parent3d2c33cd3d025366e5906313904c72608c1ee71f (diff)
downloadpoky-402308cfe2ef7777342c2af807b494ac921e81d6.tar.gz
systemd: pass --root in prerm if running on host
If a systemd image is built without a package manager then packages will be removed from an image during rootfs generation, but without passing --root the systemctl will look on the *host* system. (From OE-Core rev: d01da862d10d9544f8da846b577cf955041d4c0c) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/systemd.bbclass8
1 files changed, 7 insertions, 1 deletions
diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
index efc1adcacb..2bd63a405b 100644
--- a/meta/classes/systemd.bbclass
+++ b/meta/classes/systemd.bbclass
@@ -38,12 +38,18 @@ fi
38} 38}
39 39
40systemd_prerm() { 40systemd_prerm() {
41OPTS=""
42
43if [ -n "$D" ]; then
44 OPTS="--root=$D"
45fi
46
41if type systemctl >/dev/null 2>/dev/null; then 47if type systemctl >/dev/null 2>/dev/null; then
42 if [ -z "$D" ]; then 48 if [ -z "$D" ]; then
43 systemctl stop ${SYSTEMD_SERVICE} 49 systemctl stop ${SYSTEMD_SERVICE}
44 fi 50 fi
45 51
46 systemctl disable ${SYSTEMD_SERVICE} 52 systemctl $OPTS disable ${SYSTEMD_SERVICE}
47fi 53fi
48} 54}
49 55