]> code.ossystems Code Review - openembedded-core.git/commitdiff
kernel.bbclass: do not mv/link sources when externalsrc enabled
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 8 Sep 2015 10:58:14 +0000 (13:58 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 9 Sep 2015 13:25:02 +0000 (14:25 +0100)
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@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/kernel.bbclass

index 919293e43dbae1eacf266de4234834aa7e74a341..dfbdfd24ffdb6af19c684a2d441b67ce2805832d 100644 (file)
@@ -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