diff mbox

[U-Boot,12/12] kconfig: add config option for shell prompt

Message ID 1437661179-32128-13-git-send-email-nikita@compulab.co.il
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Nikita Kiryanov July 23, 2015, 2:19 p.m. UTC
Add option to set shell prompt string from menuconfig and use it
when migrating CONFIG_SYS_PROMPT to cm-fx6 defconfig.

Cc: Tom Rini <trini@konsulko.com>
Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
---
 common/Kconfig           | 7 +++++++
 configs/cm_fx6_defconfig | 1 +
 include/configs/cm_fx6.h | 1 -
 3 files changed, 8 insertions(+), 1 deletion(-)

Comments

Tom Rini July 23, 2015, 9:21 p.m. UTC | #1
On Thu, Jul 23, 2015 at 05:19:39PM +0300, Nikita Kiryanov wrote:

> Add option to set shell prompt string from menuconfig and use it
> when migrating CONFIG_SYS_PROMPT to cm-fx6 defconfig.
> 
> Cc: Tom Rini <trini@konsulko.com>
> Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>

Conceptually, I like.

> ---
>  common/Kconfig           | 7 +++++++
>  configs/cm_fx6_defconfig | 1 +
>  include/configs/cm_fx6.h | 1 -
>  3 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/common/Kconfig b/common/Kconfig
> index 40cd69e..6b24fd9 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -17,6 +17,13 @@ config SYS_HUSH_PARSER
>  	help
>  	  Backward compatibility.
>  
> +config SYS_PROMPT
> +	string "Shell prompt"
> +	default "# "

How about "U-Boot> " which while not what I had been forcing everyone in
TI-land to use, is the most common.
Masahiro Yamada July 24, 2015, 2:05 a.m. UTC | #2
2015-07-24 6:21 GMT+09:00 Tom Rini <trini@konsulko.com>:
> On Thu, Jul 23, 2015 at 05:19:39PM +0300, Nikita Kiryanov wrote:
>
>> Add option to set shell prompt string from menuconfig and use it
>> when migrating CONFIG_SYS_PROMPT to cm-fx6 defconfig.
>>
>> Cc: Tom Rini <trini@konsulko.com>
>> Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
>> Cc: Stefano Babic <sbabic@denx.de>
>> Cc: Igor Grinberg <grinberg@compulab.co.il>
>> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
>
> Conceptually, I like.



This patch breaks many boards.


$ make zmx25_defconfig && make CROSS_COMPILE=arm-linux-gnueabi-
    ...
  CC      arch/arm/cpu/arm926ejs/cpu.o
In file included from include/config.h:5:0,
                 from include/common.h:18,
                 from arch/arm/cpu/arm926ejs/cpu.c:16:
include/configs/zmx25.h:141:0: warning: "CONFIG_SYS_PROMPT" redefined
[enabled by default]
In file included from ././include/linux/kconfig.h:4:0,
                 from <command-line>:0:
include/generated/autoconf.h:48:0: note: this is the location of the
previous definition
  CC      arch/arm/cpu/arm926ejs/cache.o
In file included from include/config.h:5:0,
                 from include/common.h:18,
                 from arch/arm/cpu/arm926ejs/cache.c:8:
include/configs/zmx25.h:141:0: warning: "CONFIG_SYS_PROMPT" redefined
[enabled by default]
In file included from ././include/linux/kconfig.h:4:0,
                 from <command-line>:0:
include/generated/autoconf.h:48:0: note: this is the location of the
previous definition
  CC      arch/arm/cpu/arm926ejs/mx25/generic.o
In file included from include/config.h:5:0,
                 from include/common.h:18,
                 from arch/arm/cpu/arm926ejs/mx25/generic.c:12:
include/configs/zmx25.h:141:0: warning: "CONFIG_SYS_PROMPT" redefined
[enabled by default]
In file included from ././include/linux/kconfig.h:4:0,
                 from <command-line>:0:




This move should be done globally like what Joe does.







>> ---
>>  common/Kconfig           | 7 +++++++
>>  configs/cm_fx6_defconfig | 1 +
>>  include/configs/cm_fx6.h | 1 -
>>  3 files changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/common/Kconfig b/common/Kconfig
>> index 40cd69e..6b24fd9 100644
>> --- a/common/Kconfig
>> +++ b/common/Kconfig
>> @@ -17,6 +17,13 @@ config SYS_HUSH_PARSER
>>       help
>>         Backward compatibility.
>>
>> +config SYS_PROMPT
>> +     string "Shell prompt"
>> +     default "# "
>
> How about "U-Boot> " which while not what I had been forcing everyone in
> TI-land to use, is the most common.



No.

We had already decided the default prompt is "=> ".


See include/config_fallbacks.h

and below:



commit 0defddc851edfc34bcf3c3379fe74b11dc01a493
Author: Rob Herring <rob.herring@calxeda.com>
Date:   Mon Sep 30 17:11:48 2013 -0500

    config: Add a default CONFIG_SYS_PROMPT

    The definitions for CONFIG_SYS_PROMPT are varied with little reason other
    than to display the board name. Over half the definitions are "==> ", so
    make this the default. The rest of the boards remain unchanged to avoid
    breaking any external scripts expecting a certain prompt.

    Signed-off-by: Rob Herring <rob.herring@calxeda.com>
    Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Nikita Kiryanov July 26, 2015, 8:44 a.m. UTC | #3
On Fri, Jul 24, 2015 at 11:05:22AM +0900, Masahiro Yamada wrote:
> 2015-07-24 6:21 GMT+09:00 Tom Rini <trini@konsulko.com>:
> > On Thu, Jul 23, 2015 at 05:19:39PM +0300, Nikita Kiryanov wrote:
> >
> >> Add option to set shell prompt string from menuconfig and use it
> >> when migrating CONFIG_SYS_PROMPT to cm-fx6 defconfig.
> >>
> >> Cc: Tom Rini <trini@konsulko.com>
> >> Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
> >> Cc: Stefano Babic <sbabic@denx.de>
> >> Cc: Igor Grinberg <grinberg@compulab.co.il>
> >> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
> >
> > Conceptually, I like.
> 
> 
> 
> This patch breaks many boards.

V2 with a makeall coming up.

> -- 
> Best Regards
> Masahiro Yamada
>
diff mbox

Patch

diff --git a/common/Kconfig b/common/Kconfig
index 40cd69e..6b24fd9 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -17,6 +17,13 @@  config SYS_HUSH_PARSER
 	help
 	  Backward compatibility.
 
+config SYS_PROMPT
+	string "Shell prompt"
+	default "# "
+	help
+	  This string is displayed in the command line to the left of the
+	  cursor.
+
 menu "Autoboot options"
 
 config AUTOBOOT_KEYED
diff --git a/configs/cm_fx6_defconfig b/configs/cm_fx6_defconfig
index 2aba359..66fc382 100644
--- a/configs/cm_fx6_defconfig
+++ b/configs/cm_fx6_defconfig
@@ -30,3 +30,4 @@  CONFIG_USB_EHCI_MX6=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
+CONFIG_SYS_PROMPT="CM-FX6 # "
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
index bbd9f38..ddf6b5f 100644
--- a/include/configs/cm_fx6.h
+++ b/include/configs/cm_fx6.h
@@ -45,7 +45,6 @@ 
 #define CONFIG_SYS_BAUDRATE_TABLE	{9600, 19200, 38400, 57600, 115200}
 
 /* Shell */
-#define CONFIG_SYS_PROMPT	"CM-FX6 # "
 #define CONFIG_SYS_PBSIZE	(CONFIG_SYS_CBSIZE + \
 					sizeof(CONFIG_SYS_PROMPT) + 16)