diff options
author | Michael Brown | 2011-03-07 21:42:36 +0100 |
---|---|---|
committer | Michael Brown | 2011-03-07 21:42:36 +0100 |
commit | 202cf094ebcbea4dec43e57ae29a3bbe808807e4 (patch) | |
tree | 85db970f6e29503d7ee98db26d1e5b9da7d2feaa /src/core/main.c | |
parent | [image] Use list_first_entry() to clarify logic in main() (diff) | |
download | ipxe-202cf094ebcbea4dec43e57ae29a3bbe808807e4.tar.gz ipxe-202cf094ebcbea4dec43e57ae29a3bbe808807e4.tar.xz ipxe-202cf094ebcbea4dec43e57ae29a3bbe808807e4.zip |
[main] Remove shell prompt when using an embedded image
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/main.c')
-rw-r--r-- | src/core/main.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/core/main.c b/src/core/main.c index 7d411d6a..aac27e9b 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -78,24 +78,23 @@ __asmcall int main ( void ) { printf ( " %s", feature->name ); printf ( "\n" ); - /* Prompt for shell */ - if ( shell_banner() ) { - /* User wants shell; just give them a shell */ - shell(); + /* Boot system */ + if ( ( image = first_image() ) != NULL ) { + /* We have an embedded image; execute it */ + image_exec ( image ); } else { - /* User doesn't want shell; load and execute the first - * image, or autoboot() if we have no images. If - * booting fails for any reason, offer a second chance - * to enter the shell for diagnostics. - */ - if ( ( image = first_image() ) != NULL ) { - image_exec ( image ); + /* Prompt for shell */ + if ( shell_banner() ) { + /* User wants shell; just give them a shell */ + shell(); } else { + /* Try booting. If booting fails, offer the + * user another chance to enter the shell. + */ autoboot(); + if ( shell_banner() ) + shell(); } - - if ( shell_banner() ) - shell(); } shutdown_exit(); |