[main] Remove shell prompt when using an embedded image

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2011-03-07 20:42:36 +00:00
parent 7752541bb7
commit 202cf094eb

View File

@@ -78,25 +78,24 @@ __asmcall int main ( void ) {
printf ( " %s", feature->name ); printf ( " %s", feature->name );
printf ( "\n" ); printf ( "\n" );
/* Boot system */
if ( ( image = first_image() ) != NULL ) {
/* We have an embedded image; execute it */
image_exec ( image );
} else {
/* Prompt for shell */ /* Prompt for shell */
if ( shell_banner() ) { if ( shell_banner() ) {
/* User wants shell; just give them a shell */ /* User wants shell; just give them a shell */
shell(); shell();
} else { } else {
/* User doesn't want shell; load and execute the first /* Try booting. If booting fails, offer the
* image, or autoboot() if we have no images. If * user another chance to enter the shell.
* booting fails for any reason, offer a second chance
* to enter the shell for diagnostics.
*/ */
if ( ( image = first_image() ) != NULL ) {
image_exec ( image );
} else {
autoboot(); autoboot();
}
if ( shell_banner() ) if ( shell_banner() )
shell(); shell();
} }
}
shutdown_exit(); shutdown_exit();