diff options
author | damien <damien@mandriva.com> | 2001-08-06 21:54:27 +0000 |
---|---|---|
committer | damien <damien@mandriva.com> | 2001-08-06 21:54:27 +0000 |
commit | 717035c00560891bbb41c9364ea6be10a64fbe12 (patch) | |
tree | 649d4662eb85967bd19434d0d8300ef807db60c9 | |
parent | b684ed467490ecc1eda1fdc3048e9dc6ab4a390f (diff) | |
download | drakx-717035c00560891bbb41c9364ea6be10a64fbe12.tar drakx-717035c00560891bbb41c9364ea6be10a64fbe12.tar.gz drakx-717035c00560891bbb41c9364ea6be10a64fbe12.tar.bz2 drakx-717035c00560891bbb41c9364ea6be10a64fbe12.tar.xz drakx-717035c00560891bbb41c9364ea6be10a64fbe12.zip |
debugging, profile coding, isdn 128 debugging
-rw-r--r-- | perl-install/my_gtk.pm | 8 | ||||
-rw-r--r-- | perl-install/network/ethernet.pm | 4 | ||||
-rw-r--r-- | perl-install/network/isdn.pm | 14 | ||||
-rw-r--r-- | perl-install/network/netconnect.pm | 87 |
4 files changed, 67 insertions, 46 deletions
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm index 308f774c8..12e8de640 100644 --- a/perl-install/my_gtk.pm +++ b/perl-install/my_gtk.pm @@ -358,24 +358,24 @@ sub write_on_pixmap { my $darea= new Gtk::DrawingArea(); $darea->size($width, $height); $darea->set_usize($width, $height); - my $first_time=1; my $draw = sub { my $style = new Gtk::Style; #- i18n : you can change the font. $style->font(Gtk::Gdk::Font->fontset_load(_("-adobe-times-bold-r-normal--17-*-100-100-p-*-iso8859-*,*-r-*"))); my $y_pos2= $y_pos; foreach (@text) { - $gdkpixmap->draw_string($style->font, $gc, $x_pos, $y_pos2, $_); + print " -- $_ --\n"; + $darea->window->draw_string($style->font, $gc, $x_pos, $y_pos2, $_); $y_pos2 += 20; } - $first_time=0; }; - $darea->signal_connect(expose_event => sub { $first_time and &$draw(); + $darea->signal_connect(expose_event => sub { $darea->window->draw_rectangle($darea->style->white_gc, 1, 0, 0, $width, $height); $darea->window->draw_pixmap ($darea->style->white_gc, $gdkpixmap, 0, 0, ($darea->allocation->[2]-$width)/2, ($darea->allocation->[3]-$height)/2, $width, $height); + &$draw(); }); $darea; } diff --git a/perl-install/network/ethernet.pm b/perl-install/network/ethernet.pm index 4edb584b6..0c5a70b19 100644 --- a/perl-install/network/ethernet.pm +++ b/perl-install/network/ethernet.pm @@ -63,8 +63,8 @@ sub configure_lan { require Data::Dumper; configureNetwork($netc, $intf, $first_time) or return; configureNetwork2($in, $prefix, $netc, $intf, $install); - if ($::isStandalone and $in->ask_yesorno(_("Network configuration"), - _("Do you want to restart the network"), 1)) { + if ($::isStandalone and ($::expert or $in->ask_yesorno(_("Network configuration"), + _("Do you want to restart the network"), 1))) { run_program::rooted($prefix, "/etc/rc.d/init.d/network stop"); if (!run_program::rooted($prefix, "/etc/rc.d/init.d/network start")) { $in->ask_okcancel(_("Network Configuration"), _("A problem occured while restarting the network: \n\n%s", `/etc/rc.d/init.d/network start`), 0) or return; diff --git a/perl-install/network/isdn.pm b/perl-install/network/isdn.pm index fd96f10c2..af5f90630 100644 --- a/perl-install/network/isdn.pm +++ b/perl-install/network/isdn.pm @@ -60,7 +60,8 @@ We recommand the light configuration. } run_program::rooted($prefix, "rpm", "-e", "$rmpackage"); $install->($instpackage, if_($isdn->{speed} =~ /128/, 'ibod'), 'isdn4k-utils'); - isdn_write_config_backend($isdn, $e =~ /light/, $netc); + my $light = $e =~ /light/ ? 1 : 0; + isdn_write_config_backend($isdn, $light, $netc); 1; } @@ -94,14 +95,15 @@ sub isdn_write_config_backend { symlinkf("ioptions" . $bundle, "$prefix/etc/ppp/ioptions"); } else { my $f = "$prefix/etc/isdn/profile/link/myisp"; - output $f, + output ($f, qq( I4L_USERNAME="$isdn->{login}" I4L_SYSNAME="" I4L_LOCALMSN="$isdn->{phone_in}" I4L_REMOTE_OUT="$isdn->{phone_out}" I4L_DIALMODE="$isdn->{dialing_mode}" -); +) . if_($isdn->{speed} =~ /128/, 'SLAVE="ippp1" +')); chmod 0600, $f; output "$prefix/etc/isdn/profile/card/mycard", @@ -134,11 +136,13 @@ defaultroute /sbin/route del default /sbin/ifup ippp0 /sbin/isdnctrl dial ippp0 -", +" . if_($isdn->{speed} =~ /128/, "service ibod restart +"), "#!/bin/bash /sbin/isdnctrl hangup ippp0 /sbin/ifdown ippp0 -"); +" . if_($isdn->{speed} =~ /128/, "service ibod stop +")); 1; } diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index 56aa7919a..21014c517 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -82,6 +82,34 @@ sub detect { $modem->{device} and $auto_detect->{modem}=$modem->{device}; } +sub pre_func { + my ($text) = @_; + print "PLOP $text PLOP\n"; + $::Wizard_no_previous=1; + if ($in->isa('interactive_gtk')) { + $::Wizard_splash=1; + require my_gtk; + my_gtk->import(qw(:wrappers)); + my $W = my_gtk->new(_("Network Configuration Wizard")); + gtkadd($W->{window}, + gtkpack_(new Gtk::VBox(0, 0), + 1, write_on_pixmap(gtkpng ("draknet_step"), + 20,190, + _("We are now going to configure the %s connection.",_($text)), + _("Press next to continue."), + ), + 0, $W->create_okcancel + ) + ); + $W->main; + $::Wizard_splash=0; + } else { + #- for i18n : %s is the type of connection of the list: (modem, isdn, adsl, cable, local network); + $in->ask_okcancel(_("Network Configuration Wizard"), _("\n\n\nWe are now going to configure the %s connection.\n\n\nPress next to begin.",_($_[0])), 1); + } + undef $::Wizard_no_previous; +} + sub main { my ($prefix, $netcnx, $netc, $mouse, $in, $intf, $install, $first_time, $direct_fr) = @_; MDK::Common::Globals::init( @@ -169,36 +197,11 @@ ifdown eth0 # load_conf ($netcnx, $netc, $intf); - my $pre_func = sub { - $::Wizard_no_previous=1; - if ($in->isa('interactive_gtk')) { - $::Wizard_splash=1; - require my_gtk; - my_gtk->import(qw(:wrappers)); - my $W = my_gtk->new(_("Network Configuration Wizard")); - gtkadd($W->{window}, - gtkpack_(new Gtk::VBox(0, 0), - 1, write_on_pixmap(gtkpng ("draknet_step"), - 20,60, - _("We are now going to configure the %s connection.",_($_[0])), - _("Press next to continue."), - ), - 0, $W->create_okcancel - ) - ); - $W->main; - $::Wizard_splash=0; - } else { - #- for i18n : %s is the type of connection of the list: (modem, isdn, adsl, cable, local network); - $in->ask_okcancel(_("Network Configuration Wizard"), _("\n\n\nWe are now going to configure the %s connection.\n\n\nPress next to begin.",_($_[0])), 1); - } - undef $::Wizard_no_previous; - }; - $conf{modem} and do { &$pre_func("modem"); require network::modem; network::modem::configure($netcnx, $mouse, $netc) or goto step_2 }; - $conf{isdn} and do { &$pre_func("isdn"); require network::isdn; network::isdn::configure($netcnx, $netc) or goto step_2 }; - $conf{adsl} and do { &$pre_func("adsl"); require network::adsl; network::adsl::configure($netcnx, $netc, $intf, $first_time) or goto step_2}; - $conf{cable} and do { &$pre_func("cable"); require network::ethernet; network::ethernet::configure_cable($netcnx, $netc, $intf, $first_time) or goto step_2 }; - $conf{lan} and do { &$pre_func("local network"); require network::ethernet; network::ethernet::configure_lan($netcnx, $netc, $intf, $first_time) or goto step_2 }; + $conf{modem} and do { pre_func("modem"); require network::modem; network::modem::configure($netcnx, $mouse, $netc) or goto step_2 }; + $conf{isdn} and do { pre_func("isdn"); require network::isdn; network::isdn::configure($netcnx, $netc) or goto step_2 }; + $conf{adsl} and do { pre_func("adsl"); require network::adsl; network::adsl::configure($netcnx, $netc, $intf, $first_time) or goto step_2}; + $conf{cable} and do { pre_func("cable"); require network::ethernet; network::ethernet::configure_cable($netcnx, $netc, $intf, $first_time) or goto step_2 }; + $conf{lan} and do { pre_func("local network"); require network::ethernet; network::ethernet::configure_lan($netcnx, $netc, $intf, $first_time) or goto step_2 }; step_2_1: my $nb = keys %{$netc->{internet_cnx}}; @@ -394,7 +397,14 @@ DOMAINNAME2=$netc->{DOMAINNAME2}" commands::cp("-f", "$prefix/etc/sysconfig/network-scripts/draknet_conf", "$prefix/etc/sysconfig/network-scripts/draknet_conf." . $a); chmod 0600, "$prefix/etc/sysconfig/network-scripts/draknet_conf"; chmod 0600, "$prefix/etc/sysconfig/network-scripts/draknet_conf." . $a; - foreach ( ["$prefix$connect_file", "up"], ["$prefix$disconnect_file", "down"], ["$prefix$connect_prog", "prog"] ) { + foreach ( ["$prefix$connect_file", "up"], + ["$prefix$disconnect_file", "down"], + ["$prefix$connect_prog", "prog"], + ["$prefix/etc/ppp/ioptions1B", "iop1B"], + ["$prefix/etc/ppp/ioptions2B", "iop2B"], + ["$prefix/etc/isdn/isdn1B.conf", "isdn1B"], + ["$prefix/etc/isdn/isdn2B.conf", "isdn2B"], + ) { my $file = "$prefix/etc/sysconfig/network-scripts/net_" . $_->[1] . "." . $a; -e ($_->[0]) and commands::cp("-f", $_->[0], $file) and chmod 0755, $file; } @@ -409,9 +419,16 @@ sub set_profile { $netcnx->{PROFILE}=$profile; print "changing to $profile\n"; commands::cp("-f", $f . "." . $profile, $f); - foreach ( ["up", "$prefix$connect_file"], ["down", "$prefix$disconnect_file"], ["prog", "$prefix$connect_prog"]) { - my $c = "$prefix/etc/sysconfig/network-scripts/net_" . $_->[0] . "." . $profile; - -e ($c) and commands::cp("-f", $c, $_->[1]); + foreach ( ["$prefix$connect_file", "up"], + ["$prefix$disconnect_file", "down"], + ["$prefix$connect_prog", "prog"], + ["$prefix/etc/ppp/ioptions1B", "iop1B"], + ["$prefix/etc/ppp/ioptions2B", "iop2B"], + ["$prefix/etc/isdn/isdn1B.conf", "isdn1B"], + ["$prefix/etc/isdn/isdn2B.conf", "isdn2B"], + ) { + my $c = "$prefix/etc/sysconfig/network-scripts/net_" . $_->[1] . "." . $profile; + -e ($c) and commands::cp("-f", $c, $_->[0]); } } @@ -421,7 +438,7 @@ sub del_profile { $profile eq "default" and return; print "deleting $profile\n"; commands::rm("-f", "$prefix/etc/sysconfig/network-scripts/draknet_conf." . $profile); - commands::rm("-f", glob_("$prefix/etc/sysconfig/network-scripts/net_{up,down,prog}." . $profile)); + commands::rm("-f", glob_("$prefix/etc/sysconfig/network-scripts/net_{up,down,prog,iop1B,iop2B,isdn1B,isdn2B}." . $profile)); } sub add_profile { |