diff options
Diffstat (limited to 'meta/lib/oe')
-rw-r--r-- | meta/lib/oe/rootfs.py | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py index 0f835d311b..bfae1d8e89 100644 --- a/meta/lib/oe/rootfs.py +++ b/meta/lib/oe/rootfs.py | |||
@@ -238,28 +238,13 @@ class Rootfs(object): | |||
238 | self.d.getVar('IMAGE_ROOTFS', True), | 238 | self.d.getVar('IMAGE_ROOTFS', True), |
239 | "run-postinsts", "remove"]) | 239 | "run-postinsts", "remove"]) |
240 | 240 | ||
241 | runtime_pkgmanage = bb.utils.contains("IMAGE_FEATURES", "package-management", | ||
242 | True, False, self.d) | ||
243 | sysvcompat_in_distro = bb.utils.contains("DISTRO_FEATURES", [ "systemd", "sysvinit" ], | ||
244 | True, False, self.d) | ||
245 | image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", | 241 | image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", |
246 | True, False, self.d) | 242 | True, False, self.d) |
247 | if sysvcompat_in_distro and not image_rorfs: | ||
248 | pkg_to_remove = "" | ||
249 | else: | ||
250 | pkg_to_remove = "update-rc.d" | ||
251 | if image_rorfs: | 243 | if image_rorfs: |
252 | # Remove components that we don't need if it's a read-only rootfs | 244 | # Remove components that we don't need if it's a read-only rootfs |
245 | unneeded_pkgs = self.d.getVar("ROOTFS_RO_UNNEEDED", True).split() | ||
253 | pkgs_installed = image_list_installed_packages(self.d) | 246 | pkgs_installed = image_list_installed_packages(self.d) |
254 | pkgs_to_remove = list() | 247 | pkgs_to_remove = [pkg for pkg in pkgs_installed if pkg in unneeded_pkgs] |
255 | for pkg in pkgs_installed: | ||
256 | if pkg in ["update-rc.d", | ||
257 | "base-passwd", | ||
258 | "shadow", | ||
259 | "update-alternatives", pkg_to_remove, | ||
260 | self.d.getVar("ROOTFS_BOOTSTRAP_INSTALL", True) | ||
261 | ]: | ||
262 | pkgs_to_remove.append(pkg) | ||
263 | 248 | ||
264 | if len(pkgs_to_remove) > 0: | 249 | if len(pkgs_to_remove) > 0: |
265 | self.pm.remove(pkgs_to_remove, False) | 250 | self.pm.remove(pkgs_to_remove, False) |
@@ -273,6 +258,8 @@ class Rootfs(object): | |||
273 | post_uninstall_cmds = self.d.getVar("ROOTFS_POSTUNINSTALL_COMMAND", True) | 258 | post_uninstall_cmds = self.d.getVar("ROOTFS_POSTUNINSTALL_COMMAND", True) |
274 | execute_pre_post_process(self.d, post_uninstall_cmds) | 259 | execute_pre_post_process(self.d, post_uninstall_cmds) |
275 | 260 | ||
261 | runtime_pkgmanage = bb.utils.contains("IMAGE_FEATURES", "package-management", | ||
262 | True, False, self.d) | ||
276 | if not runtime_pkgmanage: | 263 | if not runtime_pkgmanage: |
277 | # Remove the package manager data files | 264 | # Remove the package manager data files |
278 | self.pm.remove_packaging_data() | 265 | self.pm.remove_packaging_data() |