[U-Boot] [PATCH 3/3 v2] common, menu: show menu on startup if CONFIG_MENU_SHOW is defined

Jason Hobbs jason.hobbs at calxeda.com
Tue Jan 17 13:55:55 CET 2012


Dear Heiko,

On Tue, Jan 17, 2012 at 02:13:35AM -0500, Heiko Schocher wrote:
> show a menu on startup instead running the shell.
> 
> Signed-off-by: Heiko Schocher <hs at denx.de>
> Cc: Jason Hobbs <jason.hobbs at calxeda.com>
> Cc: Mike Frysinger <vapier at gentoo.org>

A couple of minor fixes in your README addition below, otherwise:

Acked-by: Jason Hobbs <jason.hobbs at calxeda.com>

> ---
> - changes for v2:
>   - add comments from Mike Frysinger <vapier at gentoo.org>
>     - pass current bootdelay to menu_show
> 
>  common/main.c   |    4 ++++
>  doc/README.menu |    5 +++++
>  include/menu.h  |    3 +++
>  3 files changed, 12 insertions(+), 0 deletions(-)
> 
...
> diff --git a/doc/README.menu b/doc/README.menu
> index 4ddf914..6ce6bba 100644
> --- a/doc/README.menu
> +++ b/doc/README.menu
> @@ -25,6 +25,11 @@ the interfaces should be available.
>  Menus are composed of items. Each item has a key used to identify it in
>  the menu, and an opaque pointer to data controlled by the consumer.
>  
> +If you want to show a menu, instead starting the shell, define

"instead of starting the shell"

> +CONFIG_MENU_SHOW. You have to code the int menu_show(int bootdelay)
> +function, which handle your menu. This function returns the remaining

"which handles"

> +bootdelay.
> +
>  Interfaces
>  ----------
>  #include "menu.h"
> diff --git a/include/menu.h b/include/menu.h
> index b806a02..7af5fdb 100644
> --- a/include/menu.h
> +++ b/include/menu.h
> @@ -28,4 +28,7 @@ int menu_item_add(struct menu *m, char *item_key, void *item_data);
>  int menu_destroy(struct menu *m);
>  void menu_display_statusline(struct menu *m);
>  
> +#if defined(CONFIG_MENU_SHOW)
> +int menu_show(int bootdelay);
> +#endif
>  #endif /* __MENU_H__ */
> -- 
> 1.7.7.4
> 


More information about the U-Boot mailing list