diff options
Diffstat (limited to 'perl-install/fsedit.pm')
-rw-r--r-- | perl-install/fsedit.pm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index 1ca3e1f3d..e2000b2b1 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -98,6 +98,31 @@ sub lvms { @lvms; } +sub handle_dmraid { + my ($drives) = @_; + + @$drives > 1 or return; + + devices::make($_->{device}) foreach @$drives; + + require fs::dmraid; + + my @pvs = fs::dmraid::pvs(); + my @vgs = fs::dmraid::vgs(); + log::l(sprintf('dmraid: pvs = [%s], vgs = [%s]', + join(' ', @pvs), + join(' ', map { $_->{device} } @vgs))); + + my @used_hds = map { + my $part = fs::get::device2part($_, $drives) or log::l("handle_dmraid: can't find $_ in known drives"); + if_($part, $part); + } @pvs; + + @$drives = difference2($drives, \@used_hds); + + push @$drives, @vgs; +} + sub get_hds { my ($o_flags, $o_in) = @_; my $flags = $o_flags || {}; @@ -105,6 +130,9 @@ sub get_hds { my @drives = detect_devices::hds(); + #- replace drives used in dmraid by the merged name + handle_dmraid(\@drives); + foreach my $hd (@drives) { $hd->{file} = devices::make($hd->{device}); $hd->{prefix} ||= $hd->{device}; |