mirror of
https://git.yoctoproject.org/poky
synced 2026-05-31 12:49:46 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
23083e7e5e
commit
9c0186fd57
+19
-18
@@ -239,26 +239,27 @@ class Rootfs(object):
|
|||||||
pkg_to_remove = ""
|
pkg_to_remove = ""
|
||||||
else:
|
else:
|
||||||
pkg_to_remove = "update-rc.d"
|
pkg_to_remove = "update-rc.d"
|
||||||
if not runtime_pkgmanage:
|
if image_rorfs:
|
||||||
# Remove components that we don't need if we're not going to install
|
# Remove components that we don't need if it's a read-only rootfs
|
||||||
# additional packages at runtime
|
pkgs_installed = image_list_installed_packages(self.d)
|
||||||
if delayed_postinsts is None:
|
pkgs_to_remove = list()
|
||||||
pkgs_installed = image_list_installed_packages(self.d)
|
for pkg in pkgs_installed.split():
|
||||||
pkgs_to_remove = list()
|
if pkg in ["update-rc.d",
|
||||||
for pkg in pkgs_installed.split():
|
"base-passwd",
|
||||||
if pkg in ["update-rc.d",
|
"shadow",
|
||||||
"base-passwd",
|
"update-alternatives", pkg_to_remove,
|
||||||
"shadow",
|
self.d.getVar("ROOTFS_BOOTSTRAP_INSTALL", True)
|
||||||
"update-alternatives", pkg_to_remove,
|
]:
|
||||||
self.d.getVar("ROOTFS_BOOTSTRAP_INSTALL", True)
|
pkgs_to_remove.append(pkg)
|
||||||
]:
|
|
||||||
pkgs_to_remove.append(pkg)
|
|
||||||
|
|
||||||
if len(pkgs_to_remove) > 0:
|
if len(pkgs_to_remove) > 0:
|
||||||
self.pm.remove(pkgs_to_remove, False)
|
self.pm.remove(pkgs_to_remove, False)
|
||||||
|
|
||||||
else:
|
if delayed_postinsts:
|
||||||
self._save_postinsts()
|
self._save_postinsts()
|
||||||
|
if image_rorfs:
|
||||||
|
bb.warn("There are post install scripts "
|
||||||
|
"in a read-only rootfs")
|
||||||
|
|
||||||
post_uninstall_cmds = self.d.getVar("ROOTFS_POSTUNINSTALL_COMMAND", True)
|
post_uninstall_cmds = self.d.getVar("ROOTFS_POSTUNINSTALL_COMMAND", True)
|
||||||
execute_pre_post_process(self.d, post_uninstall_cmds)
|
execute_pre_post_process(self.d, post_uninstall_cmds)
|
||||||
|
|||||||
Reference in New Issue
Block a user