summaryrefslogtreecommitdiffstats
path: root/perl-install/install
ModeNameSize
-rw-r--r--Makefile3738logstatsplain
-rw-r--r--NEWS82323logstatsplain
-rw-r--r--any.pm48170logstatsplain
-rwxr-xr-xcommands457logstatsplain
-rw-r--r--commands.pm12714logstatsplain
-rw-r--r--ftp.pm2278logstatsplain
-rw-r--r--gtk.pm9052logstatsplain
d---------help176logstatsplain
-rw-r--r--http.pm1942logstatsplain
-rwxr-xr-xinstall21101logstatsplain
-rw-r--r--install2.pm23847logstatsplain
-rw-r--r--interactive.pm809logstatsplain
-rw-r--r--media.pm29934logstatsplain
d---------pixmaps966logstatsplain
-rw-r--r--pkgs.pm32773logstatsplain
d---------share532logstatsplain
-rw-r--r--steps.pm30502logstatsplain
-rw-r--r--steps_auto_install.pm3854logstatsplain
-rw-r--r--steps_curses.pm1646logstatsplain
-rw-r--r--steps_gtk.pm30519logstatsplain
-rw-r--r--steps_interactive.pm39169logstatsplain
-rw-r--r--steps_list.pm3763logstatsplain
-rw-r--r--steps_stdio.pm721logstatsplain
an class="hl opt">{ my ($a, $b) = @_; foreach my $i ("pap-secrets", "chap-secrets") { substInFile { s/^'$a'.*\n//; $_ .= "\n'$a' * '$b' * \n" if eof } "$prefix/etc/ppp/$i"; } } sub ask_connect_now { my ($type) = @_; $::Wizard_no_previous = 1; my $up; #- FIXME : code the exception to be generated by ask_yesorno, to be able to remove the $::Wizard_no_previous=1; if ($in->ask_yesorno(N("Internet configuration"), N("Do you want to try to connect to the Internet now?") )) { { my $w = $in->wait_message('', N("Testing your connection..."), 1); connect_backend(); my $s = 30; $type =~ /modem/ and $s = 50; $type =~ /adsl/ and $s = 35; $type =~ /isdn/ and $s = 20; sleep $s; my $netc = {}; $up = connected(); } my $m = $up ? N("The system is now connected to Internet.") . if_($::isInstall, N("For security reason, it will be disconnected now.")) : N("The system doesn't seem to be connected to internet. Try to reconfigure your connection."); if ($::isWizard) { $::Wizard_no_previous = 1; $::Wizard_finished = 1; $in->ask_okcancel(N("Network Configuration"), $m, 1); undef $::Wizard_no_previous; undef $::Wizard_finished; } else { $in->ask_warn('', $m) } $::isInstall and disconnect_backend(); } undef $::Wizard_no_previous; $up; } sub connect_backend { run_program::rooted($prefix, "$connect_prog &") } sub disconnect_backend { run_program::rooted($prefix, "$disconnect_file &") } sub read_providers_backend { my ($file) = @_; map { /(.*?)=>/ } catMaybeCompressed($file) } sub ask_info2 { my ($cnx, $netc) = @_; $::isInstall and $in->set_help('configureNetworkDNS'); $in->ask_from(N("Connection Configuration"), N("Please fill or check the field below"), [ if__($cnx->{irq}, { label => N("Card IRQ"), val => \$cnx->{irq} }), if__($cnx->{mem}, { label => N("Card mem (DMA)"), val => \$cnx->{mem} }), if__($cnx->{io}, { label => N("Card IO"), val => \$cnx->{io} }), if__($cnx->{io0}, { label => N("Card IO_0"), val => \$cnx->{io0} }), if__($cnx->{io1}, { label => N("Card IO_1"), val => \$cnx->{io1} }), if__($cnx->{phone_in}, { label => N("Your personal phone number"), val => \$cnx->{phone_in} }), if__($netc->{DOMAINNAME2}, { label => N("Provider name (ex provider.net)"), val => \$netc->{DOMAINNAME2} }), if__($cnx->{phone_out}, { label => N("Provider phone number"), val => \$cnx->{phone_out} }), if__($netc->{dnsServer2}, { label => N("Provider dns 1 (optional)"), val => \$netc->{dnsServer2} }), if__($netc->{dnsServer3}, { label => N("Provider dns 2 (optional)"), val => \$netc->{dnsServer3} }), if__($cnx->{vpivci}, { label => N("Choose your country"), val => \$netc->{vpivci}, list => detect_timezone() }), if__($cnx->{dialing_mode}, { label => N("Dialing mode"), val => \$cnx->{dialing_mode},list => ["auto", "manual"] }), if__($cnx->{speed}, { label => N("Connection speed"), val => \$cnx->{speed}, list => ["64 Kb/s", "128 Kb/s"] }), if__($cnx->{huptimeout}, { label => N("Connection timeout (in sec)"), val => \$cnx->{huptimeout} }), if__($cnx->{login}, { label => N("Account Login (user name)"), val => \$cnx->{login} }), if__($cnx->{passwd}, { label => N("Account Password"), val => \$cnx->{passwd}, hidden => 1 }), ] ) or return; if ($netc->{vpivci}) { foreach ([N("Netherlands"), '8_48'], [N("France"), '8_35'], [N("Belgium"), '8_35'], [N("Italy"), '8_35'], [N("United Kingdom"), '0_38'], [N("United States"), '8_35']) { $netc->{vpivci} eq $_->[0] and $netc->{vpivci} = $_->[1]; } } 1; } sub detect_timezone { my %tmz2country = ( 'Europe/Paris' => N("France"), 'Europe/Amsterdam' => N("Netherlands"), 'Europe/Rome' => N("Italy"), 'Europe/Brussels' => N("Belgium"), 'America/New_York' => N("United States"), 'Europe/London' => N("United Kingdom") ); my %tm_parse = MDK::Common::System::getVarsFromSh('/etc/sysconfig/clock'); my @country; foreach (keys %tmz2country) { if ($_ eq $tm_parse{ZONE}) { unshift @country, $tmz2country{$_}; } else { push @country, $tmz2country{$_} }; } \@country; } sub type2interface { my ($i) = @_; $i =~ /$_->[0]/ and return $_->[1] foreach [ modem => 'ppp' ], [ isdn_internal => 'ippp' ], [ isdn_external => 'ppp' ], [ adsl => 'ppp' ], [ cable => 'eth' ], [ lan => 'eth' ]; } sub connected { gethostbyname("mandrakesoft.com") ? 1 : 0 } my $kid_pipe; sub connected_bg { local $| = 1; my ($ref) = @_; if (defined $kid_pipe) { local *F; *F = *$kid_pipe; fcntl(F, c::F_SETFL(), c::O_NONBLOCK()) or die "can't fcntl F_SETFL: $!"; my $a; if (defined($a = <F>)) { close($kid_pipe) || warn "kid exited $?"; undef $kid_pipe; $$ref = $a; } } else { $kid_pipe = connected2() } 1; } # test if connected; # cmd = 0 : ask current status # return : 0 : not connected; 1 : connected; -1 : no test ever done; -2 : test in progress # cmd = 1 : start new connection test # return : -2 # cmd = 2 : cancel current test # return : nothing # cmd = 3 : return current status even if a test is in progress my $kid_pipe_connect; my $kid_pid; my $current_connection_status; sub test_connected { local $| = 1; my ($cmd) = @_; if (!defined $current_connection_status) { $current_connection_status = -1 } if ($cmd == 0) { if (defined $kid_pipe_connect) { local *F; *F = *$kid_pipe_connect; fcntl(F, c::F_SETFL(), c::O_NONBLOCK()) or die "can't fcntl F_SETFL: $!"; my $a; if (defined($a = <F>)) { close($kid_pipe_connect) || warn "kid exited $?"; undef $kid_pipe_connect; undef $kid_pid; $current_connection_status = $a; } } return $current_connection_status; } if ($cmd == 1) { if ($current_connection_status != -2) { $current_connection_status = -2; $kid_pipe_connect = connected2(); } } if ($cmd == 2) { if (defined($kid_pid)) { kill -9, $kid_pid; undef $kid_pid; } } return $current_connection_status; } sub connected2 { local *KID_TO_READ; my $pid = open(KID_TO_READ, "-|"); if ($pid) { # parent $kid_pid = $pid; return *KID_TO_READ; } else { # child my $a = gethostbyname("mandrakesoft.com") ? 1 : 0; print $a; c::_exit(0); } } sub disconnected {} sub write_initscript { output("$prefix/etc/rc.d/init.d/internet", sprintf(<<'EOF', $connect_file, $connect_file, $disconnect_file, $disconnect_file)); #!/bin/bash # # internet Bring up/down internet connection # # chkconfig: 2345 11 89 # description: Activates/Deactivates the internet interfaces # # dam's (damien@mandrakesoft.com) # Source function library. . /etc/rc.d/init.d/functions case "$1" in start) if [ -e %s ]; then action "Checking internet connections to start at boot" "%s --boot_time" else action "No connection to start" "true" fi touch /var/lock/subsys/internet ;; stop) if [ -e %s ]; then action "Stopping internet connection if needed: " "%s --boot_time" else action "No connection to stop" "true" fi rm -f /var/lock/subsys/internet ;; restart) $0 stop echo "Waiting 10 sec before restarting the internet connection." sleep 10 $0 start ;; status) ;; *)