summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oe/rootfs.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 274ddb8105..5b842ba46a 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -262,7 +262,12 @@ class Rootfs(object, metaclass=ABCMeta):
262 # Remove components that we don't need if it's a read-only rootfs 262 # Remove components that we don't need if it's a read-only rootfs
263 unneeded_pkgs = self.d.getVar("ROOTFS_RO_UNNEEDED").split() 263 unneeded_pkgs = self.d.getVar("ROOTFS_RO_UNNEEDED").split()
264 pkgs_installed = image_list_installed_packages(self.d) 264 pkgs_installed = image_list_installed_packages(self.d)
265 pkgs_to_remove = [pkg for pkg in pkgs_installed if pkg in unneeded_pkgs] 265 # Make sure update-alternatives is last on the command line, so
266 # that it is removed last. This makes sure that its database is
267 # available while uninstalling packages, allowing alternative
268 # symlinks of packages to be uninstalled to be managed correctly.
269 provider = self.d.getVar("VIRTUAL-RUNTIME_update-alternatives")
270 pkgs_to_remove = sorted([pkg for pkg in pkgs_installed if pkg in unneeded_pkgs], key=lambda x: x == provider)
266 271
267 if len(pkgs_to_remove) > 0: 272 if len(pkgs_to_remove) > 0:
268 self.pm.remove(pkgs_to_remove, False) 273 self.pm.remove(pkgs_to_remove, False)