From 83b51c245c7ababbd67e8f7631635c6961ee00ec Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 19 Feb 2002 11:09:13 +0000 Subject: move loading /tmp/network from stage1 before doing the auto_install stuff to allow the -IP feature on auto_install file name --- perl-install/install2.pm | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) (limited to 'perl-install') diff --git a/perl-install/install2.pm b/perl-install/install2.pm index e810dedee..be55018c1 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -455,8 +455,31 @@ sub main { modules::read_stage1_conf($_) foreach "/tmp/conf.modules", "/etc/modules.conf"; modules::read_already_loaded(); + #- done before auto_install is called to allow the -IP feature on auto_install file name + if (-e '/tmp/network') { + require network; + #- get stage1 network configuration if any. + log::l('found /tmp/network'); + $o->{netc} ||= {}; + add2hash($o->{netc}, network::read_conf('/tmp/network')); + if (my ($file) = glob_('/tmp/ifcfg-*')) { + log::l("found network config file $file"); + my $l = network::read_interface_conf($file); + $o->{intf} ||= { $l->{DEVICE} => $l }; + } + if (-e '/etc/resolv.conf') { + my $file ='/etc/resolv.conf'; + log::l("found network config file $file"); + add2hash($o->{netc}, network::read_resolv_conf($file)); + } + } + #- done after module dependencies are loaded for "vfat depends on fat" if ($::auto_install) { + if ($::auto_install =~ /-IP(\.pl)?/) { + my $ip = join('', map { sprintf "%02X", $_ } split '\.', $o->{intf}{IPADDR}); + $::auto_install =~ s/-IP(\.pl)?/-$ip$1/; + } require install_steps_auto_install; eval { $o = $::o = install_any::loadO($o, $::auto_install) }; if ($@) { @@ -534,23 +557,6 @@ sub main { } $::o = $o = $o_; - if (-e '/tmp/network') { - require network; - #- get stage1 network configuration if any. - log::l('found /tmp/network'); - $o->{netc} ||= {}; - add2hash($o->{netc}, network::read_conf('/tmp/network')); - if (my ($file) = glob_('/tmp/ifcfg-*')) { - log::l("found network config file $file"); - my $l = network::read_interface_conf($file); - $o->{intf} ||= { $l->{DEVICE} => $l }; - } - if (-e '/etc/resolv.conf') { - my $file ='/etc/resolv.conf'; - log::l("found network config file $file"); - add2hash($o->{netc}, network::read_resolv_conf($file)); - } - } install_any::remove_unused() if common::usingRamdisk(); #-the main cycle -- cgit v1.2.1