summaryrefslogtreecommitdiffstats
path: root/perl-install/install_interactive.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/install_interactive.pm')
-rw-r--r--perl-install/install_interactive.pm46
1 files changed, 24 insertions, 22 deletions
diff --git a/perl-install/install_interactive.pm b/perl-install/install_interactive.pm
index e86c10bb6..971acd2d6 100644
--- a/perl-install/install_interactive.pm
+++ b/perl-install/install_interactive.pm
@@ -4,15 +4,15 @@ use diagnostics;
use strict;
use common;
-use partition_table qw(:types);
+use partition_table;
use partition_table::raw;
+use fs::type;
use detect_devices;
use install_steps;
use install_any;
use devices;
use fsedit;
use log;
-use fs;
sub tellAboutProprietaryModules {
@@ -41,7 +41,7 @@ sub partition_with_diskdrake {
do {
$ok = 1;
my $do_force_reload = sub {
- $o->{all_hds} = fsedit::empty_all_hds();
+ $o->{all_hds} = fs::get::empty_all_hds();
install_any::getHds($o, $o);
$all_hds = $o->{all_hds};
$o->{all_hds};
@@ -55,9 +55,9 @@ sub partition_with_diskdrake {
partitionWizard($o, 'nodiskdrake') or redo;
return 1;
}
- my @fstab = fsedit::get_all_fstab($all_hds);
+ my @fstab = fs::get::fstab($all_hds);
- unless (fsedit::get_root_(\@fstab)) {
+ unless (fs::get::root_(\@fstab)) {
$ok = 0;
$o->ask_okcancel('', N("You must have a root partition.
For this, create a partition (or click on an existing one).
@@ -66,7 +66,7 @@ Then choose action ``Mount point'' and set it to `/'"), 1) or return;
if (!any { isSwap($_) } @fstab) {
$ok &&= $o->ask_okcancel('', N("You don't have a swap partition.\n\nContinue anyway?"));
}
- if (arch() =~ /ia64/ && !fsedit::has_mntpoint("/boot/efi", $all_hds)) {
+ if (arch() =~ /ia64/ && !fs::get::has_mntpoint("/boot/efi", $all_hds)) {
$o->ask_warn('', N("You must have a FAT partition mounted in /boot/efi"));
$ok = '';
}
@@ -77,7 +77,7 @@ Then choose action ``Mount point'' and set it to `/'"), 1) or return;
sub partitionWizardSolutions {
my ($o, $all_hds) = @_;
my $hds = $all_hds->{hds};
- my $fstab = [ fsedit::get_all_fstab($all_hds) ];
+ my $fstab = [ fs::get::fstab($all_hds) ];
my @wizlog;
my (%solutions);
@@ -91,12 +91,12 @@ sub partitionWizardSolutions {
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 } ]
+ if (fs::get::hds_free_space(@hds_can_add) > $min_linux) {
+ $solutions{free_space} = [ 20, N("Use free space"), sub { fsedit::auto_allocate($all_hds, $o->{partitions}); 1 } ]
} else {
push @wizlog, N("Not enough free space to allocate new partitions") . ": " .
(@hds_can_add ?
- fsedit::free_space(@hds_can_add) . " < $min_linux" :
+ fs::get::hds_free_space(@hds_can_add) . " < $min_linux" :
"no harddrive on which partitions can be added");
}
@@ -107,7 +107,7 @@ sub partitionWizardSolutions {
push @wizlog, N("There is no existing partition to use");
}
- my @fats = grep { isFat($_) } @$fstab;
+ my @fats = grep { $_->{fs_type} eq 'vfat' } @$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} =
@@ -121,8 +121,8 @@ sub partitionWizardSolutions {
{ 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}},
- { pt_type =>0x483, loopback_file => '/lnx4win/linuxsys.img', mntpoint => '/', size => $s_root << 11, loopback_device => $part, notFormatted => 1 },
- { pt_type => 0x82, loopback_file => '/lnx4win/swapfile', mntpoint => 'swap', size => $s_swap << 11, loopback_device => $part, notFormatted => 1 };
+ { fs_type => 'ext3', loopback_file => '/lnx4win/linuxsys.img', mntpoint => '/', size => $s_root << 11, loopback_device => $part, notFormatted => 1 },
+ { fs_type => 'swap', loopback_file => '/lnx4win/swapfile', mntpoint => 'swap', size => $s_swap << 11, loopback_device => $part, notFormatted => 1 };
fsedit::recompute_loopbacks($all_hds);
1;
} ];
@@ -132,16 +132,16 @@ sub partitionWizardSolutions {
}
- if (my @ok_for_resize_fat = grep { isFat_or_NTFS($_) && !fsedit::part2hd($_, $all_hds)->{readonly} } @$fstab) {
+ if (my @ok_for_resize_fat = grep { isFat_or_NTFS($_) && !fs::get::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 $hd = fs::get::part2hd($part, $all_hds);
my $resize_fat = eval {
- my $pkg = isFat($part) ? do {
+ my $pkg = $part->{fs_type} eq 'vfat' ? do {
require resize_fat::main;
'resize_fat::main';
} : do {
@@ -151,7 +151,7 @@ sub partitionWizardSolutions {
$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($@));
+the following error occurred: %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;
@@ -161,7 +161,9 @@ the following error occured: %s", formatError($@));
$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 Mandrakelinux installation.");
- $o->ask_okcancel('', formatAlaTeX(N("WARNING!
+ $o->ask_okcancel('', formatAlaTeX(
+ #-PO: keep the double empty lines between sections, this is formatted a la LaTeX
+ N("WARNING!
DrakX will now resize your Windows partition. Be careful: this
operation is dangerous. If you have not already done so, you
@@ -192,14 +194,14 @@ When sure, press Ok."))) or return;
}
$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);
+filesystem checks will be run on your next boot into Windows(TM)")) if $part->{fs_type} ne 'vfat';
- $part->{isFormatted} = 1;
+ set_isFormatted($part, 1);
partition_table::will_tell_kernel($hd, resize => $part); #- down-sizing, write_partitions is not needed
partition_table::adjust_local_extended($hd, $part);
partition_table::adjust_main_extended($hd);
- fsedit::auto_allocate($all_hds);
+ fsedit::auto_allocate($all_hds, $o->{partitions});
1;
} ];
} else {
@@ -217,7 +219,7 @@ filesystem checks will be run on your next boot into Windows(TM)")) if !isFat($p
$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);
+ fsedit::auto_allocate($all_hds, $o->{partitions});
1;
} ];
}