mirror of
https://github.com/ipxe/ipxe
synced 2025-12-20 20:10:18 +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:
@@ -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
|
||||
|
||||
@@ -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