bring networking up, if requested by auto "network" param, regardless of method

This commit is contained in:
Sergey Bolshakov 2008-11-12 17:23:06 +03:00
parent bc38419306
commit c075380f3d
3 changed files with 22 additions and 7 deletions

View File

@ -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();
char * iface = NULL;
if (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)
{

View File

@ -26,7 +26,7 @@
#include <netinet/ip.h>
#include <arpa/inet.h>
enum return_type net_prepare(void);
enum return_type nfs_prepare(void);
enum return_type ftp_prepare(void);
enum return_type http_prepare(void);

View File

@ -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)