systemd-compat-units.bb: fix postinstall script

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]

(From OE-Core rev: 0330331a1386fd2a34b410a7f62b29bfc8dc23c4)

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Michael Opdenacker
2023-11-22 11:23:48 +01:00
committed by Richard Purdie
parent e59dcbc114
commit 0769ff28db

View File

@@ -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: "