]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
systemd-compat-units: execute postinst on target
authorAlexander Kanavin <alex@linutronix.de>
Wed, 4 Dec 2024 06:48:50 +0000 (07:48 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 12 Dec 2024 13:22:05 +0000 (13:22 +0000)
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.

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>
meta/recipes-core/systemd/systemd-compat-units.bb

index b929545823738a9f0196d82f507ff9c5127179a9..3325739544023cc29f49957d49175c5f3524f00e 100644 (file)
@@ -26,7 +26,7 @@ SYSTEMD_DISABLED_SYSV_SERVICES = " \
   syslog.busybox \
 "
 
-pkg_postinst:${PN} () {
+pkg_postinst_ontarget:${PN} () {
 
        test -d $D${sysconfdir}/init.d  ||  exit 0
        cd $D${sysconfdir}/init.d