Files
poky/meta/recipes-core/systemd/systemd-compat-units.bb
Alexander Kanavin 21a9165058 systemd-compat-units: execute postinst on target
There is a race here where postinst relies on existence of
various files from other packages on the target rootfs to
operate properly, but doesn't ensure that it runs after all
of those packages have been installed. Adding dependencies
on those packages is not a solution as the recipe
is not supposed to bring them into rootfs, only make
adjustments if they are present.

This commit moves postinst execution to the first boot; another
solution would be to replace the whole recipe with ROOTFS_POSTPROCESS_COMMAND.

This was exposed with rpm 4.20 which rearranges the order
in which packages are installed, and exposes the issue.

(From OE-Core rev: e88f22da19a7f3f9bf23f2a607ffde6b5b1a3265)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-12 13:22:08 +00:00

52 lines
1.0 KiB
BlitzBasic

SUMMARY = "Enhances systemd compatilibity with existing SysVinit scripts"
HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd"
LICENSE = "MIT"
PACKAGE_WRITE_DEPS += "systemd-systemctl-native"
S = "${WORKDIR}/sources"
UNPACKDIR = "${S}"
inherit features_check
INHIBIT_DEFAULT_DEPS = "1"
ALLOW_EMPTY:${PN} = "1"
REQUIRED_DISTRO_FEATURES += "systemd"
REQUIRED_DISTRO_FEATURES += "usrmerge"
SYSTEMD_DISABLED_SYSV_SERVICES = " \
busybox-udhcpc \
hwclock \
networking \
nfsserver \
nfscommon \
syslog.busybox \
"
pkg_postinst_ontarget:${PN} () {
test -d $D${sysconfdir}/init.d || exit 0
cd $D${sysconfdir}/init.d
echo "Disabling the following sysv scripts: "
if [ -n "$D" ]; then
OPTS="--root=$D"
else
OPTS=""
fi
for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do
if [ -e $i -o -e $i.sh ] && ! [ -e $D${sysconfdir}/systemd/system/$i.service -o -e $D${systemd_system_unitdir}/$i.service ] ; then
echo -n "$i: "
systemctl $OPTS mask $i.service
fi
done
echo
}
RDEPENDS:${PN} = "systemd"