Skip to contentSkip to conversation

modutils-initscripts: update postinst

PATCH New Changqing Li 1 participant 1 message Jun 30, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 modutils-initscripts: update postinst

From: Changqing Li <[email protected]>

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

---
 .../recipes-kernel/modutils-initscripts/modutils-initscripts.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb +1 -1
index 0f3df5577b..881b7db92e 100644
@@ -24,7 +24,7 @@ do_install () {
 
 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
Signature · 1 line
2.17.1