diff --git a/network.c b/network.c index bee6dc4..786e531 100644 --- a/network.c +++ b/network.c @@ -597,12 +597,16 @@ static enum return_type intf_select_and_up(void) { static struct interface_info intf[20]; static int num_interfaces = 0; + static int already_done = 0; struct interface_info * sel_intf = NULL; int i; enum return_type results; - char * iface = interface_select(); - - if (iface == NULL) + char * iface = NULL; + + + if (already_done) return RETURN_OK; + + if ((iface = interface_select()) == NULL) return RETURN_BACK; for (i = 0; i < num_interfaces ; i++) @@ -618,13 +622,18 @@ static enum return_type intf_select_and_up(void) results = bringup_networking(sel_intf); - if (results == RETURN_OK) + if (results == RETURN_OK) { save_netinfo(sel_intf); - + already_done = 1; + } + return results; } - +enum return_type net_prepare(void) +{ + return (*(get_auto_value("network")) == '\0') ? RETURN_OK : intf_select_and_up(); +} enum return_type nfs_prepare(void) { diff --git a/network.h b/network.h index 97a4faa..d477e10 100644 --- a/network.h +++ b/network.h @@ -26,7 +26,7 @@ #include #include - +enum return_type net_prepare(void); enum return_type nfs_prepare(void); enum return_type ftp_prepare(void); enum return_type http_prepare(void); diff --git a/stage1.c b/stage1.c index c258824..a9dd0e2 100644 --- a/stage1.c +++ b/stage1.c @@ -272,6 +272,12 @@ static enum return_type method_select_and_prepare(void) #endif means[i] = NULL; update_splash(); + +#ifndef DISABLE_NETWORK + /* if requested by auto "network" param, bring networking up, regardless of method */ + net_prepare(); +#endif + results = ask_from_list_auto("Please choose the installation method.", means, &choice, "method", means_auto); if (results != RETURN_OK)