From 5c8010ccef4dcc91d572ee09e5ce1c7cbf575581 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 20 Jun 2005 06:38:06 +0000 Subject: initial dmraid support --- perl-install/fsedit.pm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'perl-install/fsedit.pm') 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}; -- cgit v1.2.1