aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2014-03-28 12:10:44 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-28 11:01:32 +0000
commit6151d69875f3f4f097b6e2fdef2a0f3ab391e2fd (patch)
tree34fe7589ed6b9619e6d5d566ed099f91415927d8 /meta/lib
parent12e300f0af2a27c15d80298d3fbb27b092c35154 (diff)
downloadopenembedded-core-6151d69875f3f4f097b6e2fdef2a0f3ab391e2fd.tar.gz
rootfs.py: add new cleanup method
This commit adds a new _cleanup() internal method that will be called at the end of rootfs creation, so that each backend can delete various files that were probably generated during rootfs postprocess execution, etc. [YOCTO #6049] Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/rootfs.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 0e6c8bc2f0..3eac3c947d 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -50,6 +50,15 @@ class Rootfs(object):
def _handle_intercept_failure(self, failed_script):
pass
+ """
+ The _cleanup() method should be used to clean-up stuff that we don't really
+ want to end up on target. For example, in the case of RPM, the DB locks.
+ The method is called, once, at the end of create() method.
+ """
+ @abstractmethod
+ def _cleanup(self):
+ pass
+
def _exec_shell_cmd(self, cmd):
fakerootcmd = self.d.getVar('FAKEROOT', True)
if fakerootcmd is not None:
@@ -117,6 +126,8 @@ class Rootfs(object):
self._generate_kernel_module_deps()
+ self._cleanup()
+
def _uninstall_uneeded(self):
if base_contains("IMAGE_FEATURES", "package-management",
True, False, self.d):
@@ -358,6 +369,13 @@ class RpmRootfs(Rootfs):
for pkg in registered_pkgs.split():
self.pm.save_rpmpostinst(pkg)
+ def _cleanup(self):
+ # during the execution of postprocess commands, rpm is called several
+ # times to get the files installed, dependencies, etc. This creates the
+ # __db.00* (Berkeley DB files that hold locks, rpm specific environment
+ # settings, etc.), that should not get into the final rootfs
+ self.pm.unlock_rpm_db()
+
class DpkgRootfs(Rootfs):
def __init__(self, d, manifest_dir):
@@ -431,6 +449,9 @@ class DpkgRootfs(Rootfs):
def _log_check(self):
pass
+ def _cleanup(self):
+ pass
+
class OpkgRootfs(Rootfs):
def __init__(self, d, manifest_dir):
@@ -694,6 +715,10 @@ class OpkgRootfs(Rootfs):
def _log_check(self):
pass
+ def _cleanup(self):
+ pass
+
+
def create_rootfs(d, manifest_dir=None):
env_bkp = os.environ.copy()