diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-06-20 06:38:06 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-06-20 06:38:06 +0000 |
commit | 5c8010ccef4dcc91d572ee09e5ce1c7cbf575581 (patch) | |
tree | 79155bc13a056fee32077819a34692198b6b4984 /perl-install/fsedit.pm | |
parent | a00c3995a27103b97534c3957dff9441874fd9ce (diff) | |
download | drakx-5c8010ccef4dcc91d572ee09e5ce1c7cbf575581.tar drakx-5c8010ccef4dcc91d572ee09e5ce1c7cbf575581.tar.gz drakx-5c8010ccef4dcc91d572ee09e5ce1c7cbf575581.tar.bz2 drakx-5c8010ccef4dcc91d572ee09e5ce1c7cbf575581.tar.xz drakx-5c8010ccef4dcc91d572ee09e5ce1c7cbf575581.zip |
initial dmraid support
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}; |