summaryrefslogtreecommitdiffstats
path: root/perl-install/network/ethernet.pm
Commit message (Expand)AuthorAgeFilesLines
...
* new perl_checker compliancePascal Rigaux2003-04-171-1/+1
* use $::prefix, waiting for 9.1 to be out before cleaning network modules.Francois Pons2003-03-111-1/+1
* avoid virtual ethX to be reconfigured by drakconnectFrancois Pons2003-03-061-7/+5
* fixed ifconfig invocation and state analysis in install mode.Francois Pons2003-03-061-3/+4
* fix to avoid creating an ifcfg-1 config file.Frederic Lepied2003-03-051-7/+8
* avoid being pertubed by created virtual interface (no inet addre norFrancois Pons2003-03-041-3/+3
* Configure hostname only in expert mode.Frederic Lepied2003-02-281-7/+3
* to workaround perl bug removing UTF8 flag when passing scalars to die's, passGuillaume Cottenceau2003-02-191-1/+1
* perl generate undef indefinitely from the voidThierry Vignaud2003-02-171-1/+1
* - set_help is deprecatedPascal Rigaux2003-02-131-3/+3
* add CVS $IdPascal Rigaux2003-02-131-1/+1
* added a text to describe the Zeroconf host name fieldFrederic Lepied2003-02-101-2/+5
* perl_checker fixesThierry Vignaud2003-02-101-1/+1
* check that zeroconf hostname doesn"t contain a .Frederic Lepied2003-02-091-1/+9
* fixed my own suckingDamien Chaumette2003-02-051-0/+1
* - fix zeroconf supportDamien Chaumette2003-02-031-8/+3
* zeroconfDamien Chaumette2003-01-311-1/+3
* adapt to new category network/gigabit (which used to be in network/main)Pascal Rigaux2003-01-301-3/+3
* - perl_checker compliantDamien Chaumette2003-01-231-3/+1
* - force use strictThierry Vignaud2003-01-231-1/+1
* English proofreading by Stew BenedictsPablo Saratxaga2003-01-211-2/+2
* - zero conf is avaible in drakconnect, with/without dhcpDamien Chaumette2003-01-201-15/+5
* - some changes to dhcp behavior for beta2 (not clean yet)Damien Chaumette2003-01-171-1/+3
* use "if any" instead of "if grep", and various other occurences of "any", "ev...Pascal Rigaux2003-01-071-1/+1
* move any::load_category() to network::interactive::load_category()Pascal Rigaux2002-12-291-3/+3
* - move any::pppConfig() to network::modem::ppp_configure()Pascal Rigaux2002-12-291-1/+1
* remove unused variables or rename them with an underscore (eg: $o becomes $_o)Pascal Rigaux2002-12-041-2/+2
* perl_checker adaptationsPascal Rigaux2002-11-281-1/+1
* perl_checker adaptationsPascal Rigaux2002-11-271-1/+1
* add support ADIModem.Francois Pons2002-11-251-2/+3
* removed reference to ...->{nb_cards} no more used.Francois Pons2002-11-251-2/+0
* removed 2 labels and 2 gotos by a very simple while, dam's is really greatFrancois Pons2002-11-251-6/+5
* default dhcp client is dhcp-clientFrederic Lepied2002-11-191-8/+8
* add/remove spaces to make perl_checker happyPascal Rigaux2002-11-131-6/+6
* add or remove spaces where need to please perl_checkerPascal Rigaux2002-11-111-3/+3
* various small syntax enhancements to please perl_checkerPascal Rigaux2002-11-111-1/+1
* replace "_" with "N" and "__" with "N_"Pascal Rigaux2002-11-061-17/+17
* Fix configureNetwork to fit with new any::load_category_prompt_for_more behaviorDamien Chaumette2002-09-241-1/+1
* - check DNS & Gateway IPDamien Chaumette2002-09-091-1/+1
* - fix previous behavior in Expert mode... (100% lazy loop free this time)Damien Chaumette2002-09-021-1/+2
* *** empty log message ***Damien Chaumette2002-08-271-1/+1
* - fix previous button behavior in Proxies configurationDamien Chaumette2002-08-261-2/+1
* make perl_checker happy again (replacing "{xx}->{yy}" by "{xx}{yy}")Pascal Rigaux2002-07-311-3/+3
* make new perl_checker happyPascal Rigaux2002-07-311-4/+4
* make new perl_checker happy (and that's not easy!)Pascal Rigaux2002-07-311-2/+2
* adapt to new modules.pmPascal Rigaux2002-07-041-3/+3
* small cleanup on untested code (need testing:)Pascal Rigaux2002-03-161-3/+1
* we now consider dhcp provide GATEWAY and internet connection.damien2002-03-161-1/+3
* bug fixdamien2001-09-241-1/+1
* network restart at better placedamien2001-09-191-15/+8
t">{ my ($o, $all_hds) = @_; my $hds = $all_hds->{hds}; my $fstab = [ fsedit::get_all_fstab($all_hds) ]; my @wizlog; my (%solutions); my $min_linux = 400 << 11; my $max_linux = 3000 << 11; my $min_swap = 50 << 11; my $max_swap = 300 << 11; my $min_freewin = 100 << 11; # each solution is a [ score, text, function ], where the function retunrs true if succeeded my @hds_rw = grep { !$_->{readonly} } @$hds; my @hds_can_add = grep { $_->can_raw_add } @hds_rw; if (fsedit::free_space(@hds_can_add) > $min_linux) { $solutions{free_space} = [ 20, N("Use free space"), sub { fsedit::auto_allocate($all_hds); 1 } ] } else { push @wizlog, N("Not enough free space to allocate new partitions") . ": " . (@hds_can_add ? fsedit::free_space(@hds_can_add) . " < $min_linux" : "no harddrive on which partitions can be added"); } if (my @truefs = grep { isTrueFS($_) } @$fstab) { #- value twice the ext2 partitions $solutions{existing_part} = [ 6 + @truefs + @$fstab, N("Use existing partitions"), sub { $o->ask_mntpoint_s($fstab) } ] } else { push @wizlog, N("There is no existing partition to use"); } my @fats = grep { isFat($_) } @$fstab; fs::df($_) foreach @fats; if (my @ok_forloopback = sort { $b->{free} <=> $a->{free} } grep { $_->{free} > $min_linux + $min_swap + $min_freewin } @fats) { $solutions{loopback} = [ -10 - @fats, N("Use the Windows partition for loopback"), sub { my ($s_root, $s_swap); my $part = $o->ask_from_listf('', N("Which partition do you want to use for Linux4Win?"), \&partition_table::description, \@ok_forloopback) or return; $max_swap = $min_swap + 1 if $part->{free} - $max_swap < $min_linux; $o->ask_from('', N("Choose the sizes"), [ { label => N("Root partition size in MB: "), val => \$s_root, min => $min_linux >> 11, max => min($part->{free} - $max_swap, $max_linux) >> 11, type => 'range' }, { label => N("Swap partition size in MB: "), val => \$s_swap, min => $min_swap >> 11, max => $max_swap >> 11, type => 'range' }, ]) or return; push @{$part->{loopback}}, { type =>0x483, loopback_file => '/lnx4win/linuxsys.img', mntpoint => '/', size => $s_root << 11, loopback_device => $part, notFormatted => 1 }, { type => 0x82, loopback_file => '/lnx4win/swapfile', mntpoint => 'swap', size => $s_swap << 11, loopback_device => $part, notFormatted => 1 }; fsedit::recompute_loopbacks($all_hds); 1; } ]; } else { push @wizlog, N("There is no FAT partition to use as loopback (or not enough space left)") . (@fats ? "\nFAT partitions:" . join('', map { "\n $_->{device} $_->{free} (" . ($min_linux + $min_swap + $min_freewin) . ")" } @fats) : ''); } if (my @ok_for_resize_fat = grep { isFat_or_NTFS($_) && !fsedit::part2hd($_, $all_hds)->{readonly} } @$fstab) { $solutions{resize_fat} = [ 6 - @ok_for_resize_fat, N("Use the free space on the Windows partition"), sub { my $part = $o->ask_from_listf_raw({ messages => N("Which partition do you want to resize?"), interactive_help_id => 'resizeFATChoose', }, \&partition_table::description, \@ok_for_resize_fat) or return; my $hd = fsedit::part2hd($part, $all_hds); my $resize_fat = eval { my $pkg = isFat($part) ? do { require resize_fat::main; 'resize_fat::main'; } : do { require diskdrake::resize_ntfs; 'diskdrake::resize_ntfs'; }; $pkg->new($part->{device}, devices::make($part->{device})); }; $@ and die \N("The FAT resizer is unable to handle your partition, the following error occured: %s", formatError($@)); my $min_win = do { my $_w = $o->wait_message(N("Resizing"), N("Computing the size of the Windows partition")); $resize_fat->min_size; }; #- make sure that even after normalizing the size to cylinder boundaries, the minimun will be saved, #- this save at least a cylinder (less than 8Mb). $min_win += partition_table::raw::cylinder_size($hd); $part->{size} > $min_linux + $min_swap + $min_freewin + $min_win or die \N("Your Windows partition is too fragmented. Please reboot your computer under Windows, run the ``defrag'' utility, then restart the Mandrake Linux installation."); $o->ask_okcancel('', formatAlaTeX(N("WARNING! DrakX will now resize your Windows partition. Be careful: this operation is dangerous. If you have not already done so, you should first exit the installation, run scandisk under Windows (and optionally run defrag), then restart the installation. You should also backup your data. When sure, press Ok."))) or return; my $mb_size = $part->{size} >> 11; $o->ask_from('', N("Which size do you want to keep for Windows on"), [ { label => N("partition %s", partition_table::description($part)), val => \$mb_size, min => $min_win >> 11, max => ($part->{size} - $min_linux - $min_swap) >> 11, type => 'range' }, ]) or return; my $oldsize = $part->{size}; $part->{size} = from_Mb($mb_size, $min_win, $part->{size}); $hd->adjustEnd($part); eval { my $_w = $o->wait_message(N("Resizing"), N("Resizing Windows partition")); $resize_fat->resize($part->{size}); }; if (my $err = $@) { $part->{size} = $oldsize; die \N("FAT resizing failed: %s", formatError($err)); } $o->ask_warn('', N("To ensure data integrity after resizing the partition(s), filesystem checks will be run on your next boot into Windows(TM)")) if !isFat($part); $part->{isFormatted} = 1; $hd->{isDirty} = $hd->{needKernelReread} = 1; partition_table::adjust_local_extended($hd, $part); partition_table::adjust_main_extended($hd); fsedit::auto_allocate($all_hds); 1; } ]; } else { push @wizlog, N("There is no FAT partition to resize (or not enough space left)"); } if (@$fstab && @hds_rw) { $solutions{wipe_drive} = [ 10, fsedit::is_one_big_fat_or_NT($hds) ? N("Remove Windows(TM)") : N("Erase entire disk"), sub { my $hd = $o->ask_from_listf_raw({ messages => N("You have more than one hard drive, which one do you install linux on?"), interactive_help_id => 'takeOverHdChoose', }, \&partition_table::description, \@hds_rw) or return; $o->ask_okcancel_({ messages => N("ALL existing partitions and their data will be lost on drive %s", partition_table::description($hd)), interactive_help_id => 'takeOverHdConfirm' }) or return; partition_table::raw::zero_MBR($hd); fsedit::auto_allocate($all_hds); 1; } ]; } if (@hds_rw) { $solutions{diskdrake} = [ 0, N("Custom disk partitioning"), sub { partition_with_diskdrake($o, $all_hds, 'nowizard') } ]; } $solutions{fdisk} = [ -10, N("Use fdisk"), sub { $o->enter_console; foreach (@$hds) { print "\n" x 10, N("You can now partition %s. When you are done, don't forget to save using `w'", partition_table::description($_)); print "\n\n"; my $pid = 0; if (arch() =~ /ppc/) { $pid = fork() or exec "pdisk", devices::make($_->{device}); } else { $pid = fork() or exec "fdisk", devices::make($_->{device}); } waitpid($pid, 0); } $o->leave_console; 0; } ] if $o->{partitioning}{fdisk}; log::l("partitioning wizard log:\n", (map { ">>wizlog>>$_\n" } @wizlog)); %solutions; } sub partitionWizard { my ($o, $nodiskdrake) = @_; my %solutions = partitionWizardSolutions($o, $o->{all_hds}); delete $solutions{diskdrake} if $nodiskdrake; my @solutions = sort { $b->[0] <=> $a->[0] } values %solutions; my $level = $::expert ? -9999 : 0; my @sol = grep { $_->[0] >= $level } @solutions; log::l('' . "solutions found: " . join('', map { $_->[1] } @sol) . " (all solutions found: " . join('', map { $_->[1] } @solutions) . ")"); @solutions = @sol if @sol > 1; log::l("solutions: ", int @solutions); @solutions or $o->ask_warn('', N("I can't find any room for installing")), die 'already displayed'; log::l('HERE: ', join(',', map { $_->[1] } @solutions)); my $sol; $o->ask_from_({ messages => N("The DrakX Partitioning wizard found the following solutions:"), interactive_help_id => 'doPartitionDisks', }, [ { val => \$sol, list => \@solutions, format => sub { $_[0][1] }, type => 'list' } ]); log::l("partitionWizard calling solution $sol->[1]"); my $ok = eval { $sol->[2]->() }; $@ and $o->ask_warn('', N("Partitioning failed: %s", formatError($@))); $ok or goto &partitionWizard; 1; } sub upNetwork { my ($o, $pppAvoided) = @_; my $_w = $o->wait_message('', N("Bringing up the network")); install_steps::upNetwork($o, $pppAvoided); } sub downNetwork { my ($o, $pppOnly) = @_; my $_w = $o->wait_message('', N("Bringing down the network")); install_steps::downNetwork($o, $pppOnly); } 1;