mirror of
https://git.yoctoproject.org/poky
synced 2026-04-29 18:32:20 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
3d2c33cd3d
commit
402308cfe2
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user