All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Make package_update_index_ipk proper task with locking
@ 2009-06-17 19:41 Roman I Khimov
  2009-06-17 19:41 ` [PATCH 2/3] package_ipk: optimize do_package_update_index_ipk Roman I Khimov
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Roman I Khimov @ 2009-06-17 19:41 UTC (permalink / raw)
  To: openembedded-devel

Parallel image builds race in package_update_index_ipk, so locking is
needed and for a proper lock package_update_index_ipk needs to be a
proper task.
---
 classes/package_ipk.bbclass    |    9 ++++++++-
 classes/rootfs_ipk.bbclass     |    4 +---
 recipes/meta/canadian-sdk.bb   |    3 +--
 recipes/meta/meta-toolchain.bb |    3 +--
 recipes/meta/package-index.bb  |    6 +-----
 5 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/classes/package_ipk.bbclass b/classes/package_ipk.bbclass
index d4cb3b6..1f1b5c9 100644
--- a/classes/package_ipk.bbclass
+++ b/classes/package_ipk.bbclass
@@ -67,10 +67,16 @@ python package_ipk_install () {
 		raise bb.build.FuncFailed
 }
 
+do_package_update_index_ipk[lockfiles] = "${DEPLOY_DIR_IPK}.lock"
+do_package_update_index_ipk[nostamp] = "1"
+do_package_update_index_ipk[recrdeptask] += "do_package_write_ipk"
+do_package_update_index_ipk[recrdeptask] += "do_package_write_ipk"
+do_package_update_index_ipk[depends] += "ipkg-utils-native:do_populate_staging"
+
 #
 # Update the Packages index files in ${DEPLOY_DIR_IPK}
 #
-package_update_index_ipk () {
+do_package_update_index_ipk () {
 	set -x
 
 	ipkgarchs="${PACKAGE_ARCHS}"
@@ -322,3 +328,4 @@ python do_package_write_ipk () {
 }
 do_package_write_ipk[dirs] = "${D}"
 addtask package_write_ipk before do_package_write after do_package
+addtask package_update_index_ipk before do_rootfs
diff --git a/classes/rootfs_ipk.bbclass b/classes/rootfs_ipk.bbclass
index 99a8ed2..16dd511 100644
--- a/classes/rootfs_ipk.bbclass
+++ b/classes/rootfs_ipk.bbclass
@@ -5,8 +5,7 @@
 # See image.bbclass for a usage of this.
 #
 
-do_rootfs[depends] += "opkg-native:do_populate_staging ipkg-utils-native:do_populate_staging"
-do_rootfs[recrdeptask] += "do_package_write_ipk"
+do_rootfs[depends] += "opkg-native:do_populate_staging"
 
 IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS} ${@base_conditional("PACKAGE_INSTALL_NO_DEPS", "1", "-nodeps", "", d)}"
 
@@ -29,7 +28,6 @@ PACKAGE_INSTALL_append = " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "non
 fakeroot rootfs_ipk_do_rootfs () {
 	set -x
 
-	package_update_index_ipk
 	package_generate_ipkg_conf
 
 	mkdir -p ${T}
diff --git a/recipes/meta/canadian-sdk.bb b/recipes/meta/canadian-sdk.bb
index 809173b..86b645b 100644
--- a/recipes/meta/canadian-sdk.bb
+++ b/recipes/meta/canadian-sdk.bb
@@ -56,7 +56,6 @@ do_populate_sdk() {
 	rm -rf ${SDK_OUTPUT}
 	mkdir -p ${SDK_OUTPUT}
 
-	package_update_index_ipk
 	package_generate_ipkg_conf
 
 	for arch in ${PACKAGE_ARCHS}; do
@@ -170,5 +169,5 @@ do_populate_sdk() {
 }
 
 do_populate_sdk[nostamp] = "1"
-do_populate_sdk[recrdeptask] = "do_package_write"
+addtask package_update_index_ipk before do_populate_sdk
 addtask populate_sdk before do_build after do_install
diff --git a/recipes/meta/meta-toolchain.bb b/recipes/meta/meta-toolchain.bb
index b641be1..b8ed801 100644
--- a/recipes/meta/meta-toolchain.bb
+++ b/recipes/meta/meta-toolchain.bb
@@ -56,7 +56,6 @@ do_populate_sdk() {
 	rm -rf ${SDK_OUTPUT}
 	mkdir -p ${SDK_OUTPUT}
 
-	package_update_index_ipk
 	package_generate_ipkg_conf
 
 	for arch in ${PACKAGE_ARCHS}; do
@@ -170,5 +169,5 @@ do_populate_sdk() {
 }
 
 do_populate_sdk[nostamp] = "1"
-do_populate_sdk[recrdeptask] = "do_package_write"
+addtask package_update_index_ipk before do_populate_sdk
 addtask populate_sdk before do_build after do_install
diff --git a/recipes/meta/package-index.bb b/recipes/meta/package-index.bb
index f52fb6c..ce8b999 100644
--- a/recipes/meta/package-index.bb
+++ b/recipes/meta/package-index.bb
@@ -23,8 +23,4 @@ do_stage() {
 
 do_build[nostamp] = "1"
 do_build[dirs] = "${DEPLOY_DIR_IPK}"
-do_build() {
-	set -ex
-	package_update_index_ipk
-	set +ex
-}
+addtask package_update_index_ipk before do_build
-- 
1.6.3.1




^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2009-06-18 13:47 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-17 19:41 [PATCH 1/3] Make package_update_index_ipk proper task with locking Roman I Khimov
2009-06-17 19:41 ` [PATCH 2/3] package_ipk: optimize do_package_update_index_ipk Roman I Khimov
2009-06-17 19:42   ` [PATCH 3/3] package_ipk: fix race in opkg.conf creation Roman I Khimov
2009-06-17 21:08     ` Tom Rini
2009-06-18  8:49       ` Roman I Khimov
2009-06-18 12:47     ` Richard Purdie
2009-06-17 21:06   ` [PATCH 2/3] package_ipk: optimize do_package_update_index_ipk Tom Rini
2009-06-18  9:17   ` Phil Blundell
2009-06-18 10:00     ` Roman I Khimov
2009-06-18 10:11     ` Roman I Khimov
2009-06-18 10:57       ` Phil Blundell
2009-06-18 13:00   ` Richard Purdie
2009-06-17 21:04 ` [PATCH 1/3] Make package_update_index_ipk proper task with locking Tom Rini
2009-06-18 13:05 ` Richard Purdie
2009-06-18 13:16   ` Phil Blundell
2009-06-18 13:35     ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.