summaryrefslogtreecommitdiffstats
path: root/perl-install/fsedit.pm
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2001-06-11 22:17:14 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2001-06-11 22:17:14 +0000
commitb8d75ed5914466dfc5c07916ac167f8f4728888c (patch)
treeb1ae113abe5fcc13038f528a6bf0b9d5ed684da5 /perl-install/fsedit.pm
parentdf52dd03d51f1728f15db0d89df54532811c1870 (diff)
downloaddrakx-backup-do-not-use-b8d75ed5914466dfc5c07916ac167f8f4728888c.tar
drakx-backup-do-not-use-b8d75ed5914466dfc5c07916ac167f8f4728888c.tar.gz
drakx-backup-do-not-use-b8d75ed5914466dfc5c07916ac167f8f4728888c.tar.bz2
drakx-backup-do-not-use-b8d75ed5914466dfc5c07916ac167f8f4728888c.tar.xz
drakx-backup-do-not-use-b8d75ed5914466dfc5c07916ac167f8f4728888c.zip
include patch to autodetect raid arrays (still needs a kernel that implements the ioctl..)
Diffstat (limited to 'perl-install/fsedit.pm')
-rw-r--r--perl-install/fsedit.pm39
1 files changed, 37 insertions, 2 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index bc2182255..5a25d55b3 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -60,7 +60,7 @@ sub typeOfPart { typeFromMagic(devices::make($_[0]), @partitions_signatures) }
#-######################################################################################
sub hds {
my ($drives, $flags) = @_;
- my (@hds, @lvms);
+ my (@hds, @lvms, @raid);
my $rc;
foreach (@$drives) {
@@ -104,7 +104,42 @@ sub hds {
push @{$lvm->{disks}}, $_;
}
}
- \@hds, \@lvms;
+ if ((my @parts = grep { isRAID($_) } map { partition_table::get_normal_parts($_) } @hds) && detect_devices::raidAutoStart()) {
+ my @mdstat = cat_("/proc/mdstat");
+ for (my $i=0 ; $i<@mdstat ; $i++) {
+ next if $mdstat[$i] !~ /^md(.).* ([^ \[\]]+) ([^ ]+\[[^ \]]+\])(.*)$/;
+ my ($nb, $level, $partcar, $partcdr) = ($1, $2, $3, $4);
+ $level =~ /raid(.)/ and $level = $1;
+ $partcar =~ /([^\[]+)/ or next;
+ my @thisparts = ( $1 );
+ while ($partcdr =~ /\s*([^\[]+)[^\]]+\](.*)/) {
+ push @thisparts, $1;
+ $partcdr = $2;
+ }
+ my $chunks = $mdstat[$i+1] =~ /([^ ]+) chunks/ ? $1 : "64k";
+ my @disks;
+ foreach my $part (@parts) {
+ if (grep /$part->{device}/, @thisparts) {
+ $part->{raid} = $nb;
+ delete $part->{mntpoint};
+ push @disks, $part;
+ }
+ }
+ my $type = typeOfPart("md$nb");
+ my $notformat = 0;
+ log::l("RAID: found md$nb (raid $level) chunks $chunks ", $type ? "type $type " : "", "with parts ", join(", ", @thisparts));
+ if (!$type) {
+ $type = 0x83;
+ $notformat = 1;
+ }
+ $raid[$nb] = { 'chunk-size' => $chunks, type => $type, disks => \@disks,
+ device => "md$nb", notFormatted => $notformat, level => $level };
+ }
+ require raid;
+ raid::update(@raid);
+ }
+
+ \@hds, \@lvms, \@raid;
}
sub readProcPartitions {