diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-03-29 11:58:01 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-03-29 14:01:52 +0100 |
commit | 68baef906513c1abef5372d92c769dc5d695e054 (patch) | |
tree | 7437accce81b04be482e2082762a56562e68824b /meta | |
parent | 2f0c06a4526fd117f35b216edbed5b89fc87d1ab (diff) | |
download | poky-68baef906513c1abef5372d92c769dc5d695e054.tar.gz |
package_rpm: Ensure we take the sstate shared lockfile in the place we write files
The point we need to take the lock is when the rpm files are written into the
deploy rpm directory. Since sstate makes the actual installation of the files,
that is the point we need to take the lock. This also stops the deploy/rpm
directory being accessed for a lock before it exists.
[YOCTO #797]
[YOCTO #925]
(From OE-Core rev: 833a1e970f087dfcb32967cee3e24540f041cde0)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/package_rpm.bbclass | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index 4647116eed..70170d19ef 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass | |||
@@ -777,16 +777,10 @@ python do_package_rpm () { | |||
777 | cmd = cmd + " --define 'debug_package %{nil}'" | 777 | cmd = cmd + " --define 'debug_package %{nil}'" |
778 | cmd = cmd + " -bb " + outspecfile | 778 | cmd = cmd + " -bb " + outspecfile |
779 | 779 | ||
780 | # Take a shared lock, we can write multiple packages at the same time... | ||
781 | # but we need to stop the rootfs/solver from running while we do... | ||
782 | lf = bb.utils.lockfile(bb.data.expand("${DEPLOY_DIR_RPM}/rpm.lock", d), True) | ||
783 | |||
784 | # Build the rpm package! | 780 | # Build the rpm package! |
785 | bb.data.setVar('BUILDSPEC', cmd + "\n", d) | 781 | bb.data.setVar('BUILDSPEC', cmd + "\n", d) |
786 | bb.data.setVarFlag('BUILDSPEC', 'func', '1', d) | 782 | bb.data.setVarFlag('BUILDSPEC', 'func', '1', d) |
787 | bb.build.exec_func('BUILDSPEC', d) | 783 | bb.build.exec_func('BUILDSPEC', d) |
788 | |||
789 | bb.utils.unlockfile(lf) | ||
790 | } | 784 | } |
791 | 785 | ||
792 | python () { | 786 | python () { |
@@ -803,6 +797,9 @@ SSTATETASKS += "do_package_write_rpm" | |||
803 | do_package_write_rpm[sstate-name] = "deploy-rpm" | 797 | do_package_write_rpm[sstate-name] = "deploy-rpm" |
804 | do_package_write_rpm[sstate-inputdirs] = "${PKGWRITEDIRRPM}" | 798 | do_package_write_rpm[sstate-inputdirs] = "${PKGWRITEDIRRPM}" |
805 | do_package_write_rpm[sstate-outputdirs] = "${DEPLOY_DIR_RPM}" | 799 | do_package_write_rpm[sstate-outputdirs] = "${DEPLOY_DIR_RPM}" |
800 | # Take a shared lock, we can write multiple packages at the same time... | ||
801 | # but we need to stop the rootfs/solver from running while we do... | ||
802 | do_package_write_rpm[sstate-lockfile-shared] += "${DEPLOY_DIR_RPM}/rpm.lock" | ||
806 | 803 | ||
807 | python do_package_write_rpm_setscene () { | 804 | python do_package_write_rpm_setscene () { |
808 | sstate_setscene(d) | 805 | sstate_setscene(d) |