summaryrefslogtreecommitdiffstats
path: root/perl-install/fsedit.pm
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/fsedit.pm
parent5afb716b81f174980b45127ad48f30ebb17c209e (diff)
downloaddrakx-backup-do-not-use-a65380d6226ab184a590a6630bd460e2e01217a4.tar
drakx-backup-do-not-use-a65380d6226ab184a590a6630bd460e2e01217a4.tar.gz
drakx-backup-do-not-use-a65380d6226ab184a590a6630bd460e2e01217a4.tar.bz2
drakx-backup-do-not-use-a65380d6226ab184a590a6630bd460e2e01217a4.tar.xz
drakx-backup-do-not-use-a65380d6226ab184a590a6630bd460e2e01217a4.zip
handle auto_allocate_raids for auto_installs
Diffstat (limited to 'perl-install/fsedit.pm')
-rw-r--r--perl-install/fsedit.pm25
1 files changed, 24 insertions, 1 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;