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