diff options
| -rw-r--r-- | meta/lib/oe/rootfs.py | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py index 18df22d9a7..c004a5b5dd 100644 --- a/meta/lib/oe/rootfs.py +++ b/meta/lib/oe/rootfs.py | |||
| @@ -243,25 +243,19 @@ class Rootfs(object): | |||
| 243 | # Remove components that we don't need if we're not going to install | 243 | # Remove components that we don't need if we're not going to install |
| 244 | # additional packages at runtime | 244 | # additional packages at runtime |
| 245 | if delayed_postinsts is None: | 245 | if delayed_postinsts is None: |
| 246 | installed_pkgs_dir = self.d.expand('${WORKDIR}/installed_pkgs.txt') | 246 | pkgs_installed = image_list_installed_packages(self.d) |
| 247 | pkgs_to_remove = list() | 247 | pkgs_to_remove = list() |
| 248 | with open(installed_pkgs_dir, "r+") as installed_pkgs: | 248 | for pkg in pkgs_installed.split(): |
| 249 | pkgs_installed = installed_pkgs.read().splitlines() | 249 | if pkg in ["update-rc.d", |
| 250 | for pkg_installed in pkgs_installed[:]: | 250 | "base-passwd", |
| 251 | pkg = pkg_installed.split()[0] | 251 | "shadow", |
| 252 | if pkg in ["update-rc.d", | 252 | "update-alternatives", pkg_to_remove, |
| 253 | "base-passwd", | 253 | self.d.getVar("ROOTFS_BOOTSTRAP_INSTALL", True) |
| 254 | "shadow", | 254 | ]: |
| 255 | "update-alternatives", pkg_to_remove, | 255 | pkgs_to_remove.append(pkg) |
| 256 | self.d.getVar("ROOTFS_BOOTSTRAP_INSTALL", True) | ||
| 257 | ]: | ||
| 258 | pkgs_to_remove.append(pkg) | ||
| 259 | pkgs_installed.remove(pkg_installed) | ||
| 260 | 256 | ||
| 261 | if len(pkgs_to_remove) > 0: | 257 | if len(pkgs_to_remove) > 0: |
| 262 | self.pm.remove(pkgs_to_remove, False) | 258 | self.pm.remove(pkgs_to_remove, False) |
| 263 | # Update installed_pkgs.txt | ||
| 264 | open(installed_pkgs_dir, "w+").write('\n'.join(pkgs_installed)) | ||
| 265 | 259 | ||
| 266 | else: | 260 | else: |
| 267 | self._save_postinsts() | 261 | self._save_postinsts() |
