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
commit31f6d90b08fef699c4f0c822064ce86bae8d270e (patch)
treec7698799eef91dd486c60481f1212f79fbbd7f4f /perl-install/install
parentf3d731b3893b5cc42a38f808c41ba566ad82ff1a (diff)
downloaddrakx-backup-do-not-use-31f6d90b08fef699c4f0c822064ce86bae8d270e.tar
drakx-backup-do-not-use-31f6d90b08fef699c4f0c822064ce86bae8d270e.tar.gz
drakx-backup-do-not-use-31f6d90b08fef699c4f0c822064ce86bae8d270e.tar.bz2
drakx-backup-do-not-use-31f6d90b08fef699c4f0c822064ce86bae8d270e.tar.xz
drakx-backup-do-not-use-31f6d90b08fef699c4f0c822064ce86bae8d270e.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) {