summaryrefslogtreecommitdiffstats
path: root/perl-install/resize_fat
Commit message (Expand)AuthorAgeFilesLines
* re-sync after the big svn lossPascal Rigaux2007-04-251-5/+0
* don't need use MDK::Common... when we have "use common" (which is the standar...Pascal Rigaux2005-06-101-1/+0
* gcc 4.0 was choking on lvalues of unpredictable type.Rafael Garcia-Suarez2005-05-061-2/+5
* remove old debug codePascal Rigaux2005-04-131-1/+0
* better english (writing style rather than spoken one)Thierry Vignaud2004-12-133-4/+4
* prototypes are dangerousPascal Rigaux2004-09-101-1/+1
* kill warningsThierry Vignaud2004-09-091-0/+3
* remove check_mounted(), it is done by diskdrakePascal Rigaux2004-08-121-11/+0
* perl_checker compliancePascal Rigaux2004-08-121-3/+2
* perl_checker fixesPascal Rigaux2004-01-051-1/+1
* perl_checker adaptations + fixesPascal Rigaux2003-04-241-1/+1
* new perl_checker compliancePascal Rigaux2003-04-172-4/+4
* remove unused variables or rename them with an underscore (eg: $o becomes $_o)Pascal Rigaux2002-12-043-3/+3
* perl_checker adaptationsPascal Rigaux2002-11-282-4/+4
* remove debug codePascal Rigaux2002-11-281-1/+0
* to export, one needs to inheritate from ExporterPascal Rigaux2002-11-281-1/+1
* perl_checker adaptationsPascal Rigaux2002-11-273-13/+10
* - add/remove spaces to make perl_checker happyPascal Rigaux2002-11-142-3/+3
* add/remove spaces to make perl_checker happyPascal Rigaux2002-11-131-2/+2
* add or remove spaces where need to please perl_checkerPascal Rigaux2002-11-113-4/+4
* - use "foreach" instead of "for" in list contextPascal Rigaux2002-11-111-1/+1
* various small syntax enhancements to please perl_checkerPascal Rigaux2002-11-111-2/+2
* make perl_checker happy again (replacing "{xx}->{yy}" by "{xx}{yy}")Pascal Rigaux2002-07-312-3/+3
* make new perl_checker happyPascal Rigaux2002-07-311-20/+1
* make new perl_checker happy (and that's not easy!)Pascal Rigaux2002-07-312-2/+2
* ensure things build as they should when perl is upgraded on compilation boxPascal Rigaux2002-07-221-1/+1
* fixPascal Rigaux2001-08-071-1/+1
* switch to MDK::Common (i wonder why it was not done yet)Pascal Rigaux2001-07-301-3/+4
* move to MDK::Common, bool->to_boolPascal Rigaux2001-07-245-5/+5
* s/Linux-Mandrake/Mandrake Linux/Pascal Rigaux2001-06-212-2/+2
* no_commentPascal Rigaux2000-09-149-9/+9
* no_commentPascal Rigaux2000-08-111-1/+5
* no_commentPascal Rigaux2000-08-061-6/+11
* *** empty log message ***Francois Pons2000-05-021-3/+5
* *** empty log message ***Francois Pons2000-05-023-2/+5
* *** empty log message ***Francois Pons2000-04-142-10/+25
* *** empty log message ***Francois Pons2000-04-114-19/+87
* no_commentPascal Rigaux2000-03-301-1/+2
* no_commentPascal Rigaux2000-02-111-1/+1
* *** empty log message ***Francois Pons2000-02-095-23/+29
* no_commentPascal Rigaux2000-02-091-1/+1
* *** empty log message ***Francois Pons2000-02-096-28/+81
* no_commentPascal Rigaux2000-02-091-11/+7
* no_commentPascal Rigaux2000-01-011-1/+1
* no_commentPascal Rigaux1999-12-081-1/+1
* no_commentPascal Rigaux1999-12-021-0/+1
* no_commentPascal Rigaux1999-11-221-1/+1
* no_commentPascal Rigaux1999-11-147-64/+126
* no_commentPascal Rigaux1999-10-251-1/+1
* no_commentPascal Rigaux1999-10-131-1/+1
kwb">$wiz->{var}{adsl}{type} = find { $l{$_} eq $wiz->{var}{adsl}{type} } keys %l; my $adsl = $wiz->{var}{adsl}{connection}; my $type = $wiz->{var}{adsl}{type}; my $netcnx = $wiz->{var}{netcnx}; $netcnx->{type} = "adsl_$type"; $netcnx->{"adsl_$type"} = {}; $netcnx->{"adsl_$type"}{vpivci} = '' if $type =~ /eci|speedtouch/; return 'ethernet' if $type eq 'dhcp'; adsl_probe_info($adsl, $netc, $type); # my ($adsl, $netc, $intf, $adsl_type) = @_; # ask_info2($adsl, $netc); return "hw_account"; }, }, }); }; sub adsl_probe_info { my ($adsl, $netc, $adsl_type, $o_adsl_modem) = @_; my $pppoe_file = "$::prefix/etc/ppp/pppoe.conf"; my %pppoe_conf; %pppoe_conf = getVarsFromSh($pppoe_file) if (! defined $adsl_type || $adsl_type eq 'pppoe') && -f $pppoe_file; my $login = $pppoe_conf{USER}; foreach (qw(/etc/ppp/peers/ppp0 /etc/ppp/options /etc/ppp/options.adsl)) { ($login) = map { if_(/^user\s+"([^"]+)"/, $1) } cat_("$::prefix/$_") if !$login && -r "$::prefix/$_"; } my $passwd = passwd_by_login($login); if (!$netc->{vpi} && !$netc->{vpi} && member($o_adsl_modem, qw(eci speedtouch))) { ($netc->{vpi}, $netc->{vci}) = (map { if_(/^.*-vpi\s+(\d+)\s+-vci\s+(\d+)/, map { sprintf("%x", $_) } $1, $2) } cat_("$::prefix/etc/ppp/peers/ppp0")); } $pppoe_conf{DNS1} ||= ''; $pppoe_conf{DNS2} ||= ''; add2hash($netc, { dnsServer2 => $pppoe_conf{DNS1}, dnsServer3 => $pppoe_conf{DNS2}, DOMAINNAME2 => '' }); add2hash($adsl, { login => $login, passwd => $passwd, passwd2 => '' }); } sub adsl_detect() { my $adsl = {}; require detect_devices; ($adsl->{bewan}) = detect_devices::getBewan(); ($adsl->{speedtouch}) = detect_devices::getSpeedtouch(); ($adsl->{sagem}) = detect_devices::getSagem(); ($adsl->{eci}) = detect_devices::getECI(); return $adsl; } sub adsl_conf_backend { my ($in, $modules_conf, $adsl, $netc, $intf, $adsl_device, $adsl_type, $o_netcnx) = @_; # FIXME: should not be needed: defined $o_netcnx and $netc->{adsltype} = $o_netcnx->{type}; $netc->{adsltype} ||= "adsl_$adsl_type"; $adsl_type eq 'pptp' and $adsl_device = 'pptp_modem'; my $bewan_module; $bewan_module = $o_netcnx->{bus} eq 'PCI' ? 'unicorn_pci_atm' : 'unicorn_usb_atm' if $adsl_device eq "bewan"; # all supported modems came with their own pppoa module, so no need for "plugin pppoatm.so" my %modems = ( bewan => { start => qq( modprobe pppoatm # ActivationMode=1 modprobe $bewan_module # wait for the modem to be set up: sleep 10 ), stop => qq(modprobe -r $bewan_module), plugin => { pppoa => "pppoatm.so $netc->{vpi}." . hex($netc->{vci}) }, ppp_options => qq( lock ipparam ppp0 default-asyncmap hide-password noaccomp nobsdcomp nodeflate novj novjccomp lcp-echo-interval 20 lcp-echo-failure 3 mtu 1200 mru 1200 sync ), }, speedtouch => { modules => [ qw(speedtch) ], start => '/usr/bin/speedtouch-start', overide_script => 1, server => { pppoa => qq("/usr/sbin/pppoa3 -c") }, plugin => { pppoa => "pppoatm.so " . join('.', hex($netc->{vpi}), hex($netc->{vci})), }, ppp_options => qq( sync noaccomp), aliases => [ ['char-major-108', 'ppp_generic'], ['tty-ldisc-3', 'ppp_async'], ['tty-ldisc-13', 'n_hdlc'], ['tty-ldisc-14', 'ppp_synctty'], ['ppp-compress-21', 'bsd_comp'], ['ppp-compress-24', 'ppp_deflate'], ['ppp-compress-26', 'ppp_deflate'] ], }, sagem => { modules => [ qw(eagle-usb) ], start => '/usr/sbin/eaglectrl -d', stop => "/usr/bin/killall pppoa", get_intf => "/usr/sbin/eaglectrl -i", server => { pppoa => q("intf=`/usr/sbin/fctStartAdsl -t 1 -i` && /usr/sbin/pppoa -I $intf"), }, ppp_options => qq( mru 1492 mtu 1492 nobsdcomp nodeflate noaccomp -am novjccomp), aliases => [ ['char-major-108', 'ppp_generic'], ['tty-ldisc-3', 'ppp_async'], ['tty-ldisc-13', 'n_hdlc'], ['tty-ldisc-14', 'ppp_synctty'] ], }, eci => { start => '/usr/bin/startmodem', server => { pppoe => qq("/usr/bin/pppoeci -v 1 -vpi $netc->{vpi} -vci $netc->{vci}"), }, ppp_options => qq( noipdefault sync noaccomp linkname eciadsl noauth lcp-echo-interval 0) }, pptp_modem => { server => { pptp => qq("/usr/sbin/pptp 10.0.0.138 --nolaunchpppd"), }, }, ); if ($adsl_type =~ /^pp/) { mkdir_p("$::prefix/etc/ppp"); $in->do_pkgs->install('ppp') if !$>; my %packages = ( pppoa => [ qw(ppp-pppoatm) ], pppoe => [ qw(ppp-pppoe rp-pppoe) ], pptp => [ qw(pptp-linux) ], ); $in->do_pkgs->install(@{$packages{$adsl_type}}) if !$>; output("$::prefix/etc/ppp/options", $adsl_device eq "bewan" ? qq(lock ipparam ppp0 noipdefault noauth default-asyncmap defaultroute hide-password noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp lcp-echo-interval 20 lcp-echo-failure 3 mtu 1200 mru 1200 sync persist user $adsl->{login} name $adsl->{login} usepeerdns ) : qq(lock noipdefault persist noauth usepeerdns defaultroute) ); my $pty_option = $modems{$adsl_device}{server}{$adsl_type} && "pty $modems{$adsl_device}{server}{$adsl_type}"; my $plugin = $modems{$adsl_device}{plugin}{$adsl_type} && "plugin $modems{$adsl_device}{plugin}{$adsl_type}"; my $noipdefault = 'noipdefault' unless $adsl_type eq 'pptp'; output("$::prefix/etc/ppp/peers/ppp0", qq(noauth $noipdefault $modems{$adsl_device}{ppp_options} kdebug 1 nopcomp noccp novj holdoff 4 maxfail 25 persist usepeerdns defaultroute $pty_option $plugin user "$adsl->{login}" )); write_secret_backend($adsl->{login}, $adsl->{passwd}); if ($netc->{NET_DEVICE} =~ /^eth/) { my $net_device = $netc->{NET_DEVICE}; $intf->{$net_device} = { DEVICE => $net_device, BOOTPROTO => 'none', NETMASK => '255.255.255.0', NETWORK => '10.0.0.0', BROADCAST => '10.0.0.255', ONBOOT => 'yes', }; } if ($adsl_type eq 'pppoe') { my $net_device = $modems{$adsl_device}{get_intf} ? "`$modems{$adsl_device}{get_intf}`" : $netc->{NET_DEVICE}; substInFile { s/ETH=.*\n/ETH=$net_device\n/; s/USER=.*\n/USER=$adsl->{login}\n/; s/DNS1=.*\n/DNS1=$netc->{dnsServer2}\n/; s/DNS2=.*\n/DNS2=$netc->{dnsServer3}\n/; } "$::prefix/etc/ppp/pppoe.conf"; } # pppoe => { # # we do not call directly pppd, rp-pppoe take care of "plugin rp-pppoe.so" peers option and the like # connect => "LC_ALL=C LANG=C LANGUAGE=C LC_MESSAGES=C /usr/sbin/adsl-start", # disconnect => qq(/usr/sbin/adsl-stop # /usr/bin/killall pppoe pppd\n), # }, } #- FIXME: #- ppp0 and ippp0 are hardcoded my $kind = $adsl_type eq 'pppoe' ? 'xDSL' : 'ADSL'; my $metric = network::tools::get_default_metric("adsl"); #- FIXME, do not override if already set output_with_perm("$::prefix/etc/sysconfig/network-scripts/ifcfg-ppp0", 0705, qq(DEVICE=ppp0 ONBOOT=no TYPE=$kind METRIC=$metric )); # sagem specific stuff if ($adsl_device eq 'sagem') { my %l = map { $_ => sprintf("%08s", $netc->{$_}) } qw(vci vpi Encapsulation); # set vpi and vci parameters for sagem foreach my $cfg_file (qw(/etc/analog/adiusbadsl.conf /etc/eagle-usb/eagle-usb.conf)) { substInFile { s/VCI=.*\n/VCI=$l{vci}\n/; s/VPI=.*\n/VPI=$l{vpi}\n/; s/Encapsulation=.*\n/Encapsulation=$l{Encapsulation}\n/; } "$::prefix$cfg_file"; } } # set aliases: if (exists $modems{$adsl_device}{aliases}) { $modules_conf->set_alias($_->[0], $_->[1]) foreach @{$modems{$adsl_device}{aliases}}; $::isStandalone and $modules_conf->write; } unless ($::isStandalone) { my @modules = (@{$modems{$adsl_device}{modules}}, map { $_->[1] } @{$modems{$adsl_device}{aliases}}); @modules && eval { modules::load(@modules) } or log::l("failed to load " . join(',', @modules), " modules: $@"); $modems{$adsl_device}{start} and run_program::rooted($::prefix, $modems{$adsl_device}{start}); } } 1;