Skip to content
Snippets Groups Projects
Commit 317d6c57 authored by Heiko Schocher's avatar Heiko Schocher Committed by Albert ARIBAUD
Browse files

common, menu: show menu on startup if CONFIG_MENU_SHOW is defined


show a menu on startup instead running the shell.

Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
Cc: Jason Hobbs <jason.hobbs@calxeda.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Acked-by: default avatarJason Hobbs <jason.hobbs@calxeda.com>
parent e0611dd9
No related branches found
No related tags found
No related merge requests found
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <post.h> #include <post.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <menu.h>
#if defined(CONFIG_SILENT_CONSOLE) || defined(CONFIG_POST) || defined(CONFIG_CMDLINE_EDITING) #if defined(CONFIG_SILENT_CONSOLE) || defined(CONFIG_POST) || defined(CONFIG_CMDLINE_EDITING)
DECLARE_GLOBAL_DATA_PTR; DECLARE_GLOBAL_DATA_PTR;
...@@ -372,6 +373,9 @@ void main_loop (void) ...@@ -372,6 +373,9 @@ void main_loop (void)
debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay); debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay);
#if defined(CONFIG_MENU_SHOW)
bootdelay = menu_show(bootdelay);
#endif
# ifdef CONFIG_BOOT_RETRY_TIME # ifdef CONFIG_BOOT_RETRY_TIME
init_cmd_timeout (); init_cmd_timeout ();
# endif /* CONFIG_BOOT_RETRY_TIME */ # endif /* CONFIG_BOOT_RETRY_TIME */
......
...@@ -25,6 +25,11 @@ the interfaces should be available. ...@@ -25,6 +25,11 @@ the interfaces should be available.
Menus are composed of items. Each item has a key used to identify it in 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. the menu, and an opaque pointer to data controlled by the consumer.
If you want to show a menu, instead starting the shell, define
CONFIG_MENU_SHOW. You have to code the int menu_show(int bootdelay)
function, which handle your menu. This function returns the remaining
bootdelay.
Interfaces Interfaces
---------- ----------
#include "menu.h" #include "menu.h"
......
...@@ -28,4 +28,7 @@ int menu_item_add(struct menu *m, char *item_key, void *item_data); ...@@ -28,4 +28,7 @@ int menu_item_add(struct menu *m, char *item_key, void *item_data);
int menu_destroy(struct menu *m); int menu_destroy(struct menu *m);
void menu_display_statusline(struct menu *m); void menu_display_statusline(struct menu *m);
#if defined(CONFIG_MENU_SHOW)
int menu_show(int bootdelay);
#endif
#endif /* __MENU_H__ */ #endif /* __MENU_H__ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment