summaryrefslogtreecommitdiffstats
path: root/perl-install/install
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-05-23 18:26:39 +0000
committerThierry Vignaud <tv@mageia.org>2012-05-23 18:26:39 +0000
commitc2a4fb4d1b5822892cf9d9e362830daba841bb77 (patch)
treec7698799eef91dd486c60481f1212f79fbbd7f4f /perl-install/install
parenta14b91302728610e6701fe1260c2396f0316b695 (diff)
downloaddrakx-c2a4fb4d1b5822892cf9d9e362830daba841bb77.tar
drakx-c2a4fb4d1b5822892cf9d9e362830daba841bb77.tar.gz
drakx-c2a4fb4d1b5822892cf9d9e362830daba841bb77.tar.bz2
drakx-c2a4fb4d1b5822892cf9d9e362830daba841bb77.tar.xz
drakx-c2a4fb4d1b5822892cf9d9e362830daba841bb77.zip
(read_stage1_net_conf) split it out of main()
Diffstat (limited to 'perl-install/install')
-rw-r--r--perl-install/install/install2.pm56
1 files changed, 29 insertions, 27 deletions
diff --git a/perl-install/install/install2.pm b/perl-install/install/install2.pm
index 68e018644..37a70eed6 100644
--- a/perl-install/install/install2.pm
+++ b/perl-install/install/install2.pm
@@ -344,6 +344,34 @@ sub sig_segv_handler() {
install::steps_auto_install_non_interactive::errorInStep($o, $msg);
}
+sub read_stage1_net_conf() {
+ require network::network;
+ #- get stage1 network configuration if any.
+ log::l('found /tmp/network');
+ add2hash($o->{net}{network} ||= {}, network::network::read_conf('/tmp/network'));
+ if (my ($file) = glob_('/tmp/ifcfg-*')) {
+ log::l("found network config file $file");
+ my $l = network::network::read_interface_conf($file);
+ $o->{net}{ifcfg}{$l->{DEVICE}} ||= $l;
+ }
+ my $dsl_device = find { $_->{BOOTPROTO} eq 'adsl_pppoe' } values %{$o->{net}{ifcfg}};
+ if ($dsl_device) {
+ $o->{net}{type} = 'adsl';
+ $o->{net}{net_interface} = $dsl_device->{DEVICE};
+ $o->{net}{adsl} = {
+ method => 'pppoe',
+ device => $dsl_device->{DEVICE},
+ ethernet_device => $dsl_device->{DEVICE},
+ login => $dsl_device->{USER},
+ password => $dsl_device->{PASS},
+ };
+ %$dsl_device = ();
+ } else {
+ $o->{net}{type} = 'lan';
+ $o->{net}{net_interface} = first(values %{$o->{net}{ifcfg}});
+ }
+}
+
#-######################################################################################
#- MAIN
#-######################################################################################
@@ -465,33 +493,7 @@ sub main {
modules::read_already_loaded($o->{modules_conf});
#- done before auto_install is called to allow the -IP feature on auto_install file name
- if (-e '/tmp/network') {
- require network::network;
- #- get stage1 network configuration if any.
- log::l('found /tmp/network');
- add2hash($o->{net}{network} ||= {}, network::network::read_conf('/tmp/network'));
- if (my ($file) = glob_('/tmp/ifcfg-*')) {
- log::l("found network config file $file");
- my $l = network::network::read_interface_conf($file);
- $o->{net}{ifcfg}{$l->{DEVICE}} ||= $l;
- }
- my $dsl_device = find { $_->{BOOTPROTO} eq 'adsl_pppoe' } values %{$o->{net}{ifcfg}};
- if ($dsl_device) {
- $o->{net}{type} = 'adsl';
- $o->{net}{net_interface} = $dsl_device->{DEVICE};
- $o->{net}{adsl} = {
- method => 'pppoe',
- device => $dsl_device->{DEVICE},
- ethernet_device => $dsl_device->{DEVICE},
- login => $dsl_device->{USER},
- password => $dsl_device->{PASS},
- };
- %$dsl_device = ();
- } else {
- $o->{net}{type} = 'lan';
- $o->{net}{net_interface} = first(values %{$o->{net}{ifcfg}});
- }
- }
+ read_stage1_net_conf() if -e '/tmp/network';
#- done after module dependencies are loaded for "vfat depends on fat"
if ($::auto_install) {