diff options
author | Ross Burton <ross.burton@intel.com> | 2013-12-18 16:20:06 +0000 |
---|---|---|
committer | Andreas Oberritter <obi@opendreambox.org> | 2015-02-23 16:51:55 +0100 |
commit | c116be18ed3ce24d6f237ee4ddfb6c31fa7fbf6d (patch) | |
tree | d6e14166dd611d743b5f6e69d202045af1da046e /meta | |
parent | 5135f62245d28c270a31d537d4299dea8603db36 (diff) | |
download | openembedded-core-contrib-c116be18ed3ce24d6f237ee4ddfb6c31fa7fbf6d.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.
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit d01da862d10d9544f8da846b577cf955041d4c0c)
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Diffstat (limited to 'meta')
-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 5698091d8d..25cd3affce 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 } |