mirror of
https://git.yoctoproject.org/poky
synced 2026-04-21 12:32:15 +02:00
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>
This commit is contained in:
@@ -129,11 +129,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 bb.utils.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()
|
||||
@@ -153,10 +161,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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user