[prompt] Replace shell_banner() with a generic prompt() function

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2011-03-07 17:42:06 +00:00
parent 9d633bdc71
commit c4b6c244b0
5 changed files with 64 additions and 37 deletions

View File

@@ -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>
@@ -27,6 +28,21 @@ FILE_LICENCE ( GPL2_OR_LATER );
#define BOLD "\033[1m"
#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
*