diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2015-09-08 13:58:14 +0300 |
---|---|---|
committer | Joshua Lock <joshua.g.lock@intel.com> | 2016-02-16 14:02:48 +0000 |
commit | ca55a01908126c45120fc18e68e78f8f49ecf0ce (patch) | |
tree | 5df26bd8973165f0ecf8e12d740f0f109df4adb0 | |
parent | 3bbd53035fb62793f1e44b24b18eb275bd860ed1 (diff) | |
download | openembedded-core-ca55a01908126c45120fc18e68e78f8f49ecf0ce.tar.gz |
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]
(From OE-Core master rev: 8f6c564661a3801012eb2d9a98cdc99c91712367)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
-rw-r--r-- | meta/classes/kernel.bbclass | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 74092e96aa..83a50cbed6 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -51,9 +51,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 |