diff options
-rw-r--r-- | meta/classes/systemd.bbclass | 8 |
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 } 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 } |