Skip to contentSkip to conversation

sourceipk: fix race condition with compileconfigs

PATCH In review Chase Maupin 2 participants 2 messages Jan 31, 2011 – Feb 12, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sourceipk: fix race condition with compileconfigs

* This patch adds an empty compileconfigs function to the sourceipk class.
* This is required because when making a sourceipk of a package using the multi-kernel.inc functionality you will have a race condition between the compileconfigs of the multi-kernel file building the kernel and sourceipk trying to copy and patch the sources. The resulting conditions can then occur:
- You will package some interim build files, yielding a sourceipk that is not consistent between builds
- You will try to copy interim build files as they are being deleted which will result in an error and break the build.
* The empty compileconfigs function is overwritten by the real compileconfigs function when the multi-kernel.inc file is used.

---
 classes/sourceipk.bbclass |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
classes/sourceipk.bbclass +12 -1
index 8a92115..1b4a318 100644
@@ -144,7 +144,18 @@ EXPORT_FUNCTIONS do_create_srcipk
 
 do_create_srcipk[deptask] = "do_patch"
 
-addtask create_srcipk after do_patch before do_configure
+# Add a blank compileconfigs task.  This allows the sourceipk to schedule
+# its copy of the sources for kernels using the multi-kernel functionality
+# before the compileconfigs task.  Failure to do this results in a race
+# condition where in the best case the sources packaged may contain binary
+# builds and in the worst case binary files being cleaned cause an error
+# in the copy command for the sourceipk.
+do_compileconfigs() {
+    :
+}
+addtask compileconfigs after do_patch before do_configure
+
+addtask create_srcipk after do_patch before do_compileconfigs
 
 #Add source packages to list of packages OE knows about
 PACKAGES_DYNAMIC += "${PN}-src"
Signature · 1 line
1.7.0.4
Acked-by on v1 1/1
#1 lore raw
Quoted 17 lines · Chase Maupin

* This patch adds an empty compileconfigs function to the sourceipk class.
* This is required because when making a sourceipk of a package using the multi-kernel.inc functionality you will have a race condition between the compileconfigs of the multi-kernel file building the kernel and sourceipk trying to copy and patch the sources. The resulting conditions can then occur:
- You will package some interim build files, yielding a sourceipk that is not consistent between builds
- You will try to copy interim build files as they are being deleted which will result in an error and break the build.
* The empty compileconfigs function is overwritten by the real compileconfigs function when the multi-kernel.inc file is used.

Quoted 1 line
Quoted 36 lines
---
 classes/sourceipk.bbclass |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
classes/sourceipk.bbclass +12 -1
index 8a92115..1b4a318 100644
@@ -144,7 +144,18 @@ EXPORT_FUNCTIONS do_create_srcipk
 
 do_create_srcipk[deptask] = "do_patch"
 
-addtask create_srcipk after do_patch before do_configure
+# Add a blank compileconfigs task.  This allows the sourceipk to schedule
+# its copy of the sources for kernels using the multi-kernel functionality
+# before the compileconfigs task.  Failure to do this results in a race
+# condition where in the best case the sources packaged may contain binary
+# builds and in the worst case binary files being cleaned cause an error
+# in the copy command for the sourceipk.
+do_compileconfigs() {
+    :
+}
+addtask compileconfigs after do_patch before do_configure
+
+addtask create_srcipk after do_patch before do_compileconfigs
 
 #Add source packages to list of packages OE knows about
 PACKAGES_DYNAMIC += "${PN}-src"
Signature · 7 lines
1.7.0.4


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel