summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/install_steps.pm')
-rw-r--r--perl-install/install_steps.pm61
1 files changed, 29 insertions, 32 deletions
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 58e15fde7..72734f5b3 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -123,47 +123,43 @@ sub setupSCSI {
modules::load_thiskind('scsi|raid');
}
#------------------------------------------------------------------------------
-sub doPartitionDisks {
- my ($o, $hds) = @_;
+sub doPartitionDisksBefore {
+ my ($o) = @_;
- if ($o->{lnx4win}) {
- 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;
- }
+ if (cat_("/proc/mounts") =~ m|/\w+/(\S+)\s+/tmp/hdimage\s+(\S+)|) {
+ $o->{stage1_hd} = { dev => $1, fs => $2 };
+ install_any::getFile("XXX"); #- close still opened filehandle
+ eval { fs::umount("/tmp/hdimage") };
}
+ eval { fs::umount_all($o->{fstab}, $o->{prefix}) } if $o->{fstab} && !$::testing;
+
+ $o->{raid} ||= {};
+ install_any::getHds($o);
}
#------------------------------------------------------------------------------
-sub doPartitionDisksLnx4win {
- my ($o, @fat_parts) = @_;
-
- my $real_part = $o->doPartitionDisksLnx4winDev(@fat_parts) or return;
-
- 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 $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";
+sub doPartitionDisksAfter {
+ my ($o) = @_;
+ unless ($::testing) {
+ partition_table::write($_) foreach @{$o->{hds}};
+ $_->{rebootNeeded} and $o->rebootNeeded foreach @{$o->{hds}};
+ }
+ if (my $s = delete $o->{stage1_hd}) {
+ eval { fs::mount($s->{dev}, "/tmp/hdimage", $s->{fs}) };
+ }
- $o->doPartitionDisksLnx4winSize(\$root->{size}, \$swap->{size}, $size - 2 * $swap->{size}, 2 * $swap->{size}) or return;
+ $o->{fstab} = [ fsedit::get_fstab(@{$o->{hds}}, $o->{raid}) ];
+ fsedit::get_root($o->{fstab}) or die "Oops, no root partition";
- unlink "$handle->{dir}$_" foreach "/lnx4win/swapfile", "/lnx4win/linuxsys.img";
+ cat_("/proc/mounts") =~ m|(\S+)\s+/tmp/rhimage nfs| &&
+ !grep { $_->{mntpoint} eq "/mnt/nfs" } @{$o->{manualFstab} || []} and
+ push @{$o->{manualFstab}}, { type => "nfs", mntpoint => "/mnt/nfs", device => $1, options => "noauto,ro,nosuid,rsize=8192,wsize=8192" };
+}
- push @{$real_part->{loopback}}, $root, $swap;
- 1;
+#------------------------------------------------------------------------------
+sub doPartitionDisks {
+ my ($o, $hds) = @_;
}
-sub doPartitionDisksLnx4winDev { my ($o, $fat_part) = @_; $fat_part }
-sub doPartitionDisksLnx4winSize { 1 }
#------------------------------------------------------------------------------
@@ -186,6 +182,7 @@ sub ask_mntpoint_s {
#- in case the type does not correspond, force it to ext2
$_->{type} = 0x83 if $m =~ m|^/| && !isFat($_);
}
+ 1;
}