]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/populate_sdk_ext: force a known value for TMPDIR
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Thu, 19 Jan 2017 18:29:16 +0000 (07:29 +1300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 19 Jan 2017 22:45:54 +0000 (22:45 +0000)
If TMPDIR is configured to be somewhere outside of TOPDIR (a not
uncommon configuration where you have multiple disks and space on /home
is at a premium) then our attempt to find out the location of paths
under TMPDIR by using a relative path led to horribly broken paths
ending up in the eSDK. To save pain, just force a known value for TMPDIR
(i.e. ${TOPDIR}/tmp) and then we can assume that everywhere else.

Fixes [YOCTO #10797].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/populate_sdk_ext.bbclass
meta/recipes-core/meta/meta-environment-extsdk.bb

index f21ae8be411473805bfd1d7876549f9768e9ecfb..d5f6de902874fe4aa5cd03d3074e01a01fe102cd 100644 (file)
@@ -282,6 +282,7 @@ python copy_buildsystem () {
             # Write a newline just in case there's none at the end of the original
             f.write('\n')
 
+            f.write('TMPDIR = "${TOPDIR}/tmp"\n')
             f.write('DL_DIR = "${TOPDIR}/downloads"\n')
 
             f.write('INHERIT += "%s"\n' % 'uninative')
@@ -512,8 +513,8 @@ install_tools() {
        # (they get populated from sstate on installation)
        unfsd_path="${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}/unfsd"
        if [ "${SDK_INCLUDE_TOOLCHAIN}" == "1" -a ! -e $unfsd_path ] ; then
-               binrelpath=${@os.path.relpath(d.getVar('STAGING_BINDIR_NATIVE'), d.getVar('TOPDIR'))}
-               lnr ${SDK_OUTPUT}/${SDKPATH}/$binrelpath/unfsd $unfsd_path
+               binrelpath=${@os.path.relpath(d.getVar('STAGING_BINDIR_NATIVE'), d.getVar('TMPDIR'))}
+               lnr ${SDK_OUTPUT}/${SDKPATH}/tmp/$binrelpath/unfsd $unfsd_path
        fi
        touch ${SDK_OUTPUT}/${SDKPATH}/.devtoolbase
 
index 76d2661b10bf8f2a6245071e7e274f6f3c9f80f3..757afc154f899dd51af55d5044a0ded8d8cc24d9 100644 (file)
@@ -5,8 +5,8 @@ require meta-environment.bb
 PN = "meta-environment-extsdk-${MACHINE}"
 
 create_sdk_files_append() {
-       local sysroot=${SDKPATH}/${@os.path.relpath(d.getVar('STAGING_DIR_TARGET'), d.getVar('TOPDIR'))}
-       local sdkpathnative=${SDKPATH}/${@os.path.relpath(d.getVar('STAGING_DIR_NATIVE'), d.getVar('TOPDIR'))}
+       local sysroot=${SDKPATH}/tmp/${@os.path.relpath(d.getVar('STAGING_DIR_TARGET'), d.getVar('TMPDIR'))}
+       local sdkpathnative=${SDKPATH}/tmp/${@os.path.relpath(d.getVar('STAGING_DIR_NATIVE'), d.getVar('TMPDIR'))}
 
        toolchain_create_sdk_env_script '' '' $sysroot '' ${bindir_native} ${prefix_native} $sdkpathnative
 }