diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2002-03-07 18:31:22 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2002-03-07 18:31:22 +0000 |
commit | 48cb18a9abc36180a546cd29d821c20b18053306 (patch) | |
tree | cf7a00ec37d2ff3eefc088180273fa7d5782bf53 | |
parent | ad6d41d9fd97f0ea3ec106ee5d61f3a8c1481aed (diff) | |
download | drakx-backup-do-not-use-48cb18a9abc36180a546cd29d821c20b18053306.tar drakx-backup-do-not-use-48cb18a9abc36180a546cd29d821c20b18053306.tar.gz drakx-backup-do-not-use-48cb18a9abc36180a546cd29d821c20b18053306.tar.bz2 drakx-backup-do-not-use-48cb18a9abc36180a546cd29d821c20b18053306.tar.xz drakx-backup-do-not-use-48cb18a9abc36180a546cd29d821c20b18053306.zip |
generate_automatic_stage1_params: also save
the interface number in case the machine will
have several interfaces; clean code a bit
-rw-r--r-- | perl-install/install_any.pm | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 977a9ad66..73b58d189 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -840,25 +840,29 @@ sub generate_automatic_stage1_params { my @ks = "method:$o->{method}"; - if ($o->{method} =~ /http/) { + if ($o->{method} eq 'http') { "$ENV{URLPREFIX}" =~ m|http://([^/:]+)/(.*)| or die; push @ks, "server:$1", "directory:$2"; - } elsif ($o->{method} =~ /ftp/) { + } elsif ($o->{method} eq 'ftp') { push @ks, "server:$ENV{HOST}", "directory:$ENV{PREFIX}", "user:$ENV{LOGIN}", "pass:$ENV{PASSWORD}"; - } elsif ($o->{method} =~ /nfs/) { + } elsif ($o->{method} eq 'nfs') { cat_("/proc/mounts") =~ m|(\S+):(\S+)\s+/tmp/image nfs| or die; push @ks, "server:$1", "directory:$2"; } - my ($intf) = values %{$o->{intf}}; - if ($intf->{BOOTPROTO} =~ /dhcp/) { - push @ks, "network:dhcp"; - } else { - require network; - push @ks, "network:static", "ip:$intf->{IPADDR}", "netmask:$intf->{NETMASK}", "gateway:$o->{netc}{GATEWAY}"; - my @dnss = network::dnsServers($o->{netc}); - push @ks, "dns:$dnss[0]" if @dnss; + if (member($o->{method}, qw(http ftp nfs))) { + my ($intf) = values %{$o->{intf}}; + push @ks, "interface:$intf->{DEVICE}"; + if ($intf->{BOOTPROTO} eq 'dhcp') { + push @ks, "network:dhcp"; + } else { + require network; + push @ks, "network:static", "ip:$intf->{IPADDR}", "netmask:$intf->{NETMASK}", "gateway:$o->{netc}{GATEWAY}"; + my @dnss = network::dnsServers($o->{netc}); + push @ks, "dns:$dnss[0]" if @dnss; + } } + "automatic=".join(',', @ks); } |