From: Ross Burton Date: Wed, 18 Dec 2013 16:20:06 +0000 (+0000) Subject: systemd: pass --root in prerm if running on host X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~35079 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d01da862d10d9544f8da846b577cf955041d4c0c;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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. Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass index efc1adcacb2..2bd63a405b7 100644 --- a/meta/classes/systemd.bbclass +++ b/meta/classes/systemd.bbclass @@ -38,12 +38,18 @@ fi } systemd_prerm() { +OPTS="" + +if [ -n "$D" ]; then + OPTS="--root=$D" +fi + if type systemctl >/dev/null 2>/dev/null; then if [ -z "$D" ]; then systemctl stop ${SYSTEMD_SERVICE} fi - systemctl disable ${SYSTEMD_SERVICE} + systemctl $OPTS disable ${SYSTEMD_SERVICE} fi }