summaryrefslogtreecommitdiffstats
path: root/perl-install/raid.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-11-09 22:03:29 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-11-09 22:03:29 +0000
commitbc05f062a49c21078346c2223d0807afc9ce20bd (patch)
tree7ca7c36745e47ceb6f475c1a0daf8e9c56b2101a /perl-install/raid.pm
parent2f45ca11b6e3f1e74f2ba8a7bf65ca37b2c9bd08 (diff)
downloaddrakx-bc05f062a49c21078346c2223d0807afc9ce20bd.tar
drakx-bc05f062a49c21078346c2223d0807afc9ce20bd.tar.gz
drakx-bc05f062a49c21078346c2223d0807afc9ce20bd.tar.bz2
drakx-bc05f062a49c21078346c2223d0807afc9ce20bd.tar.xz
drakx-bc05f062a49c21078346c2223d0807afc9ce20bd.zip
no_comment
Diffstat (limited to 'perl-install/raid.pm')
-rw-r--r--perl-install/raid.pm21
1 files changed, 19 insertions, 2 deletions
diff --git a/perl-install/raid.pm b/perl-install/raid.pm
index 8b4fb4c8e..5ee6f9c9d 100644
--- a/perl-install/raid.pm
+++ b/perl-install/raid.pm
@@ -27,12 +27,15 @@ sub new($$) {
my $nb = @$raid;
$raid->[$nb] = { 'chunk-size' => "64k", type => 0x83, disks => [ $part ], device => "md$nb", notFormatted => 1 };
$part->{raid} = $nb;
+ delete $part->{mntpoint};
+ $nb;
}
sub add($$$) {
my ($raid, $part, $nb) = @_; $nb = nb($nb);
$raid->[$nb]{isMounted} and die _("Can't add a partition to _formatted_ RAID md%d", $nb);
$part->{raid} = $nb;
+ delete $part->{mntpoint};
push @{$raid->[$nb]{disks}}, $part;
}
@@ -40,6 +43,7 @@ sub delete($$) {
my ($raid, $nb) = @_;
$nb = nb($nb);
+ run_program::run("raidstop", devices::make($raid->[$nb]{device}));
delete $_->{raid} foreach @{$raid->[$nb]{disks}};
$raid->[$nb] = undef;
}
@@ -109,8 +113,8 @@ chunk-size $_->{'chunk-size'}
persistent-superblock 1
EOF
print F "nr-raid-disks ", int @{$_->{disks}};
- map_index {
- print F " device /dev/$_->{device}";
+ map_index {
+ print F " device ", devices::make($_->{device});
print F " raid-disk $::i";
} @{$_->{disks}};
}
@@ -130,6 +134,9 @@ sub format_part($$) {
my ($raid, $part) = @_;
make($raid->{raid}, $part) if is($part);
fs::format_part($part);
+ if (is($part)) {
+ $_->{isFormatted} = 1 foreach @{$part->{disks}};
+ }
}
sub verify($) {
@@ -140,4 +147,14 @@ sub verify($) {
}
}
+sub prepare_prefixed($$) {
+ my ($raid, $prefix) = @_;
+ $raid && $raid->{raid} or return;
+
+ eval { commands::cp("-f", "/etc/raidtab", "$prefix/etc/raidtab") };
+ foreach (@{$raid->{raid}}) {
+ devices::make("$prefix/dev/$_->{device}") foreach @{$_->{disks}};
+ }
+}
+
1;