Skip to contentSkip to conversation

rootfs.py: allow removal of unneeded packages

PATCH Superseded Stephano Cetola 1 participant 2 messages Aug 17, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 rootfs.py: allow removal of unneeded packages

Paul and I had a discussion about this a couple weeks ago. We want to allow for the removal of certain packages, regardless of the image features containing "read-only-rootfs".

For example, if something has a runtime dependency on update-rc.d or shadow, we need a way to remove these packages regardless of this dependency.

Here is my idea for documenting the new variable:

FORCE_RO_REMOVE
Setting this variable to "1" will force the removal of the packages listed in ROOTFS_RO_UNNEEDED during the generation of the rootfs.

I have purposely kept ROOTFS_RO_UNNEEDED from being easily overridden, as this would have allowed users to remove packages on a whim, which may be giving them just enough rope to hang themselves.

That being said, IMHO this patch adds some flexibility without adding serious complexity or avenues for confusion.

Stephano Cetola (1):
rootfs.py: allow removal of unneeded packages

 meta/lib/oe/rootfs.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.9.3
#1 lore raw

PATCH v5 1/1 rootfs.py: allow removal of unneeded packages

Current functionality allows for the removal of certain packages based on the read-only image feature. This patch extends this functionality by adding the FORCE_RO_REMOVE variable, which will remove these packages regardless of any image features.

[ YOCTO #9491 ]

---
 meta/lib/oe/rootfs.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/lib/oe/rootfs.py +3 -1
index ed0bab1..7c620e9 100644
@@ -253,7 +253,9 @@ class Rootfs(object, metaclass=ABCMeta):
 
         image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs",
                                         True, False, self.d)
-        if image_rorfs:
+        image_rorfs_force = self.d.getVar('FORCE_RO_REMOVE', True)
+
+        if image_rorfs or image_rorfs_force == "1":
             # Remove components that we don't need if it's a read-only rootfs
             unneeded_pkgs = self.d.getVar("ROOTFS_RO_UNNEEDED", True).split()
             pkgs_installed = image_list_installed_packages(self.d)
Signature · 1 line
2.9.3