diff options
| author | Michael Brown | 2006-12-20 08:04:08 +0100 |
|---|---|---|
| committer | Michael Brown | 2006-12-20 08:04:08 +0100 |
| commit | 84202d89f0fa83790a4d3f78119f1fb62c1b3d9b (patch) | |
| tree | 066eba0ee9db7e82922e662e7d6e5c29ac59d021 /src/core | |
| parent | Explicitly call erase(), to cope with platforms where the ANSI clear (diff) | |
| download | ipxe-84202d89f0fa83790a4d3f78119f1fb62c1b3d9b.tar.gz ipxe-84202d89f0fa83790a4d3f78119f1fb62c1b3d9b.tar.xz ipxe-84202d89f0fa83790a4d3f78119f1fb62c1b3d9b.zip | |
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.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/config.c | 3 | ||||
| -rw-r--r-- | src/core/main.c | 19 |
2 files changed, 9 insertions, 13 deletions
diff --git a/src/core/config.c b/src/core/config.c index c8ec9362f..b501ea552 100644 --- a/src/core/config.c +++ b/src/core/config.c @@ -143,6 +143,9 @@ REQUIRE_OBJECT ( pxe ); * Drag in all requested commands * */ +#ifdef BOOT_CMD +REQUIRE_OBJECT ( boot_cmd ); +#endif #ifdef NVO_CMD REQUIRE_OBJECT ( nvo_cmd ); #endif diff --git a/src/core/main.c b/src/core/main.c index 191ba8418..0a8ea1f1d 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -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 (); |
