mirror of
https://github.com/ipxe/ipxe
synced 2025-12-23 13:30:57 +03:00
Split the (quick hack) boot logic out from main.c to autoboot.c, add a
"boot" command to attempt booting from within the command shell, fall back to shell if boot fails for any reason.
This commit is contained in:
@@ -150,26 +150,19 @@ void test_dhcp ( struct net_device *netdev );
|
||||
MAIN - Kick off routine
|
||||
**************************************************************************/
|
||||
int main ( void ) {
|
||||
struct net_device *netdev;
|
||||
|
||||
/* Call all registered initialisation functions */
|
||||
init_heap();
|
||||
call_init_fns ();
|
||||
probe_devices();
|
||||
|
||||
if ( shell_banner() ) {
|
||||
shell();
|
||||
/* Try autobooting if we're not going straight to the shell */
|
||||
if ( ! shell_banner() ) {
|
||||
autoboot();
|
||||
}
|
||||
|
||||
netdev = next_netdev ();
|
||||
if ( netdev ) {
|
||||
test_dhcp ( netdev );
|
||||
} else {
|
||||
printf ( "No network device found\n" );
|
||||
}
|
||||
|
||||
printf ( "Press any key to exit\n" );
|
||||
getchar();
|
||||
|
||||
/* Autobooting failed or the user wanted the shell */
|
||||
shell();
|
||||
|
||||
remove_devices();
|
||||
call_exit_fns ();
|
||||
|
||||
Reference in New Issue
Block a user