]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
common, menu: show menu on startup if CONFIG_MENU_SHOW is defined
authorHeiko Schocher <hs@denx.de>
Mon, 16 Jan 2012 21:13:35 +0000 (21:13 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Sun, 12 Feb 2012 09:11:24 +0000 (10:11 +0100)
show a menu on startup instead running the shell.

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Jason Hobbs <jason.hobbs@calxeda.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Acked-by: Jason Hobbs <jason.hobbs@calxeda.com>
common/main.c
doc/README.menu
include/menu.h

index 248744ba74d3449518e8ecf2a4197a00a8a56f51..91e888fd3ce0a3ef54c1996d153538e76e78707c 100644 (file)
@@ -41,6 +41,7 @@
 
 #include <post.h>
 #include <linux/ctype.h>
+#include <menu.h>
 
 #if defined(CONFIG_SILENT_CONSOLE) || defined(CONFIG_POST) || defined(CONFIG_CMDLINE_EDITING)
 DECLARE_GLOBAL_DATA_PTR;
@@ -372,6 +373,9 @@ void main_loop (void)
 
        debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay);
 
+#if defined(CONFIG_MENU_SHOW)
+       bootdelay = menu_show(bootdelay);
+#endif
 # ifdef CONFIG_BOOT_RETRY_TIME
        init_cmd_timeout ();
 # endif        /* CONFIG_BOOT_RETRY_TIME */
index 4ddf91491dab781908cfaf0db402a762b12880f3..6ce6bbab80728db810d75196e0c5615b4e9efb0a 100644 (file)
@@ -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
+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
 ----------
 #include "menu.h"
index b806a02b5ddbd156b00d16fa192afed9c73788f2..7af5fdb0edfa4302b3162f75518d02c63921ddb3 100644 (file)
@@ -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__ */