From 5b267b39837d3d19a6502b978f92f9310190d1d5 Mon Sep 17 00:00:00 2001 From: Damian Wrobel Date: Tue, 27 Jul 2021 12:11:46 +0200 Subject: rootfs: remove ldconfig auxiliary cache where appropriate Removes the /var/cache/ldconfig auxiliary cache directory from the rootfs when: - read-only-rootfs is in IMAGE_FEATURES, - ldconfig is not in DISTRO_FEATURES. In both cases the /var/cache/ldconfig/aux-cache is useless. (From OE-Core rev: e7a18904582b27fd12a437ff4d8d25c625af7696) Signed-off-by: Damian Wrobel Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- meta/lib/oe/rootfs.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'meta/lib/oe') diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py index ad9fd77c8b..4ea5adb9f4 100644 --- a/meta/lib/oe/rootfs.py +++ b/meta/lib/oe/rootfs.py @@ -302,6 +302,16 @@ 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("DISTRO_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") + if os.path.exists(ldconfig_cache_dir): + 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: -- cgit v1.2.3-54-g00ecf