summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
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-30 10:10:32 +0100
commita56d8e9edef7109628bac54d07febc08ba522447 (patch)
treeb800320d2b92de10ecd89a4be7c9533cba8cbc42 /meta/lib/oe
parenta5994c0837061440f79eff4a0a96e8769c2b22ee (diff)
downloadpoky-a56d8e9edef7109628bac54d07febc08ba522447.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] (From OE-Core rev: 6151d69875f3f4f097b6e2fdef2a0f3ab391e2fd) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-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):
50 def _handle_intercept_failure(self, failed_script): 50 def _handle_intercept_failure(self, failed_script):
51 pass 51 pass
52 52
53 """
54 The _cleanup() method should be used to clean-up stuff that we don't really
55 want to end up on target. For example, in the case of RPM, the DB locks.
56 The method is called, once, at the end of create() method.
57 """
58 @abstractmethod
59 def _cleanup(self):
60 pass
61
53 def _exec_shell_cmd(self, cmd): 62 def _exec_shell_cmd(self, cmd):
54 fakerootcmd = self.d.getVar('FAKEROOT', True) 63 fakerootcmd = self.d.getVar('FAKEROOT', True)
55 if fakerootcmd is not None: 64 if fakerootcmd is not None:
@@ -117,6 +126,8 @@ class Rootfs(object):
117 126
118 self._generate_kernel_module_deps() 127 self._generate_kernel_module_deps()
119 128
129 self._cleanup()
130
120 def _uninstall_uneeded(self): 131 def _uninstall_uneeded(self):
121 if base_contains("IMAGE_FEATURES", "package-management", 132 if base_contains("IMAGE_FEATURES", "package-management",
122 True, False, self.d): 133 True, False, self.d):
@@ -358,6 +369,13 @@ class RpmRootfs(Rootfs):
358 for pkg in registered_pkgs.split(): 369 for pkg in registered_pkgs.split():
359 self.pm.save_rpmpostinst(pkg) 370 self.pm.save_rpmpostinst(pkg)
360 371
372 def _cleanup(self):
373 # during the execution of postprocess commands, rpm is called several
374 # times to get the files installed, dependencies, etc. This creates the
375 # __db.00* (Berkeley DB files that hold locks, rpm specific environment
376 # settings, etc.), that should not get into the final rootfs
377 self.pm.unlock_rpm_db()
378
361 379
362class DpkgRootfs(Rootfs): 380class DpkgRootfs(Rootfs):
363 def __init__(self, d, manifest_dir): 381 def __init__(self, d, manifest_dir):
@@ -431,6 +449,9 @@ class DpkgRootfs(Rootfs):
431 def _log_check(self): 449 def _log_check(self):
432 pass 450 pass
433 451
452 def _cleanup(self):
453 pass
454
434 455
435class OpkgRootfs(Rootfs): 456class OpkgRootfs(Rootfs):
436 def __init__(self, d, manifest_dir): 457 def __init__(self, d, manifest_dir):
@@ -694,6 +715,10 @@ class OpkgRootfs(Rootfs):
694 def _log_check(self): 715 def _log_check(self):
695 pass 716 pass
696 717
718 def _cleanup(self):
719 pass
720
721
697def create_rootfs(d, manifest_dir=None): 722def create_rootfs(d, manifest_dir=None):
698 env_bkp = os.environ.copy() 723 env_bkp = os.environ.copy()
699 724