* [PATCH v2] toolchain-scripts.bbclass: customize prompt string for SDKs @ 2021-02-25 5:59 kai 2021-02-25 15:29 ` [OE-core] " Christopher Larson 0 siblings, 1 reply; 6+ messages in thread From: kai @ 2021-02-25 5:59 UTC (permalink / raw) To: richard.purdie; +Cc: openembedded-core From: Kai Kang <kai.kang@windriver.com> Introduce a new variable SDK_PS1 to customize prompt string for SDKs when source script environment-setup-script. The default prompt string of SDKs looks like: SDK-poky-glibc-x86_64--cortexa57-qemuarm64$ Signed-off-by: Kai Kang <kai.kang@windriver.com> --- v2: not set PS1 for buildtools-tarball meta/classes/toolchain-scripts.bbclass | 1 + meta/conf/bitbake.conf | 1 + 2 files changed, 2 insertions(+) diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass index db1d3215ef..88df373d0b 100644 --- a/meta/classes/toolchain-scripts.bbclass +++ b/meta/classes/toolchain-scripts.bbclass @@ -45,6 +45,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 diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 48af17fbf7..6075749a5e 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -422,6 +422,7 @@ PKGDATA_DIR = "${TMPDIR}/pkgdata/${MACHINE}" SDK_NAME_PREFIX ?= "oecore" SDK_NAME = "${SDK_NAME_PREFIX}-${SDK_ARCH}-${TUNE_PKGARCH}" +SDK_PS1 ?= "SDK-${SDK_NAME}:\\\\$ " SDKPATH = "/usr/local/${SDK_NAME_PREFIX}-${SDK_ARCH}" SDKPATHNATIVE = "${SDKPATH}/sysroots/${SDK_SYS}" -- 2.17.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH v2] toolchain-scripts.bbclass: customize prompt string for SDKs 2021-02-25 5:59 [PATCH v2] toolchain-scripts.bbclass: customize prompt string for SDKs kai @ 2021-02-25 15:29 ` Christopher Larson 2021-02-26 1:57 ` kai 0 siblings, 1 reply; 6+ messages in thread From: Christopher Larson @ 2021-02-25 15:29 UTC (permalink / raw) To: kai; +Cc: Richard Purdie, Patches and discussions about the oe-core layer [-- Attachment #1: Type: text/plain, Size: 2519 bytes --] Are we sure we want to completely override it rather than adding to it? I'd be rather irritated if this blows away my prompt without my asking for it. I think either it should append or have a variable controlling whether this is enabled when building the SDK. On Wed, Feb 24, 2021 at 10:59 PM kai <kai.kang@windriver.com> wrote: > From: Kai Kang <kai.kang@windriver.com> > > Introduce a new variable SDK_PS1 to customize prompt string for SDKs > when source script environment-setup-script. > > The default prompt string of SDKs looks like: > > SDK-poky-glibc-x86_64--cortexa57-qemuarm64$ > > Signed-off-by: Kai Kang <kai.kang@windriver.com> > --- > v2: not set PS1 for buildtools-tarball > > meta/classes/toolchain-scripts.bbclass | 1 + > meta/conf/bitbake.conf | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/meta/classes/toolchain-scripts.bbclass > b/meta/classes/toolchain-scripts.bbclass > index db1d3215ef..88df373d0b 100644 > --- a/meta/classes/toolchain-scripts.bbclass > +++ b/meta/classes/toolchain-scripts.bbclass > @@ -45,6 +45,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 > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf > index 48af17fbf7..6075749a5e 100644 > --- a/meta/conf/bitbake.conf > +++ b/meta/conf/bitbake.conf > @@ -422,6 +422,7 @@ PKGDATA_DIR = "${TMPDIR}/pkgdata/${MACHINE}" > > SDK_NAME_PREFIX ?= "oecore" > SDK_NAME = "${SDK_NAME_PREFIX}-${SDK_ARCH}-${TUNE_PKGARCH}" > +SDK_PS1 ?= "SDK-${SDK_NAME}:\\\\$ " > SDKPATH = "/usr/local/${SDK_NAME_PREFIX}-${SDK_ARCH}" > SDKPATHNATIVE = "${SDKPATH}/sysroots/${SDK_SYS}" > > -- > 2.17.1 > > > > > -- Christopher Larson kergoth at gmail dot com Founder - BitBake, OpenEmbedded, OpenZaurus Senior Software Engineer, Mentor Graphics [-- Attachment #2: Type: text/html, Size: 3415 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH v2] toolchain-scripts.bbclass: customize prompt string for SDKs 2021-02-25 15:29 ` [OE-core] " Christopher Larson @ 2021-02-26 1:57 ` kai 2021-02-26 2:39 ` Christopher Larson 2021-02-26 11:02 ` Richard Purdie 0 siblings, 2 replies; 6+ messages in thread From: kai @ 2021-02-26 1:57 UTC (permalink / raw) To: Christopher Larson Cc: Richard Purdie, Patches and discussions about the oe-core layer [-- Attachment #1: Type: text/plain, Size: 3235 bytes --] On 2/25/21 11:29 PM, Christopher Larson wrote: > Are we sure we want to completely override it rather than adding to > it? I'd be rather irritated if this blows away my prompt without my > asking for it. I think either it should append or have a variable > controlling whether this is enabled when building the SDK. The original requirement is that the PS1 after source sdk environment file is as same as the original one. It can not tell whether in a sdk environment. The default assignment of SDK_PS1 is '?=', you can set it in conf file to override it. Regards, Kai > > On Wed, Feb 24, 2021 at 10:59 PM kai <kai.kang@windriver.com > <mailto:kai.kang@windriver.com>> wrote: > > From: Kai Kang <kai.kang@windriver.com > <mailto:kai.kang@windriver.com>> > > Introduce a new variable SDK_PS1 to customize prompt string for SDKs > when source script environment-setup-script. > > The default prompt string of SDKs looks like: > > SDK-poky-glibc-x86_64--cortexa57-qemuarm64$ > > Signed-off-by: Kai Kang <kai.kang@windriver.com > <mailto:kai.kang@windriver.com>> > --- > v2: not set PS1 for buildtools-tarball > > meta/classes/toolchain-scripts.bbclass | 1 + > meta/conf/bitbake.conf | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/meta/classes/toolchain-scripts.bbclass > b/meta/classes/toolchain-scripts.bbclass > index db1d3215ef..88df373d0b 100644 > --- a/meta/classes/toolchain-scripts.bbclass > +++ b/meta/classes/toolchain-scripts.bbclass > @@ -45,6 +45,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 > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf > index 48af17fbf7..6075749a5e 100644 > --- a/meta/conf/bitbake.conf > +++ b/meta/conf/bitbake.conf > @@ -422,6 +422,7 @@ PKGDATA_DIR = "${TMPDIR}/pkgdata/${MACHINE}" > > SDK_NAME_PREFIX ?= "oecore" > SDK_NAME = "${SDK_NAME_PREFIX}-${SDK_ARCH}-${TUNE_PKGARCH}" > +SDK_PS1 ?= "SDK-${SDK_NAME}:\\\\$ " > SDKPATH = "/usr/local/${SDK_NAME_PREFIX}-${SDK_ARCH}" > SDKPATHNATIVE = "${SDKPATH}/sysroots/${SDK_SYS}" > > -- > 2.17.1 > > > > > > > -- > Christopher Larson > kergoth at gmail dot com > Founder - BitBake, OpenEmbedded, OpenZaurus > Senior Software Engineer, Mentor Graphics -- Kai Kang Wind River Linux [-- Attachment #2: Type: text/html, Size: 5367 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH v2] toolchain-scripts.bbclass: customize prompt string for SDKs 2021-02-26 1:57 ` kai @ 2021-02-26 2:39 ` Christopher Larson 2021-02-26 11:02 ` Richard Purdie 1 sibling, 0 replies; 6+ messages in thread From: Christopher Larson @ 2021-02-26 2:39 UTC (permalink / raw) To: Kai; +Cc: Richard Purdie, Patches and discussions about the oe-core layer [-- Attachment #1: Type: text/plain, Size: 3251 bytes --] There is no way with this patch to prevent it from mucking with the prompt at all. Setting that variable to the empty string will just empty the prompt instead. > On Feb 25, 2021, at 6:57 PM, Kai <kai.kang@windriver.com> wrote: > > > On 2/25/21 11:29 PM, Christopher Larson wrote: >> Are we sure we want to completely override it rather than adding to it? I'd be rather irritated if this blows away my prompt without my asking for it. I think either it should append or have a variable controlling whether this is enabled when building the SDK. > The original requirement is that the PS1 after source sdk environment file is as same as the original one. It can not tell whether in a sdk environment. > The default assignment of SDK_PS1 is '?=', you can set it in conf file to override it. > > Regards, > Kai > >> >> On Wed, Feb 24, 2021 at 10:59 PM kai <kai.kang@windriver.com> wrote: >>> From: Kai Kang <kai.kang@windriver.com> >>> >>> Introduce a new variable SDK_PS1 to customize prompt string for SDKs >>> when source script environment-setup-script. >>> >>> The default prompt string of SDKs looks like: >>> >>> SDK-poky-glibc-x86_64--cortexa57-qemuarm64$ >>> >>> Signed-off-by: Kai Kang <kai.kang@windriver.com> >>> --- >>> v2: not set PS1 for buildtools-tarball >>> >>> meta/classes/toolchain-scripts.bbclass | 1 + >>> meta/conf/bitbake.conf | 1 + >>> 2 files changed, 2 insertions(+) >>> >>> diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass >>> index db1d3215ef..88df373d0b 100644 >>> --- a/meta/classes/toolchain-scripts.bbclass >>> +++ b/meta/classes/toolchain-scripts.bbclass >>> @@ -45,6 +45,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 >>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf >>> index 48af17fbf7..6075749a5e 100644 >>> --- a/meta/conf/bitbake.conf >>> +++ b/meta/conf/bitbake.conf >>> @@ -422,6 +422,7 @@ PKGDATA_DIR = "${TMPDIR}/pkgdata/${MACHINE}" >>> >>> SDK_NAME_PREFIX ?= "oecore" >>> SDK_NAME = "${SDK_NAME_PREFIX}-${SDK_ARCH}-${TUNE_PKGARCH}" >>> +SDK_PS1 ?= "SDK-${SDK_NAME}:\\\\$ " >>> SDKPATH = "/usr/local/${SDK_NAME_PREFIX}-${SDK_ARCH}" >>> SDKPATHNATIVE = "${SDKPATH}/sysroots/${SDK_SYS}" >>> >>> -- >>> 2.17.1 >>> >>> >>> >>> >> >> >> -- >> Christopher Larson >> kergoth at gmail dot com >> Founder - BitBake, OpenEmbedded, OpenZaurus >> Senior Software Engineer, Mentor Graphics > > -- > Kai Kang > Wind River Linux [-- Attachment #2: Type: text/html, Size: 5705 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH v2] toolchain-scripts.bbclass: customize prompt string for SDKs 2021-02-26 1:57 ` kai 2021-02-26 2:39 ` Christopher Larson @ 2021-02-26 11:02 ` Richard Purdie 2021-02-26 17:25 ` kai 1 sibling, 1 reply; 6+ messages in thread From: Richard Purdie @ 2021-02-26 11:02 UTC (permalink / raw) To: Kai, Christopher Larson; +Cc: Patches and discussions about the oe-core layer On Fri, 2021-02-26 at 09:57 +0800, Kai wrote: > On 2/25/21 11:29 PM, Christopher Larson wrote: > > > Are we sure we want to completely override it rather than adding > > to it? I'd be rather irritated if this blows away my prompt > > without my asking for it. I think either it should append or > > have a variable controlling whether this is enabled when building > > the SDK. > The original requirement is that the PS1 after source sdk environment > file is as same as the original one. > It can not tell whether in a sdk environment. > > The default assignment of SDK_PS1 is '?=', you can set it in conf file to override it. I've held off this patch for a while since I think its going to *really* annoy a subset of users and as Chris says, it can't be disabled. It would really need to be disablable through configuration and at runtime when sourcing the script which isn't possible. I appreciate the usability issue it is trying to improve but I think it will cause more complaints than issues it solves. As such I don't think we want to do this... Cheers, Richard ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH v2] toolchain-scripts.bbclass: customize prompt string for SDKs 2021-02-26 11:02 ` Richard Purdie @ 2021-02-26 17:25 ` kai 0 siblings, 0 replies; 6+ messages in thread From: kai @ 2021-02-26 17:25 UTC (permalink / raw) To: Richard Purdie, Christopher Larson Cc: Patches and discussions about the oe-core layer On 2/26/21 7:02 PM, Richard Purdie wrote: > On Fri, 2021-02-26 at 09:57 +0800, Kai wrote: >> On 2/25/21 11:29 PM, Christopher Larson wrote: >> >>> Are we sure we want to completely override it rather than adding >>> to it? I'd be rather irritated if this blows away my prompt >>> without my asking for it. I think either it should append or >>> have a variable controlling whether this is enabled when building >>> the SDK. >> The original requirement is that the PS1 after source sdk environment >> file is as same as the original one. >> It can not tell whether in a sdk environment. >> >> The default assignment of SDK_PS1 is '?=', you can set it in conf file to override it. > I've held off this patch for a while since I think its going to > *really* annoy a subset of users and as Chris says, it can't > be disabled. It would really need to be disablable through configuration > and at runtime when sourcing the script which isn't possible. > > I appreciate the usability issue it is trying to improve but > I think it will cause more complaints than issues it solves. > As such I don't think we want to do this... I have been working on the issue Chiris says by adding a check for SDK_PS1. If do not want to change the current behavior, it could done by not set SDK_PS1 by default. It is better to have a chance to modify sdk prompt string. Regards, Kai > > Cheers, > > Richard > > > > -- Kai Kang Wind River Linux ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-02-26 17:26 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2021-02-25 5:59 [PATCH v2] toolchain-scripts.bbclass: customize prompt string for SDKs kai 2021-02-25 15:29 ` [OE-core] " Christopher Larson 2021-02-26 1:57 ` kai 2021-02-26 2:39 ` Christopher Larson 2021-02-26 11:02 ` Richard Purdie 2021-02-26 17:25 ` kai
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox