Re: [OE-core] [PATCH v2] rootfs: remove ldconfig auxiliary cache where appropriate

2021-07-27 Thread Damian Wrobel



  On Fri, 23 Jul 2021 20:21:28 +0200 Andre McCurdy  
wrote 
 > On Fri, Jul 23, 2021 at 2:22 AM Damian Wrobel
 >  wrote:
 > >
 > > 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.
 > 
 > Comments say DISTRO_FEATURES but code is checking IMAGE_FEATURES in both 
 > cases.
 > 
 > ldconfig is a distro feature and read-only-rootfs is an image feature,
 > so both the comments and code seem to be wrong...
Copy-paste side effect. Thanks for pointing this out. Fixed in v3.

--
Regards,
Damian
 > 
 > > In both cases the /var/cache/ldconfig/aux-cache is useless.
 > >
 > > Signed-off-by: Damian Wrobel 
 > > ---
 > >  meta/lib/oe/rootfs.py | 10 ++
 > >  1 file changed, 10 insertions(+)
 > >
 > > diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
 > > index ad9fd77c8b..8e63ebac9b 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("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")
 > > +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:
 > > --
 > > 2.31.1
 > >
 > >
 > > 
 > >
 > 
 > 
 > 
 > 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#154155): 
https://lists.openembedded.org/g/openembedded-core/message/154155
Mute This Topic: https://lists.openembedded.org/mt/84397515/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH v2] rootfs: remove ldconfig auxiliary cache where appropriate

2021-07-23 Thread Andre McCurdy
On Fri, Jul 23, 2021 at 2:22 AM Damian Wrobel
 wrote:
>
> 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.

Comments say DISTRO_FEATURES but code is checking IMAGE_FEATURES in both cases.

ldconfig is a distro feature and read-only-rootfs is an image feature,
so both the comments and code seem to be wrong...

> In both cases the /var/cache/ldconfig/aux-cache is useless.
>
> Signed-off-by: Damian Wrobel 
> ---
>  meta/lib/oe/rootfs.py | 10 ++
>  1 file changed, 10 insertions(+)
>
> diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
> index ad9fd77c8b..8e63ebac9b 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("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")
> +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:
> --
> 2.31.1
>
>
> 
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#154119): 
https://lists.openembedded.org/g/openembedded-core/message/154119
Mute This Topic: https://lists.openembedded.org/mt/84397515/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH v2] rootfs: remove ldconfig auxiliary cache where appropriate

2021-07-23 Thread Damian Wrobel
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 
---
 meta/lib/oe/rootfs.py | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index ad9fd77c8b..8e63ebac9b 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("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")
+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:
-- 
2.31.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#154109): 
https://lists.openembedded.org/g/openembedded-core/message/154109
Mute This Topic: https://lists.openembedded.org/mt/84397515/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-