diff options
author | Michael Brown | 2011-03-07 18:42:06 +0100 |
---|---|---|
committer | Michael Brown | 2011-03-07 20:53:53 +0100 |
commit | c4b6c244b0cc0380451c6f087e8d009f3f490926 (patch) | |
tree | 2bc13ef8ef452691ace42742f6efd787d4895718 /src/core/main.c | |
parent | [console] Add a timeout parameter to getkey() (diff) | |
download | ipxe-c4b6c244b0cc0380451c6f087e8d009f3f490926.tar.gz ipxe-c4b6c244b0cc0380451c6f087e8d009f3f490926.tar.xz ipxe-c4b6c244b0cc0380451c6f087e8d009f3f490926.zip |
[prompt] Replace shell_banner() with a generic prompt() function
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/main.c')
-rw-r--r-- | src/core/main.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/core/main.c b/src/core/main.c index e2b4e3e2..35f31c2c 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -18,8 +18,9 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include <ipxe/init.h> #include <ipxe/features.h> #include <ipxe/shell.h> -#include <ipxe/shell_banner.h> #include <ipxe/image.h> +#include <ipxe/keys.h> +#include <usr/prompt.h> #include <usr/autoboot.h> #include <config/general.h> @@ -28,6 +29,21 @@ FILE_LICENCE ( GPL2_OR_LATER ); #define CYAN "\033[36m" /** + * Prompt for shell entry + * + * @ret enter_shell User wants to enter shell + */ +static int shell_banner ( void ) { + + /* Skip prompt if timeout is zero */ + if ( BANNER_TIMEOUT <= 0 ) + return 0; + + return ( prompt ( "\nPress Ctrl-B for the iPXE command line...", + ( BANNER_TIMEOUT * 100 ), CTRL_B ) == 0 ); +} + +/** * Main entry point * * @ret rc Return status code |