All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rootfs: remove ldconfig auxiliary cache where appropriate
@ 2021-07-22  9:48 Damian Wrobel
  2021-07-22 19:00 ` [OE-core] " Andre McCurdy
  2021-07-22 22:37 ` Alexandre Belloni
  0 siblings, 2 replies; 10+ messages in thread
From: Damian Wrobel @ 2021-07-22  9:48 UTC (permalink / raw)
  To: openembedded-core

Removes the /var/cache/ldconfig auxiliary cache directory from
the rootfs when:
 - read-only-rootfs is in DISTRO_FEATURES,
 - ldconfig is not in DISTRO_FEATURES.

In both cases the /var/cache/ldconfig/aux-cache is useless.

Signed-off-by: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
---
 meta/lib/oe/rootfs.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index ad9fd77c8b..80673fab3f 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -302,6 +302,15 @@ class Rootfs(object, metaclass=ABCMeta):
             self._exec_shell_cmd(['ldconfig', '-r', self.image_rootfs, '-c',
                                   'new', '-v', '-X'])
 
+        image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs",
+                                        True, False, self.d)
+        ldconfig_in_features = bb.utils.contains("IMAGE_FEATURES", "ldconfig",
+                                                 True, False, self.d)
+        if image_rorfs or not ldconfig_in_features:
+            ldconfig_cache_dir = os.path.join(self.image_rootfs, "var/cache/ldconfig")
+            bb.note("Removing ldconfig auxiliary cache...")
+            shutil.rmtree(ldconfig_cache_dir)
+
     def _check_for_kernel_modules(self, modules_dir):
         for root, dirs, files in os.walk(modules_dir, topdown=True):
             for name in files:
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-07-27 10:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22  9:48 [PATCH] rootfs: remove ldconfig auxiliary cache where appropriate Damian Wrobel
2021-07-22 19:00 ` [OE-core] " Andre McCurdy
2021-07-23  9:16   ` Damian Wrobel
2021-07-23 18:15     ` Andre McCurdy
2021-07-22 22:37 ` Alexandre Belloni
2021-07-23  9:18   ` Damian Wrobel
2021-07-23  9:21   ` [PATCH v2] " Damian Wrobel
2021-07-23 18:21     ` [OE-core] " Andre McCurdy
2021-07-27 10:11       ` Damian Wrobel
2021-07-27 10:11   ` [PATCH v3] " Damian Wrobel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.