diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-06-24 09:36:28 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-06-24 09:36:28 +0000 |
commit | 0e8b0439a9b3394049065f53c643f5b446e4a419 (patch) | |
tree | 330ba58b8893b392c78bd2c70e0447784ece89bf | |
parent | 4a06e392e0fb8c47b4ec472762dfbbae9b89ae7b (diff) | |
download | drakx-0e8b0439a9b3394049065f53c643f5b446e4a419.tar drakx-0e8b0439a9b3394049065f53c643f5b446e4a419.tar.gz drakx-0e8b0439a9b3394049065f53c643f5b446e4a419.tar.bz2 drakx-0e8b0439a9b3394049065f53c643f5b446e4a419.tar.xz drakx-0e8b0439a9b3394049065f53c643f5b446e4a419.zip |
handle dmraid device not there, keeping the raw hds
-rw-r--r-- | perl-install/fs/dmraid.pm | 14 | ||||
-rw-r--r-- | perl-install/fsedit.pm | 7 |
2 files changed, 10 insertions, 11 deletions
diff --git a/perl-install/fs/dmraid.pm b/perl-install/fs/dmraid.pm index 1a0268014..7166ce12d 100644 --- a/perl-install/fs/dmraid.pm +++ b/perl-install/fs/dmraid.pm @@ -40,16 +40,18 @@ sub pvs_and_vgs() { } sub vgs() { + my @l = pvs_and_vgs(); + my %vg2pv; push @{$vg2pv{$_->{vg}}}, $_->{pv} foreach @l; map { my $dev = "mapper/$_->{vg}"; my $vg = fs::subpart_from_wild_device_name("/dev/$dev"); - add2hash($vg, { media_type => 'hd', prefix => $dev, bus => "dm_$_->{format}" }); - $vg; - } grep { $_->{status} eq 'ok' } uniq_ { $_->{vg} } pvs_and_vgs(); -} + add2hash($vg, { media_type => 'hd', prefix => $dev, bus => "dm_$_->{format}", disks => $vg2pv{$_->{vg}} }); + + #- device should exist, created by dmraid(8) using libdevmapper + #- if it doesn't, we suppose it's not in use + if_(-e "/dev/$dev", $vg); -sub pvs() { - map { $_->{pv} } grep { $_->{status} eq 'ok' } pvs_and_vgs(); + } grep { $_->{status} eq 'ok' } uniq_ { $_->{vg} } @l; } 1; diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index 404376258..2b5a81cf0 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -107,16 +107,13 @@ sub handle_dmraid { eval { require fs::dmraid; 1 } or return; - my @pvs = fs::dmraid::pvs(); my @vgs = fs::dmraid::vgs(); - log::l(sprintf('dmraid: pvs = [%s], vgs = [%s]', - join(' ', @pvs), - join(' ', map { $_->{device} } @vgs))); + log::l(sprintf('dmraid: ' . join(' ', map { "$_->{device} [" . join(' ', @{$_->{disks}}) . "]" } @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; + } map { @{$_->{disks}} } @vgs; @$drives = difference2($drives, \@used_hds); |