Openembedded Core Discussions
 help / color / mirror / Atom feed
* [daisy][PATCH 0/1] rootfs.py: change the logic in _uninstall_unneeded
@ 2014-06-17  5:39 Chen Qi
  2014-06-17  5:39 ` [daisy][PATCH 1/1] " Chen Qi
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Qi @ 2014-06-17  5:39 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit c19bb1db2eb728899e10a28d10567e9e026ee694:

  gcc: Clean up configure_prepend and fix for mingw (2014-06-16 14:51:24 +0100)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib ChenQi/daisy-rootfs-postinsts
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/daisy-rootfs-postinsts

Chen Qi (1):
  rootfs.py: change the logic in _uninstall_unneeded

 meta/lib/oe/rootfs.py |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

-- 
1.7.9.5



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

* [daisy][PATCH 1/1] rootfs.py: change the logic in _uninstall_unneeded
  2014-06-17  5:39 [daisy][PATCH 0/1] rootfs.py: change the logic in _uninstall_unneeded Chen Qi
@ 2014-06-17  5:39 ` Chen Qi
  0 siblings, 0 replies; 2+ messages in thread
From: Chen Qi @ 2014-06-17  5:39 UTC (permalink / raw)
  To: openembedded-core

Previously, if we have 'package-management' and 'read-only-rootfs'
both in IMAGE_FEATRUES, we would meet the following error at system
start-up.

	rm: can't remove '/etc/rcS.d/S99run-postinsts': Read-only file system

However, what's really expected is that when there's no postinstall
script at system start-up, the /etc/rcS.d/S99run-postinsts should not
even be there.

Whether or not to remove the init script symlinks to run-postinsts should
not depend on whether we have 'package-management' in IMAGE_FEATURES; rather,
it should only depend on whether we have any postinstall script left to run
at system start-up.

This patch changes the _uninstall_unneeded function based on the logic
stated above.

[YOCTO #6257]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/lib/oe/rootfs.py |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index dddbef4..ebdae7e 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -130,11 +130,19 @@ class Rootfs(object):
         self._cleanup()
 
     def _uninstall_uneeded(self):
+        # Remove unneeded init script symlinks
+        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', True),
+                                      "run-postinsts", "remove"])
+
+        # Remove unneeded package-management related components
         if base_contains("IMAGE_FEATURES", "package-management",
                          True, False, self.d):
             return
 
-        delayed_postinsts = self._get_delayed_postinsts()
         if delayed_postinsts is None:
             installed_pkgs_dir = self.d.expand('${WORKDIR}/installed_pkgs.txt')
             pkgs_to_remove = list()
@@ -154,10 +162,6 @@ class Rootfs(object):
                 # Update installed_pkgs.txt
                 open(installed_pkgs_dir, "w+").write('\n'.join(pkgs_installed))
 
-            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', True),
-                                      "run-postinsts", "remove"])
         else:
             self._save_postinsts()
 
-- 
1.7.9.5



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

end of thread, other threads:[~2014-06-17  5:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-17  5:39 [daisy][PATCH 0/1] rootfs.py: change the logic in _uninstall_unneeded Chen Qi
2014-06-17  5:39 ` [daisy][PATCH 1/1] " Chen Qi

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