summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorAwais Belal <Awais_Belal@mentor.com>2021-03-25 16:59:32 +0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-28 22:28:09 +0100
commit627fb3181edd71502fbdf96549c41b2dea027250 (patch)
tree64506f5d1bea1aa5730d8afea943ace6b99bea53 /meta/lib
parent557d956743ecf5e1d002ae0b2135b1307736b7c8 (diff)
downloadopenembedded-core-627fb3181edd71502fbdf96549c41b2dea027250.tar.gz
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 <awais_belal@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/rootfs.py8
1 files changed, 3 insertions, 5 deletions
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)