initscripts: update postinst

in container image, it don't have init system,
install package initscripts will report error:
systemctl: command not found

fix by use same way as systemd.bbclass to decide if systemctl
mask will run

(From OE-Core rev: 790276bde066ecc9876120c3097dcd57a9936f00)

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Changqing Li
2020-06-30 17:50:53 +08:00
committed by Richard Purdie
parent c91cda9b6f
commit 617a658804

View File

@@ -170,7 +170,7 @@ MASKED_SCRIPTS = " \
urandom"
pkg_postinst_${PN} () {
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
if type systemctl >/dev/null 2>/dev/null; then
if [ -n "$D" ]; then
OPTS="--root=$D"
fi