summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2014-06-17 13:39:05 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-06-17 08:58:54 +0100
commit6a6bd2e96b2622c0517cd33e355e68c64b4b1fa7 (patch)
tree41631c979b693e87c829bcefcf3614764a993df1 /meta
parent3103f04a3028bb5ca02b943e21ef2dbe2cf79e14 (diff)
downloadpoky-6a6bd2e96b2622c0517cd33e355e68c64b4b1fa7.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: d51b1ced88958d31a1596e37db871257fe013446) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-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 dddbef4d64..ebdae7e6e1 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -130,11 +130,19 @@ class Rootfs(object):
130 self._cleanup() 130 self._cleanup()
131 131
132 def _uninstall_uneeded(self): 132 def _uninstall_uneeded(self):
133 # Remove unneeded init script symlinks
134 delayed_postinsts = self._get_delayed_postinsts()
135 if delayed_postinsts is None:
136 if os.path.exists(self.d.expand("${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts")):
137 self._exec_shell_cmd(["update-rc.d", "-f", "-r",
138 self.d.getVar('IMAGE_ROOTFS', True),
139 "run-postinsts", "remove"])
140
141 # Remove unneeded package-management related components
133 if base_contains("IMAGE_FEATURES", "package-management", 142 if base_contains("IMAGE_FEATURES", "package-management",
134 True, False, self.d): 143 True, False, self.d):
135 return 144 return
136 145
137 delayed_postinsts = self._get_delayed_postinsts()
138 if delayed_postinsts is None: 146 if delayed_postinsts is None:
139 installed_pkgs_dir = self.d.expand('${WORKDIR}/installed_pkgs.txt') 147 installed_pkgs_dir = self.d.expand('${WORKDIR}/installed_pkgs.txt')
140 pkgs_to_remove = list() 148 pkgs_to_remove = list()
@@ -154,10 +162,6 @@ class Rootfs(object):
154 # Update installed_pkgs.txt 162 # Update installed_pkgs.txt
155 open(installed_pkgs_dir, "w+").write('\n'.join(pkgs_installed)) 163 open(installed_pkgs_dir, "w+").write('\n'.join(pkgs_installed))
156 164
157 if os.path.exists(self.d.expand("${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts")):
158 self._exec_shell_cmd(["update-rc.d", "-f", "-r",
159 self.d.getVar('IMAGE_ROOTFS', True),
160 "run-postinsts", "remove"])
161 else: 165 else:
162 self._save_postinsts() 166 self._save_postinsts()
163 167