[OE-core] [PATCH] toolchain-scripts: preserve host path in environment setup script

Richard Purdie richard.purdie at linuxfoundation.org
Thu Apr 19 12:11:10 UTC 2018


On Thu, 2018-04-19 at 13:46 +0800, Chin Huat Ang wrote:
> The environment setup script generated in the build directory has host paths
> filtered, sourcing this script will break runqemu as it requires host
> /bin/stty. To resolve this, the script generation now sets the PATH variable
> to include the original values obtain from BB_ORIGENV.
> 
> [YOCTO #12695]
> 
> Signed-off-by: Chin Huat Ang <chin.huat.ang at intel.com>
> ---
>  meta/classes/toolchain-scripts.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
> index eeb320d..75f76d9 100644
> --- a/meta/classes/toolchain-scripts.bbclass
> +++ b/meta/classes/toolchain-scripts.bbclass
> @@ -62,7 +62,7 @@ toolchain_create_tree_env_script () {
>  	script=${TMPDIR}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}
>  	rm -f $script
>  	touch $script
> -	echo 'export PATH=${STAGING_DIR_NATIVE}/usr/bin:${PATH}' >> $script
> +	echo 'export PATH=${STAGING_DIR_NATIVE}/usr/bin:${@d.getVar("BB_ORIGENV", False).getVar("PATH", False)}' >> $script
>  	echo 'export PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR}' >> $script
>  	echo 'export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}' >> $script
>  	echo 'export CONFIG_SITE="${@siteinfo_get_files(d)}"' >> $script

Hi,

Could you test something like this please?:

diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
index eeb320d15a8..1f6d1aa2bf4 100644
--- a/meta/classes/toolchain-scripts.bbclass
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -62,7 +62,8 @@ toolchain_create_tree_env_script () {
        script=${TMPDIR}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}
        rm -f $script
        touch $script
-       echo 'export PATH=${STAGING_DIR_NATIVE}/usr/bin:${PATH}' >> $script
+       echo ". ${COREBASE}/oe-init-build-env ${TOPDIR}" >> $script
+       echo 'export PATH=${STAGING_DIR_NATIVE}/usr/bin:$PATH' >> $script
        echo 'export PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR}' >> $script
        echo 'export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}' >> $script
        echo 'export CONFIG_SITE="${@siteinfo_get_files(d)}"' >> $script

Cheers,

Richard



More information about the Openembedded-core mailing list