summaryrefslogtreecommitdiffstats
path: root/src/core/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 8d360c42..bd2428f0 100644
--- a/src/core/main.c
+++ b/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() )