]> code.ossystems Code Review - openembedded-core.git/commitdiff
systemd: pass --root in prerm if running on host
authorRoss Burton <ross.burton@intel.com>
Wed, 18 Dec 2013 16:20:06 +0000 (16:20 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 18 Dec 2013 17:06:58 +0000 (17:06 +0000)
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 <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/systemd.bbclass

index efc1adcacb28a7bd6c704db55fdb7d2287d6ad46..2bd63a405b7e2f618f6617460956d3618577811b 100644 (file)
@@ -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
 }