summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/rootfs.py
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2014-06-11 17:29:27 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-06-13 12:31:37 +0100
commit51d450f0a73003eb756152a3d8045cb8cda5142c (patch)
treea05e98788428e9cf81e04eafd1496229ddfb82c4 /meta/lib/oe/rootfs.py
parente16352220572835ff2185cf992518fb4f3b2de0e (diff)
downloadpoky-51d450f0a73003eb756152a3d8045cb8cda5142c.tar.gz
rootfs.py: change the logic in _uninstall_unneeded
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] (From OE-Core rev: 6c2f7ecee754ff3f29fdde17c0363f5d138057ff) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/rootfs.py')
-rw-r--r--meta/lib/oe/rootfs.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 3d1111a40a..bc2524f593 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -129,11 +129,19 @@ class Rootfs(object):
129 self._cleanup() 129 self._cleanup()
130 130
131 def _uninstall_uneeded(self): 131 def _uninstall_uneeded(self):
132 # Remove unneeded init script symlinks
133 delayed_postinsts = self._get_delayed_postinsts()
134 if delayed_postinsts is None:
135 if os.path.exists(self.d.expand("${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts")):
136 self._exec_shell_cmd(["update-rc.d", "-f", "-r",
137 self.d.getVar('IMAGE_ROOTFS', True),
138 "run-postinsts", "remove"])
139
140 # Remove unneeded package-management related components
132 if bb.utils.contains("IMAGE_FEATURES", "package-management", 141 if bb.utils.contains("IMAGE_FEATURES", "package-management",
133 True, False, self.d): 142 True, False, self.d):
134 return 143 return
135 144
136 delayed_postinsts = self._get_delayed_postinsts()
137 if delayed_postinsts is None: 145 if delayed_postinsts is None:
138 installed_pkgs_dir = self.d.expand('${WORKDIR}/installed_pkgs.txt') 146 installed_pkgs_dir = self.d.expand('${WORKDIR}/installed_pkgs.txt')
139 pkgs_to_remove = list() 147 pkgs_to_remove = list()
@@ -153,10 +161,6 @@ class Rootfs(object):
153 # Update installed_pkgs.txt 161 # Update installed_pkgs.txt
154 open(installed_pkgs_dir, "w+").write('\n'.join(pkgs_installed)) 162 open(installed_pkgs_dir, "w+").write('\n'.join(pkgs_installed))
155 163
156 if os.path.exists(self.d.expand("${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts")):
157 self._exec_shell_cmd(["update-rc.d", "-f", "-r",
158 self.d.getVar('IMAGE_ROOTFS', True),
159 "run-postinsts", "remove"])
160 else: 164 else:
161 self._save_postinsts() 165 self._save_postinsts()
162 166