Skip to contentSkip to conversation

systemd-compat-units.bb: fix postinstall script

PATCH New [email protected] 1 participant 1 message Nov 22, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 systemd-compat-units.bb: fix postinstall script

From: Michael Opdenacker <[email protected]>

This fixes an issue running "opkg upgrade" on a system with systemd (and when there is an update to "systemd-compat-units", for example between yocto 4.2.2 and 4.2.3):

//var/lib/opkg/info/systemd-compat-units.postinst: cd: line 3: can't cd to /etc/init.d: No such file or directory

The existence of /etc/init.d is now tested
without causing an error if doesn't exist.

Fixes [YOCTO #15292]

---
 meta/recipes-core/systemd/systemd-compat-units.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-core/systemd/systemd-compat-units.bb +2 -1
index 253bc9fcf1..c03d97f9c9 100644
@@ -27,7 +27,8 @@ SYSTEMD_DISABLED_SYSV_SERVICES = " \
 
 pkg_postinst:${PN} () {
 
-	cd $D${sysconfdir}/init.d  ||  exit 0
+	test -d $D${sysconfdir}/init.d  ||  exit 0
+	cd $D${sysconfdir}/init.d
 
 	echo "Disabling the following sysv scripts: "
 
Signature · 1 line
2.34.1