How to customize u-boot default prompt text

In this quick tutorial we’re going to edit the default prompt text of u-boot bootloader.

default prompt

 

To customize the prompt text you need to edit the appropriate configuration file.

  1. Locate the configuration file and open it with a text editor
    $ gedit uboot-imx/include/configs/mx6var_som.h  
  2. Locate the following lines in the file
    #ifdef CONFIG_SYS_BOOT_NAND  
    #define CONFIG_SYS_PROMPT		"VAR_SOM_MX6(nand) U-Boot > "  
    #else
    #define CONFIG_SYS_PROMPT		"VAR_SOM_MX6(sd) U-Boot > "  
    #endif  
  3. Replace the prompt text with whatever you like. For example:
    #ifdef CONFIG_SYS_BOOT_NAND  
    #define CONFIG_SYS_PROMPT		"VAR_SOM_MX6 on Amber board (nand)> "  
    #else  
    #define CONFIG_SYS_PROMPT		"VAR_SOM_MX6 on Amber board (sd) > "  
    #endif  
  4. Save the file and compile again
    $ cd uboot-imx/
    $ export ARCH=arm  
    $ export CROSS_COMPILE=arm-linux-gnueabihf-  
    $ make mrproper
    $ make mx6var_som_sd_config  
    $ make  
  5. Flash the SPL and the u-boot image again and boot the board from SD-Card to see the changes.
custom prompt