Skip to contentSkip to conversation

toolchain-scripts: set PS1

PATCH kai 1 participant 1 message Nov 25, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

kai

author
#1 lore raw
Quoted 17 lines · kai

From: Kai Kang <[email protected]>

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$

---
  meta/classes/toolchain-scripts.bbclass | 4 ++++
  1 file changed, 4 insertions(+)
meta/classes/toolchain-scripts.bbclass +0 -0
index db1d3215ef..274dfcf7e2 100644

meta/classes/toolchain-scripts.bbclass TARGET_CC_ARCH_append_libc-musl = " -mmusl" · line 12

Quoted 5 lines
meta/classes/toolchain-scripts.bbclass +2 -0
@@ -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}$ "

Any comment on the default format of SDK_PS1 or the whole patch, please?

Thanks,
Kai

Quoted 15 lines
meta/classes/toolchain-scripts.bbclass +2 -0
+
  # 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