summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
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:27 +0100
commit559b5a892b219d7a08d69b17ed1b13fd0575d384 (patch)
treefbbab671771cd5a093d5bd394d55b1549b3b0ef4 /meta/lib/oe
parentc5e5ba214ab0b878047d4293e55ad74057c46ae9 (diff)
downloadpoky-559b5a892b219d7a08d69b17ed1b13fd0575d384.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. (From OE-Core rev: 627fb3181edd71502fbdf96549c41b2dea027250) Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-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):
250 250
251 251
252 def _uninstall_unneeded(self): 252 def _uninstall_unneeded(self):
253 # Remove unneeded init script symlinks 253 # Remove the run-postinsts package if no delayed postinsts are found
254 delayed_postinsts = self._get_delayed_postinsts() 254 delayed_postinsts = self._get_delayed_postinsts()
255 if delayed_postinsts is None: 255 if delayed_postinsts is None:
256 if os.path.exists(self.d.expand("${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts")): 256 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")):
257 self._exec_shell_cmd(["update-rc.d", "-f", "-r", 257 self.pm.remove(["run-postinsts"])
258 self.d.getVar('IMAGE_ROOTFS'),
259 "run-postinsts", "remove"])
260 258
261 image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", 259 image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs",
262 True, False, self.d) 260 True, False, self.d)