summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-08-06 23:22:23 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-08-06 23:22:23 +0000
commit995ea591c5076d0a1f809f4b0c5d919db7510c88 (patch)
treee32a887a5e46515dbee32d4b4825f1b91c1ab61d /perl-install/install_steps.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_steps.pm')
-rw-r--r--perl-install/install_steps.pm53
1 files changed, 30 insertions, 23 deletions
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 9b3b9b8db..2b7c44417 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -127,36 +127,43 @@ sub doPartitionDisks {
my ($o, $hds) = @_;
if ($o->{lnx4win}) {
- my @l = sort { $a->{device_windobe} cmp $b->{device_windobe} }
- grep { isFat($_) } fsedit::get_fstab(@{$o->{hds}}) or die "wow, lnx4win with no fat partitions! hard times :(";
- my $real_part = $o->doPartitionDisksLnx4winDev(\@l) || $l[0];
+ my @fat_parts = grep { isFat($_) } fsedit::get_fstab(@$hds) or die "wow, lnx4win with no fat partitions! hard times :(";
+ doPartitionDisksLnx4win($o, @fat_parts);
+ } else {
+ unless ($::testing) {
+ partition_table::write($_) foreach @$hds;
+ }
+ }
+}
+
+#------------------------------------------------------------------------------
+sub doPartitionDisksLnx4win {
+ my ($o, @fat_parts) = @_;
- my $handle = loopback::inspect($real_part, '', 'rw') or die _("This partition can't be used for loopback");
- my $size = loopback::getFree($handle->{dir}, $real_part);
+ my $real_part = $o->doPartitionDisksLnx4winDev(@fat_parts) or return;
- my $max_linux = 1000 << 11; $max_linux *= 10 if $::expert;
- my $min_linux = 300 << 11; $min_linux /= 3 if $::expert;
- my $min_freewin = 100 << 11; $min_freewin /= 10 if $::expert;
+ my $handle = loopback::inspect($real_part, '', 'rw') or die _("This partition can't be used for loopback");
+ my $size = loopback::getFree($handle->{dir}, $real_part);
- my $swap = { type => 0x82, loopback_file => '/lnx4win/swapfile', mntpoint => 'swap', size => 64 << 11, device => $real_part, notFormatted => 1 };
- my $root = { type => 0x83, loopback_file => '/lnx4win/linuxsys.img', mntpoint => '/', size => 0, device => $real_part, notFormatted => 1 };
- $root->{size} = min($size - $swap->{size} - $min_freewin, $max_linux);
- log::l("lnx4win $root->{size} <= $min_linux (minlinux), $size (minavail) - $swap->{size} (swapsize) - $min_freewin (minfreewin), $max_linux (maxlinux)");
- $root->{size} > $min_linux or die "not enough room on that partition for lnx4win";
+ my $max_linux = 1000 << 11; $max_linux *= 10 if $::expert;
+ my $min_linux = 300 << 11; $min_linux /= 3 if $::expert;
+ my $min_freewin = 100 << 11; $min_freewin /= 10 if $::expert;
+
+ my $swap = { type => 0x82, loopback_file => '/lnx4win/swapfile', mntpoint => 'swap', size => 64 << 11, device => $real_part, notFormatted => 1 };
+ my $root = { type => 0x83, loopback_file => '/lnx4win/linuxsys.img', mntpoint => '/', size => 0, device => $real_part, notFormatted => 1 };
+ $root->{size} = min($size - $swap->{size} - $min_freewin, $max_linux);
+ log::l("lnx4win $root->{size} <= $min_linux (minlinux), $size (minavail) - $swap->{size} (swapsize) - $min_freewin (minfreewin), $max_linux (maxlinux)");
+ $root->{size} > $min_linux or die "not enough room on that partition for lnx4win";
- $o->doPartitionDisksLnx4winSize(\$root->{size}, \$swap->{size}, $size - 2 * $swap->{size}, 2 * $swap->{size});
+ $o->doPartitionDisksLnx4winSize(\$root->{size}, \$swap->{size}, $size - 2 * $swap->{size}, 2 * $swap->{size}) or return;
- unlink "$handle->{dir}$_" foreach "/lnx4win/swapfile", "/lnx4win/linuxsys.img";
+ unlink "$handle->{dir}$_" foreach "/lnx4win/swapfile", "/lnx4win/linuxsys.img";
- push @{$real_part->{loopback}}, $root, $swap;
- } else {
- unless ($::testing) {
- partition_table::write($_) foreach @$hds;
- }
- }
+ push @{$real_part->{loopback}}, $root, $swap;
+ 1;
}
-sub doPartitionDisksLnx4winDev {}
-sub doPartitionDisksLnx4winSize {}
+sub doPartitionDisksLnx4winDev { my ($o, $fat_part) = @_; $fat_part }
+sub doPartitionDisksLnx4winSize { 1 }
#------------------------------------------------------------------------------