summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2017-03-14 01:45:45 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-27 11:28:04 +0100
commitd4b41223d39f89e3e9f1217d92759adccc8bde2a (patch)
tree7c45734d38a3d99fe502e3a1f498e307b04c7420 /meta
parenta992a31803f31d756f2ea01142b7241e14db7ddc (diff)
downloadpoky-d4b41223d39f89e3e9f1217d92759adccc8bde2a.tar.gz
oe/path.py: fix for "Argument list too long"
Issue: LIN9-1648 Fixed when len(TMPDIR) = 410: $ bitbake core-image-sato-sdk [snip] Subprocess output: /bin/sh: /bin/cp: Argument list too long ERROR: core-image-sato-sdk-1.0-r0 do_rootfs: Function failed: do_rootfs [snip] This is because "copyhardlinktree(src, dst)" does "cp -afl src/* dst", while src/* is expanded to "src/file1 src/file2, src/file3..." which causes the "Argument list too long", use ./* as src and change cwd in subprocess.check_output() to fix the problem. (From OE-Core rev: a3dc93eb25fba32109edd1db6e8766074fb52e4b) (From OE-Core rev: befda6ce3fd916ab04c035d1d82ed173759f7f09) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oe/path.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index 06a5af2659..ed7fd1eef0 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -83,12 +83,14 @@ def copyhardlinktree(src, dst):
83 if os.path.isdir(src): 83 if os.path.isdir(src):
84 import glob 84 import glob
85 if len(glob.glob('%s/.??*' % src)) > 0: 85 if len(glob.glob('%s/.??*' % src)) > 0:
86 source = '%s/.??* ' % src 86 source = './.??* '
87 source = source + '%s/*' % src 87 source += './*'
88 s_dir = src
88 else: 89 else:
89 source = src 90 source = src
90 cmd = 'cp -afl --preserve=xattr %s %s' % (source, dst) 91 s_dir = os.getcwd()
91 subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) 92 cmd = 'cp -afl --preserve=xattr %s %s' % (source, os.path.realpath(dst))
93 subprocess.check_output(cmd, shell=True, cwd=s_dir, stderr=subprocess.STDOUT)
92 else: 94 else:
93 copytree(src, dst) 95 copytree(src, dst)
94 96