Przeglądaj źródła

[main] Remove shell prompt when using an embedded image

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 13 lat temu
rodzic
commit
202cf094eb
1 zmienionych plików z 13 dodań i 14 usunięć
  1. 13
    14
      src/core/main.c

+ 13
- 14
src/core/main.c Wyświetl plik

@@ -78,24 +78,23 @@ __asmcall int main ( void ) {
78 78
 		printf ( " %s", feature->name );
79 79
 	printf ( "\n" );
80 80
 
81
-	/* Prompt for shell */
82
-	if ( shell_banner() ) {
83
-		/* User wants shell; just give them a shell */
84
-		shell();
81
+	/* Boot system */
82
+	if ( ( image = first_image() ) != NULL ) {
83
+		/* We have an embedded image; execute it */
84
+		image_exec ( image );
85 85
 	} else {
86
-		/* User doesn't want shell; load and execute the first
87
-		 * image, or autoboot() if we have no images.  If
88
-		 * booting fails for any reason, offer a second chance
89
-		 * to enter the shell for diagnostics.
90
-		 */
91
-		if ( ( image = first_image() ) != NULL ) {
92
-			image_exec ( image );
86
+		/* Prompt for shell */
87
+		if ( shell_banner() ) {
88
+			/* User wants shell; just give them a shell */
89
+			shell();
93 90
 		} else {
91
+			/* Try booting.  If booting fails, offer the
92
+			 * user another chance to enter the shell.
93
+			 */
94 94
 			autoboot();
95
+			if ( shell_banner() )
96
+				shell();
95 97
 		}
96
-
97
-		if ( shell_banner() )
98
-			shell();
99 98
 	}
100 99
 
101 100
 	shutdown_exit();

Ładowanie…
Anuluj
Zapisz