[autoboot] Use generic option-parsing library

Total saving: 32 bytes.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2010-11-21 16:39:36 +00:00
parent 2877af3ff5
commit 17b337d4a8
3 changed files with 92 additions and 33 deletions

View File

@@ -293,22 +293,24 @@ static void close_all_netdevs ( void ) {
/**
* Boot the system
*/
void autoboot ( void ) {
int autoboot ( void ) {
struct net_device *boot_netdev;
struct net_device *netdev;
int rc = -ENODEV;
/* If we have an identifable boot device, try that first */
close_all_netdevs();
if ( ( boot_netdev = find_boot_netdev() ) )
netboot ( boot_netdev );
rc = netboot ( boot_netdev );
/* If that fails, try booting from any of the other devices */
for_each_netdev ( netdev ) {
if ( netdev == boot_netdev )
continue;
close_all_netdevs();
netboot ( netdev );
rc = netboot ( netdev );
}
printf ( "No more network devices\n" );
return rc;
}