summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/package_manager.py
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-12 15:25:22 +0100
commit6b66e9317f4ec3a69f98f29836aafa35b52f3fc7 (patch)
treee97a5f491be57a28ebbb334af7fc706e93884904 /meta/lib/oe/package_manager.py
parentd11e8e1109c2c5a0cc3e4dea70cebe068b2a6ba1 (diff)
downloadpoky-6b66e9317f4ec3a69f98f29836aafa35b52f3fc7.tar.gz
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. (From OE-Core rev: a92c196449c516fe51786d429078bbb1213bb029) 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/package_manager.py')
-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
9import bb 9import bb
10import tempfile 10import tempfile
11import oe.utils 11import oe.utils
12import oe.path
12import string 13import string
13from oe.gpg_sign import get_signer 14from oe.gpg_sign import get_signer
14 15
@@ -175,7 +176,7 @@ class RpmIndexer(Indexer):
175 dbpath = os.path.join(self.d.getVar('WORKDIR', True), 'rpmdb', arch) 176 dbpath = os.path.join(self.d.getVar('WORKDIR', True), 'rpmdb', arch)
176 if os.path.exists(dbpath): 177 if os.path.exists(dbpath):
177 bb.utils.remove(dbpath, True) 178 bb.utils.remove(dbpath, True)
178 arch_dir = os.path.join(self.deploy_dir, arch) 179 arch_dir = os.path.join(self.d.getVar('WORKDIR', True), 'rpms', arch)
179 if not os.path.isdir(arch_dir): 180 if not os.path.isdir(arch_dir):
180 continue 181 continue
181 182
@@ -1010,8 +1011,18 @@ class RpmPM(PackageManager):
1010 ch_already_added = [] 1011 ch_already_added = []
1011 for canonical_arch in platform_extra: 1012 for canonical_arch in platform_extra:
1012 arch = canonical_arch.split('-')[0] 1013 arch = canonical_arch.split('-')[0]
1013 arch_channel = os.path.join(self.deploy_dir, arch) 1014 arch_channel = os.path.join(self.d.getVar('WORKDIR', True), 'rpms', arch)
1014 if os.path.exists(arch_channel) and not arch in ch_already_added: 1015 oe.path.remove(arch_channel)
1016 deploy_arch_dir = os.path.join(self.deploy_dir, arch)
1017 if not os.path.exists(deploy_arch_dir):
1018 continue
1019
1020 lockfilename = self.d.getVar('DEPLOY_DIR_RPM', True) + "/rpm.lock"
1021 lf = bb.utils.lockfile(lockfilename, False)
1022 oe.path.copyhardlinktree(deploy_arch_dir, arch_channel)
1023 bb.utils.unlockfile(lf)
1024
1025 if not arch in ch_already_added:
1015 bb.note('Adding Smart channel %s (%s)' % 1026 bb.note('Adding Smart channel %s (%s)' %
1016 (arch, channel_priority)) 1027 (arch, channel_priority))
1017 self._invoke_smart('channel --add %s type=rpm-md baseurl=%s -y' 1028 self._invoke_smart('channel --add %s type=rpm-md baseurl=%s -y'