in container image, it don't have init system,
install package modutils-initscripts will report error:
+ systemctl mask modutils.service
/var/tmp/rpm-tmp.DYK3Pm: line 8: systemctl: command not found
%post(modutils-initscripts-1.0-r7.3.cortexa72): waitpid(823) rc 823 status 7f00
warning: %post(modutils-initscripts-1.0-r7.3.cortexa72) scriptlet failed, exit status 127
fix by use same way as systemd.bbclass to decide if systemctl mask will run
Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
PACKAGE_WRITE_DEPS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
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