summaryrefslogtreecommitdiff
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorStephano Cetola <stephano.cetola@linux.intel.com>2016-08-10 13:03:16 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-11 13:36:06 +0100
commita92c196449c516fe51786d429078bbb1213bb029 (patch)
treeed7a7309c9bf4c675c7e42cafcc68eff618c0f70 /meta/lib/oe
parentc47288615c05aeec46ced39b2853cdd436703dec (diff)
downloadopenembedded-core-a92c196449c516fe51786d429078bbb1213bb029.tar.gz
openembedded-core-a92c196449c516fe51786d429078bbb1213bb029.tar.bz2
openembedded-core-a92c196449c516fe51786d429078bbb1213bb029.zip
Allow for simultaneous do_rootfs tasks with rpmuninative-1.3
Give each rootfs its own RPM channel to use. This puts the RPM metadata in a private subdirectory of $WORKDIR, rather than living in DEPLOY_DIR where other tasks may race with it. This allows us to reduce the time that the rpm.lock is held to only the time needed to hardlink the RPMs, allowing the majority of the rootfs operation to run in parallel. Also, this fixes the smart tests by generating an index for all packages at the time of the test, rather than using the one provided by the rootfs process. Original credit for the enhancement should go to Steven Walter stevenrwalter@gmail.com. Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/package_manager.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 47f6831f98..2802254f1f 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -9,6 +9,7 @@ import collections
import bb
import tempfile
import oe.utils
+import oe.path
import string
from oe.gpg_sign import get_signer
@@ -175,7 +176,7 @@ class RpmIndexer(Indexer):
dbpath = os.path.join(self.d.getVar('WORKDIR', True), 'rpmdb', arch)
if os.path.exists(dbpath):
bb.utils.remove(dbpath, True)
- arch_dir = os.path.join(self.deploy_dir, arch)
+ arch_dir = os.path.join(self.d.getVar('WORKDIR', True), 'rpms', arch)
if not os.path.isdir(arch_dir):
continue
@@ -1010,8 +1011,18 @@ class RpmPM(PackageManager):
ch_already_added = []
for canonical_arch in platform_extra:
arch = canonical_arch.split('-')[0]
- arch_channel = os.path.join(self.deploy_dir, arch)
- if os.path.exists(arch_channel) and not arch in ch_already_added:
+ arch_channel = os.path.join(self.d.getVar('WORKDIR', True), 'rpms', arch)
+ oe.path.remove(arch_channel)
+ deploy_arch_dir = os.path.join(self.deploy_dir, arch)
+ if not os.path.exists(deploy_arch_dir):
+ continue
+
+ lockfilename = self.d.getVar('DEPLOY_DIR_RPM', True) + "/rpm.lock"
+ lf = bb.utils.lockfile(lockfilename, False)
+ oe.path.copyhardlinktree(deploy_arch_dir, arch_channel)
+ bb.utils.unlockfile(lf)
+
+ if not arch in ch_already_added:
bb.note('Adding Smart channel %s (%s)' %
(arch, channel_priority))
self._invoke_smart('channel --add %s type=rpm-md baseurl=%s -y'