Skip to contentSkip to conversation

package_manager: expand the removal list for RPM

PATCH New Ross Burton 1 participant 2 messages Apr 27, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package_manager: expand the removal list for RPM

If package management is disabled we remove the state and configuration for the package manager after the rootfs has been populated. This list wasn't complete and the DNF/RPM configuration files were left behind.

---
 meta/lib/oe/package_manager.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oe/package_manager.py +1 -1
index 2d8aeba037c..813f6799fef 100644
@@ -668,7 +668,7 @@ class RpmPM(PackageManager):
         self.saved_packaging_data = self.d.expand('${T}/saved_packaging_data/%s' % self.task_name)
         if not os.path.exists(self.d.expand('${T}/saved_packaging_data')):
             bb.utils.mkdirhier(self.d.expand('${T}/saved_packaging_data'))
-        self.packaging_data_dirs = ['var/lib/rpm', 'var/lib/dnf', 'var/cache/dnf']
+        self.packaging_data_dirs = ['etc/rpm', 'etc/rpmrc', 'etc/dnf', 'var/lib/rpm', 'var/lib/dnf', 'var/cache/dnf']
         self.solution_manifest = self.d.expand('${T}/saved/%s_solution' %
                                                self.task_name)
         if not os.path.exists(self.d.expand('${T}/saved')):
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/2 rootfs: only use dnf to cleanup if package management is enabled

If package management has been disabled then we've already removed all the state, and running 'dnf clean all' again will simply recreate a lot of the files.

---
 meta/lib/oe/rootfs.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/lib/oe/rootfs.py +2 -1
index f8f717c0505..c51e76ddfcb 100644
@@ -472,7 +472,8 @@ class RpmRootfs(Rootfs):
         self._log_check_error()
 
     def _cleanup(self):
-        self.pm._invoke_dnf(["clean", "all"])
+        if bb.utils.contains("IMAGE_FEATURES", "package-management", True, False, self.d):
+            self.pm._invoke_dnf(["clean", "all"])
 
 
 class DpkgOpkgRootfs(Rootfs):
Signature · 1 line
2.11.0