]> code.ossystems Code Review - openembedded-core.git/commitdiff
toolchain-scripts.bbclass: customize prompt string for SDKs
authorKai Kang <kai.kang@windriver.com>
Mon, 1 Mar 2021 14:16:33 +0000 (22:16 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 11 Mar 2021 15:24:10 +0000 (15:24 +0000)
Introduce a new variable SDK_PS1 to customize prompt string for SDKs
when source script environment-setup-script. If variable SDK_PS1 is not
set or empty, nothing changed. Otherwise new PS1 with the value of
SDK_PS1 is used after source the sdk environment file.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/toolchain-scripts.bbclass

index db1d3215ef7e55e530829ce4aaa3d3ae372dfedf..67a812cb028cd561c2509d5d6672bc3fea1aa7e1 100644 (file)
@@ -8,6 +8,8 @@ TARGET_CC_ARCH_append_libc-musl = " -mmusl"
 # default debug prefix map isn't valid in the SDK
 DEBUG_PREFIX_MAP = ""
 
+EXPORT_SDK_PS1 = "${@ 'export PS1=\'%s\'' % d.getVar('SDK_PS1') if d.getVar('SDK_PS1') else ''}"
+
 # This function creates an environment-setup-script for use in a deployable SDK
 toolchain_create_sdk_env_script () {
        # Create environment setup script.  Remember that $SDKTARGETSYSROOT should
@@ -39,6 +41,7 @@ toolchain_create_sdk_env_script () {
        echo '    return 1' >> $script
        echo 'fi' >> $script
 
+       echo "${EXPORT_SDK_PS1}" >> $script
        echo 'export SDKTARGETSYSROOT='"$sysroot" >> $script
        EXTRAPATH=""
        for i in ${CANADIANEXTRAOS}; do