summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>2019-07-10 11:27:33 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-17 09:36:34 +0100
commit3663a5d21687d51dd7d37aedff7baa0055200699 (patch)
treec303d692e77cf5e23167ee4273a3949ccac9d62a /scripts
parent015c87d95292350c7c0d4c3c85b7f39229ebb462 (diff)
downloadpoky-3663a5d21687d51dd7d37aedff7baa0055200699.tar.gz
devtool/standard.py: Create a copy of kernel source within work-shared if not present
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] (From OE-Core rev: bb42ab90835e8ec2f1dfbb35056c353784693266) Signed-off-by: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/devtool/standard.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 20c2b0b4c1..6661a21983 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -491,6 +491,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works
491 """Extract sources of a recipe""" 491 """Extract sources of a recipe"""
492 import oe.recipeutils 492 import oe.recipeutils
493 import oe.patch 493 import oe.patch
494 import oe.path
494 495
495 pn = d.getVar('PN') 496 pn = d.getVar('PN')
496 497
@@ -587,7 +588,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works
587 with open(preservestampfile, 'w') as f: 588 with open(preservestampfile, 'w') as f:
588 f.write(d.getVar('STAMP')) 589 f.write(d.getVar('STAMP'))
589 try: 590 try:
590 if bb.data.inherits_class('kernel-yocto', d): 591 if is_kernel_yocto:
591 # We need to generate the kernel config 592 # We need to generate the kernel config
592 task = 'do_configure' 593 task = 'do_configure'
593 else: 594 else:
@@ -614,6 +615,23 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works
614 raise DevtoolError('Something went wrong with source extraction - the devtool-source class was not active or did not function correctly:\n%s' % str(e)) 615 raise DevtoolError('Something went wrong with source extraction - the devtool-source class was not active or did not function correctly:\n%s' % str(e))
615 srcsubdir_rel = os.path.relpath(srcsubdir, os.path.join(tempdir, 'workdir')) 616 srcsubdir_rel = os.path.relpath(srcsubdir, os.path.join(tempdir, 'workdir'))
616 617
618 # Check if work-shared is empty, if yes
619 # find source and copy to work-shared
620 if is_kernel_yocto:
621 workshareddir = d.getVar('STAGING_KERNEL_DIR')
622 staging_kerVer = get_staging_kver(workshareddir)
623 kernelVersion = d.getVar('LINUX_VERSION')
624
625 # handle dangling symbolic link in work-shared:
626 if os.path.islink(workshareddir):
627 os.unlink(workshareddir)
628
629 if os.path.exists(workshareddir) and (not os.listdir(workshareddir) or kernelVersion != staging_kerVer):
630 shutil.rmtree(workshareddir)
631 oe.path.copyhardlinktree(srcsubdir,workshareddir)
632 elif not os.path.exists(workshareddir):
633 oe.path.copyhardlinktree(srcsubdir,workshareddir)
634
617 tempdir_localdir = os.path.join(tempdir, 'oe-local-files') 635 tempdir_localdir = os.path.join(tempdir, 'oe-local-files')
618 srctree_localdir = os.path.join(srctree, 'oe-local-files') 636 srctree_localdir = os.path.join(srctree, 'oe-local-files')
619 637