If kernel source is not already downloaded i.e staging kernel dir is empty, place a copy of the source when the user runs devtool modify linux-yocto. This way the kernel source is available for other packages that use it.
[YOCTO #10416] Signed-off-by: Sai Hari Chandana Kalluri <chandana.kall...@xilinx.com> Signed-off-by: Alejandro Enedino Hernandez Samaniego <aleja...@xilinx.com> --- changelog v2: 1. Add a check to verify the set kernel version by user and kernel version present in workspace do not match before placing a copy of kernel-source from workspace to work-shared. --- scripts/lib/devtool/standard.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index ba1afa4..24a0168 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -572,7 +572,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works with open(preservestampfile, 'w') as f: f.write(d.getVar('STAMP')) try: - if bb.data.inherits_class('kernel-yocto', d): + if is_kernel_yocto: # We need to generate the kernel config task = 'do_configure' else: @@ -599,6 +599,18 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works raise DevtoolError('Something went wrong with source extraction - the devtool-source class was not active or did not function correctly:\n%s' % str(e)) srcsubdir_rel = os.path.relpath(srcsubdir, os.path.join(tempdir, 'workdir')) + # Check if work-shared is empty, if yes + # find source and copy to work-shared + if is_kernel_yocto: + workshareddir = d.getVar('STAGING_KERNEL_DIR') + staging_kerVer = get_staging_kver(workshareddir) + kernelVersion = d.getVar('LINUX_VERSION') + if (os.path.exists(workshareddir) and (not os.listdir(workshareddir) or kernelVersion!=staging_kerVer)): + shutil.rmtree(workshareddir) + copy_src_to_ws(srcsubdir,workshareddir) + elif (not os.path.exists(workshareddir)): + copy_src_to_ws(srcsubdir,workshareddir) + tempdir_localdir = os.path.join(tempdir, 'oe-local-files') srctree_localdir = os.path.join(srctree, 'oe-local-files') -- 2.7.4 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core