aboutsummaryrefslogtreecommitdiffstats
path: root/gpxe/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'gpxe/src/core')
-rw-r--r--gpxe/src/core/main.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gpxe/src/core/main.c b/gpxe/src/core/main.c
index 8d360c42..bd2428f0 100644
--- a/gpxe/src/core/main.c
+++ b/gpxe/src/core/main.c
@@ -71,13 +71,17 @@ __asmcall int main ( void ) {
shell();
} else {
/* User doesn't want shell; load and execute the first
- * image. If booting fails (i.e. if the image
- * returns, or fails to execute), offer a second
- * chance to enter the shell for diagnostics.
+ * image, or autoboot() if we have no images. If
+ * booting fails for any reason, offer a second chance
+ * to enter the shell for diagnostics.
*/
- for_each_image ( image ) {
- image_exec ( image );
- break;
+ if ( have_images() ) {
+ for_each_image ( image ) {
+ image_exec ( image );
+ break;
+ }
+ } else {
+ autoboot();
}
if ( shell_banner() )