All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: yocto@yoctoproject.org
Subject: [PATCH] Get rid of do_shared_workdir task
Date: Wed, 11 Mar 2015 23:28:13 +0200	[thread overview]
Message-ID: <1426109293-4970-1-git-send-email-ed.bartosh@linux.intel.com> (raw)

Merged do_shared_workdir into kernel_do_compile

This change should fix race condition between do_compilemodules
and do_shared_workdir. Race occurs when do_compilemodules changes
include/generated/ directory content while do_shared_workdir
tries to copy it.

Fixes [YOCTO #7321]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 meta/classes/kernel-yocto.bbclass                | 2 +-
 meta/classes/kernel.bbclass                      | 5 ++---
 meta/classes/module-base.bbclass                 | 2 +-
 meta/recipes-kernel/linux/kernel-devsrc.bb       | 2 +-
 meta/recipes-kernel/linux/linux-dummy.bb         | 5 -----
 meta/recipes-kernel/lttng/lttng-modules_2.6.0.bb | 2 +-
 meta/recipes-kernel/perf/perf.bb                 | 2 +-
 7 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 8db4899..27a027d 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -1,5 +1,5 @@
 # remove tasks that modify the source tree in case externalsrc is inherited
-SRCTREECOVEREDTASKS += "do_kernel_link_vmlinux do_kernel_configme do_validate_branches do_kernel_configcheck do_kernel_checkout do_shared_workdir do_fetch do_unpack do_patch"
+SRCTREECOVEREDTASKS += "do_kernel_link_vmlinux do_kernel_configme do_validate_branches do_kernel_configcheck do_kernel_checkout do_fetch do_unpack do_patch"
 
 # returns local (absolute) path names for all valid patches in the
 # src_uri
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 125ed88..7914242 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -192,6 +192,7 @@ kernel_do_compile() {
 	if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
 		gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
 	fi
+	shared_workdir
 }
 
 do_compile_kernelmodules() {
@@ -234,8 +235,6 @@ kernel_do_install() {
 }
 do_install[prefuncs] += "package_get_auto_pr"
 
-addtask shared_workdir after do_compile before do_install
-
 emit_depmod_pkgdata() {
 	# Stash data for depmod
 	install -d ${PKGDESTWORK}/kernel-depmod/
@@ -245,7 +244,7 @@ emit_depmod_pkgdata() {
 
 PACKAGEFUNCS += "emit_depmod_pkgdata"
 
-do_shared_workdir () {
+shared_workdir () {
 	cd ${B}
 
 	kerneldir=${STAGING_KERNEL_BUILDDIR}
diff --git a/meta/classes/module-base.bbclass b/meta/classes/module-base.bbclass
index 3eb2e92..31ab95f 100644
--- a/meta/classes/module-base.bbclass
+++ b/meta/classes/module-base.bbclass
@@ -15,7 +15,7 @@ KERNEL_OBJECT_SUFFIX = ".ko"
 # kernel modules are generally machine specific
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
-do_configure[depends] += "virtual/kernel:do_shared_workdir"
+do_configure[depends] += "virtual/kernel:kernel_do_compile"
 
 # Function to ensure the kernel scripts are created. Expected to
 # be called before do_compile. See module.bbclass for an exmaple.
diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
index e36de1b..f2a1d7c 100644
--- a/meta/recipes-kernel/linux/kernel-devsrc.bb
+++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
@@ -16,7 +16,7 @@ inherit module-base
 # We need the kernel to be staged (unpacked, patched and configured) before
 # we can grab the source and make the source package. We also need the bits from
 # ${B} not to change while we install, so virtual/kernel must finish do_compile.
-do_install[depends] += "virtual/kernel:do_shared_workdir"
+do_install[depends] += "virtual/kernel:kernel_do_compile"
 # Need the source, not just the output of populate_sysroot
 do_install[depends] += "virtual/kernel:do_compile"
 
diff --git a/meta/recipes-kernel/linux/linux-dummy.bb b/meta/recipes-kernel/linux/linux-dummy.bb
index cc0e4e6..8f4ddc4 100644
--- a/meta/recipes-kernel/linux/linux-dummy.bb
+++ b/meta/recipes-kernel/linux/linux-dummy.bb
@@ -33,10 +33,6 @@ do_compile () {
 	:
 }
 
-do_shared_workdir () {
-	:
-}
-
 do_install() {
 	:
 }
@@ -51,4 +47,3 @@ do_deploy() {
 
 addtask bundle_initramfs after do_install before do_deploy
 addtask deploy after do_install
-addtask shared_workdir after do_compile before do_install
diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.6.0.bb b/meta/recipes-kernel/lttng/lttng-modules_2.6.0.bb
index d0039b3..9d07ae4 100644
--- a/meta/recipes-kernel/lttng/lttng-modules_2.6.0.bb
+++ b/meta/recipes-kernel/lttng/lttng-modules_2.6.0.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=1412caf5a1aa90d6a48588a4794c0eac \
                     file://lgpl-2.1.txt;md5=243b725d71bb5df4a1e5920b344b86ad"
 
 DEPENDS = "virtual/kernel"
-do_configure[depends] += "virtual/kernel:do_shared_workdir"
+do_configure[depends] += "virtual/kernel:kernel_do_compile"
 
 inherit module
 
diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index f69d177..59d6be2 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -32,7 +32,7 @@ DEPENDS = " \
     bison flex \
 "
 
-do_configure[depends] += "virtual/kernel:do_shared_workdir"
+do_configure[depends] += "virtual/kernel:kernel_do_compile"
 
 PROVIDES = "virtual/perf"
 
-- 
2.1.4



             reply	other threads:[~2015-03-11 21:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-11 21:28 Ed Bartosh [this message]
2015-03-11 23:47 ` [PATCH] Get rid of do_shared_workdir task Saul Wold
2015-03-12  3:30 ` Bruce Ashfield
2015-03-12  3:41   ` Bruce Ashfield
2015-03-12  8:10     ` ed.bartosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426109293-4970-1-git-send-email-ed.bartosh@linux.intel.com \
    --to=ed.bartosh@linux.intel.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.