toolchain-scripts: set PS1

Submitted by Kang Kai on Nov. 17, 2020, 8:33 a.m. | Patch ID: 178004

Details

Message ID 20201117083309.20327-1-kai.kang@windriver.com
State New
Headers show

Commit Message

Kang Kai Nov. 17, 2020, 8:33 a.m.
From: Kai Kang <kai.kang@windriver.com>


Introduce a variable SDK_PS1 to configure PS1 after source
environment-setup-script. The prompt string by default looks like:

SDK-poky-glibc-x86_64--cortexa57-qemuarm64$

Signed-off-by: Kai Kang <kai.kang@windriver.com>

---
 meta/classes/toolchain-scripts.bbclass | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.17.1
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#144684): https://lists.openembedded.org/g/openembedded-core/message/144684
Mute This Topic: https://lists.openembedded.org/mt/78312366/1003190
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [mhalstead@linuxfoundation.org]
-=-=-=-=-=-=-=-=-=-=-=-

Patch hide | download patch | download mbox

diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
index db1d3215ef..274dfcf7e2 100644
--- a/meta/classes/toolchain-scripts.bbclass
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -8,6 +8,9 @@  TARGET_CC_ARCH_append_libc-musl = " -mmusl"
 # default debug prefix map isn't valid in the SDK
 DEBUG_PREFIX_MAP = ""
 
+# PS1 setting after source the environment-setup-script
+SDK_PS1 ?= "SDK-${SDK_NAME}$ "
+
 # 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
@@ -45,6 +48,7 @@  toolchain_create_sdk_env_script () {
 		EXTRAPATH="$EXTRAPATH:$sdkpathnative$bindir/${TARGET_ARCH}${TARGET_VENDOR}-$i"
 	done
 	echo "export PATH=$sdkpathnative$bindir:$sdkpathnative$sbindir:$sdkpathnative$base_bindir:$sdkpathnative$base_sbindir:$sdkpathnative$bindir/../${HOST_SYS}/bin:$sdkpathnative$bindir/${TARGET_SYS}"$EXTRAPATH':$PATH' >> $script
+	echo 'export PS1="${SDK_PS1}"' >>$script
 	echo 'export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT' >> $script
 	echo 'export PKG_CONFIG_PATH=$SDKTARGETSYSROOT'"$libdir"'/pkgconfig:$SDKTARGETSYSROOT'"$prefix"'/share/pkgconfig' >> $script
 	echo 'export CONFIG_SITE=${SDKPATH}/site-config-'"${multimach_target_sys}" >> $script