Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v2] rootfs.py: mask run-postinsts systemd service when unneeded
@ 2021-03-22 12:00 Awais Belal
  2021-03-23 12:21 ` [OE-core] " Oleksiy Obitotskyy
  0 siblings, 1 reply; 3+ messages in thread
From: Awais Belal @ 2021-03-22 12:00 UTC (permalink / raw)
  To: openembedded-core

The service is unnecessarily run even when it is unneeded.
This was handled correctly for sysV systems however the
service still runs on the systemd systems as it is not
disabled/masked when not needed.

Signed-off-by: Awais Belal <awais_belal@mentor.com>
---
 meta/lib/oe/rootfs.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 249c685dcf..fe35ce5b70 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -257,6 +257,10 @@ class Rootfs(object, metaclass=ABCMeta):
                 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}${systemd_unitdir}/system/run-postinsts.service")):
+                self._exec_shell_cmd(["systemctl",
+                                        "--root", self.d.getVar('IMAGE_ROOTFS'),
+                                        "mask", "run-postinsts.service"])
 
         image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs",
                                         True, False, self.d)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-25 12:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-22 12:00 [PATCH v2] rootfs.py: mask run-postinsts systemd service when unneeded Awais Belal
2021-03-23 12:21 ` [OE-core] " Oleksiy Obitotskyy
2021-03-25 12:10   ` Awais Belal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox