diff options
author | Mariano Lopez <mariano.lopez@linux.intel.com> | 2015-11-26 09:34:59 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-12-12 23:42:51 +0000 |
commit | 9c0186fd57fe6b8ed7b4de7645fdadfc2e5db149 (patch) | |
tree | 3979a5792d4119b434fba5c079fbca6d944f7a15 /meta | |
parent | 23083e7e5e3a8ee81b346b2ee6084d9fc83e66b5 (diff) | |
download | poky-9c0186fd57fe6b8ed7b4de7645fdadfc2e5db149.tar.gz |
rootfs.py: Change logic to unistall packages
In the current state some of the base utils (update-rc.d,
base-passwd, shadow, and update-alternatives) are unistalled
when there is no package manager in the image. Checking for
previous commits, the unistall of these utils were to be
done in a read-only filesystem.
It is a valid option to have these utils without a package
manager, and also make sense to remove them when building a
read-only filesystem.
This changes the check logic from having a package mananger
to if is a read-only filesystem to remove the utils.
Another change implemented with this patch is that delayed
post installs now doesn't depend if there is a package manager.
Also it is a valid option to have post install scripts without
package manger.
[YOCTO #8235]
(From OE-Core rev: 5aae19959a443c6ac4b0feef10715c8acf3c6376)
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oe/rootfs.py | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py index c004a5b5dd..a2af3325ee 100644 --- a/meta/lib/oe/rootfs.py +++ b/meta/lib/oe/rootfs.py | |||
@@ -239,26 +239,27 @@ class Rootfs(object): | |||
239 | pkg_to_remove = "" | 239 | pkg_to_remove = "" |
240 | else: | 240 | else: |
241 | pkg_to_remove = "update-rc.d" | 241 | pkg_to_remove = "update-rc.d" |
242 | if not runtime_pkgmanage: | 242 | if image_rorfs: |
243 | # Remove components that we don't need if we're not going to install | 243 | # Remove components that we don't need if it's a read-only rootfs |
244 | # additional packages at runtime | 244 | pkgs_installed = image_list_installed_packages(self.d) |
245 | if delayed_postinsts is None: | 245 | pkgs_to_remove = list() |
246 | pkgs_installed = image_list_installed_packages(self.d) | 246 | for pkg in pkgs_installed.split(): |
247 | pkgs_to_remove = list() | 247 | if pkg in ["update-rc.d", |
248 | for pkg in pkgs_installed.split(): | 248 | "base-passwd", |
249 | if pkg in ["update-rc.d", | 249 | "shadow", |
250 | "base-passwd", | 250 | "update-alternatives", pkg_to_remove, |
251 | "shadow", | 251 | self.d.getVar("ROOTFS_BOOTSTRAP_INSTALL", True) |
252 | "update-alternatives", pkg_to_remove, | 252 | ]: |
253 | self.d.getVar("ROOTFS_BOOTSTRAP_INSTALL", True) | 253 | pkgs_to_remove.append(pkg) |
254 | ]: | 254 | |
255 | pkgs_to_remove.append(pkg) | 255 | if len(pkgs_to_remove) > 0: |
256 | 256 | self.pm.remove(pkgs_to_remove, False) | |
257 | if len(pkgs_to_remove) > 0: | 257 | |
258 | self.pm.remove(pkgs_to_remove, False) | 258 | if delayed_postinsts: |
259 | 259 | self._save_postinsts() | |
260 | else: | 260 | if image_rorfs: |
261 | self._save_postinsts() | 261 | bb.warn("There are post install scripts " |
262 | "in a read-only rootfs") | ||
262 | 263 | ||
263 | post_uninstall_cmds = self.d.getVar("ROOTFS_POSTUNINSTALL_COMMAND", True) | 264 | post_uninstall_cmds = self.d.getVar("ROOTFS_POSTUNINSTALL_COMMAND", True) |
264 | execute_pre_post_process(self.d, post_uninstall_cmds) | 265 | execute_pre_post_process(self.d, post_uninstall_cmds) |