From: Anatolij Gustschin <agust@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 2/4] New command bootmenu: ANSI terminal boot menu support
Date: Thu, 28 Mar 2013 16:32:47 +0100 [thread overview]
Message-ID: <20130328163247.77b671bc@crub> (raw)
In-Reply-To: <1364086388-13553-1-git-send-email-agust@denx.de>
On Sun, 24 Mar 2013 01:53:08 +0100
Anatolij Gustschin <agust@denx.de> wrote:
> From: Pali Roh?r <pali.rohar@gmail.com>
>
> The "bootmenu" command uses U-Boot menu interfaces and provides
> a simple mechanism for creating menus with several boot items.
> When running this command the menu will be assembled as defined
> by a set of environment variables which contain a title and
> command key-value pairs. The "Up" and "Down" keys are used for
> navigation through the items. Current active menu item is
> highlighted and can be selected using the "Enter" key.
>
> The command interprets and generates various ANSI escape
> sequencies, so for proper menu rendering and item selection
> the used terminal should support them.
>
> Signed-off-by: Pali Roh?r <pali.rohar@gmail.com>
> [agust: various fixes and documentation updates]
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
> Changes in v4:
> - coding style fixes
> - highlight only the menu entry title, not the whole line
> - don't return empty strings in bootmenu_choice_entry()
> to avoid useless searching for menu keys in the menu
> item list. Empty key strings won't be found anyway, so
> for down and up keys just return NULL in this function
> to indicate that no item selection happened yet
> - print error message if invalid bootmenu environment
> variable without title/command separator found
> - if number of menu items is equal to MAX_COUNT, the
> U-Boot console selection entry won't be generated.
> Fix it so that documented and real behaviour match
> - include entry key initialisation fix for proper
> menu behaviour when running in sandbox (without it
> the item selection by up/down keys didn't work
> in sandbox)
> - use puts() instead of printf() where appropriate
> - always use 1 for prompt argument for menu_create()
> so that the bootmenu command works as documented when
> using a negative delay value
> - call bootmenu_destroy() in the case if menu_create()
> fails (avoid memory leaks)
> - don't display the title of selected item before
> running the commands (but do it only if debugging
> is enabled)
> - don't change the argument of menu_display_statusline(),
> use exported menu_default_choice() instead and obtain
> the needed bootmenu data pointer in the custom
> menu_display_statusline() function
> - use lower case in menu header
> - update documentation in readme file for the command
>
> Changes in v3:
> - Do not use hardcoded numbers, added MAX_COUNT and MAX_ENV_SIZE
> - Use unsigned short int for menu number
> - Use enum bootmenu_key for key selection
> - Separate loop code from function bootmenu_choice_entry to bootmenu_loop and bootmenu_autoboot_loop
> - Updated README, added example
> - Use switches, added braces, fix style problems
>
> Changes in v2:
> - Added commit message
> - Removed bootmenu from include/config_cmd_all.h
> - Moved ANSI escape codes from include/common.h to include/ansi.h
> - Fixed style and indentation problems
> - Use mdelay instead udelay
> - Removed autoboot delay message when some key is pressed
>
> common/Makefile | 1 +
> common/cmd_bootmenu.c | 517 +++++++++++++++++++++++++++++++++++++++++++++++++
> doc/README.bootmenu | 115 +++++++++++
> include/ansi.h | 42 ++++
> 4 files changed, 675 insertions(+), 0 deletions(-)
> create mode 100644 common/cmd_bootmenu.c
> create mode 100644 doc/README.bootmenu
> create mode 100644 include/ansi.h
applied to staging/agust at denx.de. Thanks.
Anatolij
next prev parent reply other threads:[~2013-03-28 15:32 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-27 16:38 [U-Boot] [PATCH 0/2] ANSI terminal Bootmenu Pali Rohár
2012-05-27 16:38 ` [U-Boot] [PATCH 1/2] menu: Added support to use user defined functions Pali Rohár
2012-06-03 9:59 ` Marek Vasut
2012-06-03 10:05 ` Pali Rohár
2012-06-03 10:27 ` Marek Vasut
2012-05-27 16:38 ` [U-Boot] [PATCH 2/2] New command bootmenu: ANSI terminal Boot Menu support Pali Rohár
2012-06-03 10:06 ` Marek Vasut
2012-06-03 16:22 ` Luka Perkov
2012-06-03 18:27 ` Marek Vasut
2012-06-03 21:20 ` Luka Perkov
2012-11-01 11:39 ` [U-Boot] [PATCH v2 0/4] ANSI terminal Bootmenu Pali Rohár
2012-11-01 11:39 ` [U-Boot] [PATCH v2 1/4] menu: Added support to use user defined functions Pali Rohár
2012-11-01 11:39 ` [U-Boot] [PATCH v2 2/4] New command bootmenu: ANSI terminal Boot Menu support Pali Rohár
2012-11-13 8:27 ` Wolfgang Denk
2012-11-14 22:38 ` Pali Rohár
2012-11-01 11:39 ` [U-Boot] [PATCH v2 3/4] New command clear: Clear the ANSI terminal Pali Rohár
2012-11-13 8:09 ` Wolfgang Denk
2012-11-01 11:39 ` [U-Boot] [PATCH v2 4/4] RX-51: Add support for bootmenu Pali Rohár
2013-02-01 15:07 ` [U-Boot] [PATCH v3 0/4] ANSI terminal Bootmenu Pali Rohár
2013-02-01 15:07 ` [U-Boot] [PATCH v3 1/4] menu: Added support to use user defined functions Pali Rohár
2013-03-24 0:50 ` [U-Boot] [PATCH v4 1/4] menu: Add support for user defined item choice function Anatolij Gustschin
2013-03-24 0:52 ` [U-Boot] [PATCH] menu: export menu_default_choice() function Anatolij Gustschin
2013-03-28 15:26 ` Anatolij Gustschin
2013-03-28 15:26 ` [U-Boot] [PATCH v4 1/4] menu: Add support for user defined item choice function Anatolij Gustschin
2013-02-01 15:07 ` [U-Boot] [PATCH v3 2/4] New command bootmenu: ANSI terminal Boot Menu support Pali Rohár
2013-03-24 0:53 ` [U-Boot] [PATCH v4 2/4] New command bootmenu: ANSI terminal boot menu support Anatolij Gustschin
2013-03-25 19:29 ` Anatolij Gustschin
2013-03-26 15:19 ` Pali Rohár
2013-03-28 15:29 ` Anatolij Gustschin
2013-03-28 15:32 ` Anatolij Gustschin [this message]
2013-03-28 19:18 ` Pali Rohár
2013-03-28 23:13 ` Anatolij Gustschin
2013-03-29 6:51 ` Pali Rohár
2013-02-01 15:07 ` [U-Boot] [PATCH v3 3/4] New command clear: Clear the ANSI terminal Pali Rohár
2013-02-01 15:07 ` [U-Boot] [PATCH v3 4/4] RX-51: Add support for bootmenu Pali Rohár
2013-03-07 15:15 ` Pali Rohár
2013-03-28 23:26 ` Anatolij Gustschin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130328163247.77b671bc@crub \
--to=agust@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox