summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-08-01 12:51:58 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-08-01 12:51:58 +0000
commita65380d6226ab184a590a6630bd460e2e01217a4 (patch)
treeb061f39e85fce059e65315dcc908eea3cdc8771e /perl-install
parent5afb716b81f174980b45127ad48f30ebb17c209e (diff)
downloaddrakx-a65380d6226ab184a590a6630bd460e2e01217a4.tar
drakx-a65380d6226ab184a590a6630bd460e2e01217a4.tar.gz
drakx-a65380d6226ab184a590a6630bd460e2e01217a4.tar.bz2
drakx-a65380d6226ab184a590a6630bd460e2e01217a4.tar.xz
drakx-a65380d6226ab184a590a6630bd460e2e01217a4.zip
handle auto_allocate_raids for auto_installs
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/fsedit.pm25
-rw-r--r--perl-install/install_steps.pm2
2 files changed, 25 insertions, 2 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index 504d643dd..ea6e6443b 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -387,11 +387,34 @@ sub allocatePartitions($$) {
}
sub auto_allocate {
- my ($hds, $suggestions) = @_;
+ my ($hds, $suggestions, $raid) = @_;
allocatePartitions($hds, $suggestions || $suggestions{simple});
+
+ auto_allocate_raids($hds, $suggestions, $raid) if $raid && $suggestions;
+
map { partition_table::assign_device_numbers($_) } @$hds;
}
+sub auto_allocate_raids {
+ my ($hds, $suggestions, $raid) = @_;
+
+ my @raids = grep { isRAID($_) } get_fstab(@$hds) or return;
+ if (@raids) {
+ require raid;
+ my @mds = grep { $_->{hd} =~ /md/ } @$suggestions;
+ foreach my $md (@mds) {
+ my @raids_ = grep { !$md->{parts} || $md->{parts} =~ /\Q$_->{mntpoint}/ } @raids;
+ @raids = difference2(\@raids, \@raids_);
+ my $nb = raid::new($raid, @raids_);
+ my $part = $raid->[$nb];
+
+ my %h = %$md;
+ delete @h{'hd', 'parts'};
+ put_in_hash($part, \%h); # mntpoint, level, chunk-size, type
+ }
+ }
+}
+
sub undo_prepare($) {
my ($hds) = @_;
require Data::Dumper;
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 47c008c8e..ab16217f8 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -192,7 +192,7 @@ sub doPartitionDisks {
install_any::use_root_part($o->{fstab}, $p, $o->{prefix});
}
if ($o->{partitioning}{auto_allocate}) {
- fsedit::auto_allocate($o->{hds}, $o->{partitions});
+ fsedit::auto_allocate($o->{hds}, $o->{partitions}, $o->{raid}{raid});
}
}