[oe-commits] Markus Lehtonen : kernel.bbclass: do not mv/ link sources when externalsrc enabled

git at git.openembedded.org git at git.openembedded.org
Tue Sep 8 22:56:25 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: d0b0c6912622f0f22bdb4c8c466387502e4f65b3
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=d0b0c6912622f0f22bdb4c8c466387502e4f65b3

Author: Markus Lehtonen <markus.lehtonen at linux.intel.com>
Date:   Tue Sep  8 13:58:14 2015 +0300

kernel.bbclass: do not mv/link sources when externalsrc enabled

If externalsrc is enabled the 'do_unpack' task is run if the recipe has
some local source files. In the case of kernel recipe this caused the
(externalsrc) source tree to be moved/symlinked. This patch prevents the
behaviour, making sure the source tree is not moved around when
externalsrc is enabled. Instead of moving the source tree,
STAGING_KERNEL_DIR will be a symlink to it.

[YOCTO #6658]

Signed-off-by: Markus Lehtonen <markus.lehtonen at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/kernel.bbclass | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 919293e..dfbdfd2 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -68,9 +68,13 @@ base_do_unpack_append () {
     if s != kernsrc:
         bb.utils.mkdirhier(kernsrc)
         bb.utils.remove(kernsrc, recurse=True)
-        import subprocess
-        subprocess.call(d.expand("mv ${S} ${STAGING_KERNEL_DIR}"), shell=True)
-        os.symlink(kernsrc, s)
+        if d.getVar("EXTERNALSRC", True):
+            # With EXTERNALSRC S will not be wiped so we can symlink to it
+            os.symlink(s, kernsrc)
+        else:
+            import shutil
+            shutil.move(s, kernsrc)
+            os.symlink(kernsrc, s)
 }
 
 inherit kernel-arch deploy



More information about the Openembedded-commits mailing list