summaryrefslogtreecommitdiffstats
path: root/perl-install/share/ftin.png
Commit message (Expand)AuthorAgeFilesLines
* re-adding with -kbPascal Rigaux2001-07-031-0/+0
* removing for re-adding with -kbPascal Rigaux2001-07-031-0/+0
* added png imagesdamien2001-02-151-0/+0
f809f4b0c5d919db7510c88'>995ea591c5076d0a1f809f4b0c5d919db7510c88 (patch) treee32a887a5e46515dbee32d4b4825f1b91c1ab61d /perl-install/install_any.pm parent21fbfdfead833c685b255edb3c3460198ce89877 (diff)downloaddrakx-995ea591c5076d0a1f809f4b0c5d919db7510c88.tar
drakx-995ea591c5076d0a1f809f4b0c5d919db7510c88.tar.gz
drakx-995ea591c5076d0a1f809f4b0c5d919db7510c88.tar.bz2
drakx-995ea591c5076d0a1f809f4b0c5d919db7510c88.tar.xz
drakx-995ea591c5076d0a1f809f4b0c5d919db7510c88.zip
no_comment
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r--perl-install/install_any.pm64
1 files changed, 49 insertions, 15 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index e972e8c5a..5bd607909 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -873,27 +873,61 @@ sub generate_ks_cfg {
sub partitionWizard {
my ($o, $hds, $fstab, $readonly) = @_;
+ my $wizlog;
my @solutions;
+ my $min_linux = 500 << 11;
+ my $min_freewin = 100 << 11;
+
# each solutions is a [ text, function ], where the function retunrs true if succeeded
- if (fsedit::free_space(@$hds) > 500 << 11 && !$readonly) {
+ if (fsedit::free_space(@$hds) > $min_linux and !$readonly) {
push @solutions, [ _("Use free space"), sub { fsedit::auto_allocate($hds, $o->{partitions}); 1 } ];
- } elsif (my @l = grep { isTrueFS($_) } @$fstab) {
+ } else {
+ $wizlog .= _("Not enough free space to allocate new partitions");
+ }
+
+ if (my @l = grep { isTrueFS($_) } @$fstab) {
push @solutions, [ _("Use existing partition"), sub { $o->ask_mntpoint_s($o->{fstab}) } ];
- } elsif (@l = grep { isFat($_) } @$fstab) {
+ } else {
+ $wizlog .= _("There is no existing linux partition to use");
+ }
+
+ if (my @l = grep { isFat($_) } @$fstab) {
+ fs::df($_) foreach @l;
+ my @ok_forloopback = sort { $b->{free} <=> $a->{free} } grep { $_->{free} > $min_linux + $min_freewin } @l
+ or $wizlog .= _("There is not enough space left on the FAT partition(s) (or the FAT partition is corrupted)");
+
+ push @solutions, [ _("Use the FAT partition for loopback"),
+ sub { $o->doPartitionDisksLnx4win(@ok_forloopback) } ];
+
+ my @ok_forresizing = grep {
+ !$readonly && eval {
+ my $resize_fat = resize_fat::main->new($_->{device}, devices::make($_->{device}));
+ my $min_win = $resize_fat->min_size;
+ $_->{size} > $min_linux + $min_freewin + $min_win;
+ } && !$@;
+ } @ok_forloopback or $wizlog .= _("The FAT resizer can't find enough space left on the FAT partition(s)");
+ } else {
+ $wizlog .= _("There is no FAT partitions to resize or to use as loopback");
+ }
+
+ if (@$fstab && !$readonly) {
+ require diskdrake;
+ push @solutions,
+ [ _("Take over the hard drive (beware!)"),
+ sub {
+ my $hd = $o->ask_from_listf('', _("You have more than one hard drive, which one do you install linux on?"),
+ \&partition_table_raw::description, @$hds) or return;
+ $o->ask_okcancel('', _("All existing partitions and their data will be lost on drive %s", $hd->{device})) or return;
+ partition_table_raw::zero_MBR($hd);
+ fsedit::auto_allocate($hds, $o->{partitions});
+ 1;
+ } ];
+ }
+ if (!$readonly) {
+ push @solutions,
+ [ _("Use diskdrake"), sub { diskdrake::main($hds, $o->{raid}, interactive_gtk->new, $o->{partitions}); 1 } ];
}
- require diskdrake;
- push @solutions,
- [ _("Take over the hard drive (beware!)"),
- sub {
- my $hd = $o->ask_from_listf('', _("You have more than one hard drive, which one do you install linux on?"),
- \&partition_table_raw::description, @$hds) or return;
- $o->ask_okcancel('', _("All existing partitions and their data will be lost on drive %s", $hd->{device})) or return;
- partition_table_raw::zero_MBR($hd);
- fsedit::auto_allocate($hds, $o->{partitions});
- 1;
- } ],
- [ _("Use diskdrake"), sub { diskdrake::main($hds, $o->{raid}, interactive_gtk->new, $o->{partitions}); 1 } ],
}
1;