From 627fb3181edd71502fbdf96549c41b2dea027250 Mon Sep 17 00:00:00 2001 From: Awais Belal Date: Thu, 25 Mar 2021 16:59:32 +0500 Subject: rootfs.py: uninstall the run-postinsts package if not needed The run-postinsts package runs post installation scripts on target if packages request delayed post installations. When no delayed post installations are found the sysV style scripts are disabled for the package and hence it did not run on sysV based systems. However, the package provides systemd service as well which still ran on systems based on systemd even when no post installations were found. Rather than disabling/masking scripts for different initialization managers we now simply remove/uninstall the run-postinsts package when no post installations are found to be delayed till runtime. This is also more aligned with the function (_uninstall_unneeded) this functionality is triggered through. Signed-off-by: Awais Belal Signed-off-by: Richard Purdie --- meta/lib/oe/rootfs.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'meta') diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py index 249c685dcf..5f81023040 100644 --- a/meta/lib/oe/rootfs.py +++ b/meta/lib/oe/rootfs.py @@ -250,13 +250,11 @@ class Rootfs(object, metaclass=ABCMeta): def _uninstall_unneeded(self): - # Remove unneeded init script symlinks + # Remove the run-postinsts package if no delayed postinsts are found delayed_postinsts = self._get_delayed_postinsts() if delayed_postinsts is None: - if os.path.exists(self.d.expand("${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts")): - self._exec_shell_cmd(["update-rc.d", "-f", "-r", - self.d.getVar('IMAGE_ROOTFS'), - "run-postinsts", "remove"]) + if os.path.exists(self.d.expand("${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts")) or os.path.exists(self.d.expand("${IMAGE_ROOTFS}${systemd_unitdir}/system/run-postinsts.service")): + self.pm.remove(["run-postinsts"]) image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", True, False, self.d) -- cgit 1.2.3-korg