summaryrefslogtreecommitdiffstats
path: root/perl-install/network
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2001-07-22 19:58:06 +0000
committerdamien <damien@mandriva.com>2001-07-22 19:58:06 +0000
commit21d632055bbe913d53c3324d7465a38621d6d79e (patch)
tree7c77561c2e33fd8c52c4fa8cc75e4364bbf0f5eb /perl-install/network
parent62549c2cc589b26db909835e4ceb4a71c3e93630 (diff)
downloaddrakx-backup-do-not-use-21d632055bbe913d53c3324d7465a38621d6d79e.tar
drakx-backup-do-not-use-21d632055bbe913d53c3324d7465a38621d6d79e.tar.gz
drakx-backup-do-not-use-21d632055bbe913d53c3324d7465a38621d6d79e.tar.bz2
drakx-backup-do-not-use-21d632055bbe913d53c3324d7465a38621d6d79e.tar.xz
drakx-backup-do-not-use-21d632055bbe913d53c3324d7465a38621d6d79e.zip
big work on isdn. Not finished
Diffstat (limited to 'perl-install/network')
-rw-r--r--perl-install/network/isdn.pm29
-rw-r--r--perl-install/network/netconnect.pm1
-rw-r--r--perl-install/network/tools.pm6
3 files changed, 24 insertions, 12 deletions
diff --git a/perl-install/network/isdn.pm b/perl-install/network/isdn.pm
index f67c6aac1..d921ee204 100644
--- a/perl-install/network/isdn.pm
+++ b/perl-install/network/isdn.pm
@@ -1,6 +1,6 @@
package network::isdn;
-use common qw(:common :file);
+use common qw(:common :file :system);
use any;
use modules;
use log;
@@ -42,16 +42,18 @@ sub isdn_write_config {
my $e = $in->ask_from_list_(_("Network Configuration Wizard"),
_("Which ISDN configuration do you prefer?
-* The full configuration uses isdn4net. It contains powerfull tools, but is tricky to configure for a newbie, and not standard.
+* The Old configuration uses isdn4net. It contains powerfull tools, but is tricky to configure for a newbie, and not standard.
-* The light configuration is easier to understand, more standard, but with less tools.
+* The New configuration is easier to understand, more standard, but with less tools.
We recommand the light configuration.
-"), [ __("Light configuration"), __("Full configuration (isdn4net)")]
+"), [ __("New configuration (isdn-light)"), __("Old configuration (isdn4net)")]
) or return;
- $install->($e =~ /Light/ ? 'isdn-light' : 'isdn4net', 'isdn4k-utils');
- isdn_write_config_backend($isdn, $e =~ /Light/);
+ #FIXME debug only
+ system('urpmi --auto --best-output ' . join(' ', $e =~ /light/ ? 'isdn-light' : 'isdn4net', 'isdn4k-utils'));
+ #$install->($e =~ /light/ ? 'isdn-light' : 'isdn4net', 'isdn4k-utils');
+ isdn_write_config_backend($isdn, $e =~ /light/);
$::isStandalone and ask_connect_now($isdn, 'ippp0');
1;
}
@@ -66,7 +68,12 @@ We recommand the light configuration.
sub isdn_write_config_backend {
my ($isdn, $light) = @_;
if ($light) {
- any::setup_thiskind($in, 'isdn', !$::expert, 1);
+ modules::mergein_conf("$prefix/etc/modules.conf");
+ @c = any::setup_thiskind($in, 'isdn', !$::expert, 1);
+ modules::add_alias("ippp0", $c[0]{driver});
+ isdn_detect_backend($isdn);
+
+ $::isStandalone and modules::write_conf($prefix);
foreach my $f ('ioptions1B', 'ioptions2B') {
substInFile { s/^name .*\n//; $_ .= "name $isdn->{login}\n" if eof } "$prefix/etc/ppp/$f";
chmod 0600, $f;
@@ -99,6 +106,7 @@ I4L_MEMBASE="$isdn->{mem}"
I4L_PORT="$isdn->{io}"
I4L_IO0="$isdn->{io0}"
I4L_IO1="$isdn->{io1}"
+I4L_ID="isdn_card"
);
output "$prefix/etc/ppp/ioptions",
@@ -212,6 +220,7 @@ sub isdn_detect {
isdn_ask($isdn, $netc, _("I have detected an ISDN PCI Card, but I don't know the type. Please select one PCI card on the next screen.")) or return;
} else {
isdn_detect_step_1:
+ print "plop isdn protocol\n";
$isdn->{protocol}=isdn_ask_protocol() or return;
isdn_detect_step_2:
isdn_ask_info($isdn, $netc) or goto isdn_detect_step_1;
@@ -236,7 +245,11 @@ sub isdn_detect_backend {
$isdn->{$_} = $c->{$_} foreach qw(description vendor id driver options);
$isdn->{$_} = sprintf("%0x", $isdn->{$_}) foreach ('vendor', 'id');
$isdn->{card_type} = 'pci';
- $isdn->{type} = $network::netconnect::isdnid2type{$isdn->{vendor} . $isdn->{id}}; #If the card is not listed, type is void. You have to ask it then.
+ ($isdn->{type}) = $isdn->{options} =~ /type=(\d+)/;
+ if ($c->{options} !~ /protocol/ && $isdn->{protocol}) {
+ $c->{options} .= "protocol=" . $isdn->{protocol};
+ }
+ $c->{options} =~ /protocol=(\w+)/ and $isdn->{protocol} = $1;
}
}
diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm
index 36c319c7d..7e5e2a673 100644
--- a/perl-install/network/netconnect.pm
+++ b/perl-install/network/netconnect.pm
@@ -156,7 +156,6 @@ ifdown eth0
);
my $i=0;
map { defined $set_default or do { $_->[1] and $set_default=$i; }; $i++; } @l;
- foreach (keys %{$netc->{autodetect}}) { print "plop $_\n" };
my $e = $in->ask_from_entries_refH(_("Network Configuration Wizard"),
_("Choose"),
[
diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm
index 3cbbfdcd2..aff57e9b1 100644
--- a/perl-install/network/tools.pm
+++ b/perl-install/network/tools.pm
@@ -1,6 +1,6 @@
package network::tools;
-use common qw(:common :file);
+use common qw(:common :file :system);
use run_program;
use vars qw(@ISA @EXPORT);
use globals "network", qw($in $prefix $install $disconnect_file $connect_prog);
@@ -11,8 +11,8 @@ use globals "network", qw($in $prefix $install $disconnect_file $connect_prog);
sub write_secret_backend {
my ($a, $b) = @_;
- foreach ("pap-secrets", "chap-secrets") {
- substInFile { s/^$a.*\n//; $_ .= "\n'$a' * '$b' * \n" if eof } "$prefix/etc/ppp/$_";
+ foreach my $i ("pap-secrets", "chap-secrets") {
+ substInFile { s/^$a.*\n//; $_ .= "\n'$a' * '$b' * \n" if eof } "$prefix/etc/ppp/$i";
}
}