diff options
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/devtool/standard.py | 20 |
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 | ||