summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-07-07 22:45:48 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-07-07 22:45:48 +0000
commitef94ffc7836beb6bc297106851749441e0fb2254 (patch)
tree515f1b9eabdffd7a4819fc88aef44f1365c54ac0
parent30e6d859f43a9c69d3acbf867cd6090b52af8259 (diff)
downloaddrakx-ef94ffc7836beb6bc297106851749441e0fb2254.tar
drakx-ef94ffc7836beb6bc297106851749441e0fb2254.tar.gz
drakx-ef94ffc7836beb6bc297106851749441e0fb2254.tar.bz2
drakx-ef94ffc7836beb6bc297106851749441e0fb2254.tar.xz
drakx-ef94ffc7836beb6bc297106851749441e0fb2254.zip
great new raidAutoStartRaidtab allowing to handle existing software raids
even when RAID_AUTORUN is not supported by kernel (which is the case for us since md.o is a not builtin the kernel)
-rw-r--r--perl-install/detect_devices.pm28
-rw-r--r--perl-install/fsedit.pm5
2 files changed, 24 insertions, 9 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 54f803756..cabc7807c 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -10,6 +10,7 @@ use vars qw($pcitable_addons $usbtable_addons);
use log;
use common;
use devices;
+use run_program;
use c;
#-#####################################################################################
@@ -551,22 +552,33 @@ sub hasMousePS2 {
}
sub raidAutoStartIoctl {
- eval { modules::load('md') };
- my $md = devices::make("md0");
local *F;
- sysopen F, $md, 2 or return;
+ sysopen F, devices::make("md0"), 2 or return;
ioctl F, 2324, 0;
}
+sub raidAutoStartRaidtab {
+ my (@parts) = @_;
+ #- faking a raidtab, it seems to be working :-)))
+ #- (choosing md0, but it works for the others!)
+ foreach (@parts) {
+ output("/etc/raidtab", "raiddev /dev/md0\n device " . devices::make($_->{device}) . "\n");
+ run_program::run('raidstart', devices::make("md0"));
+ }
+}
+
sub raidAutoStart {
+ my (@parts) = @_;
+
log::l("raidAutoStart");
+ eval { modules::load('md') };
my %personalities = ( '1' => 'linear', '2' => 'raid0', '3' => 'raid1', '4' => 'raid5' );
- raidAutoStartIoctl() or log::l("warning, RAID_AUTORUN not supported by kernel"), return;
- if (my @needed_perso = map { if_(/^kmod: failed.*md-personality-(.)/, $personalities{$1}) } syslog()) {
+ raidAutoStartIoctl() or raidAutoStartRaidtab(@parts);
+ if (my @needed_perso = map {
+ if_(/^kmod: failed.*md-personality-(.)/ ||
+ /^md: personality (.) is not loaded/, $personalities{$1}) } syslog()) {
log::l("RAID: autostart needs personality from $_"), eval { modules::load(@needed_perso) };
- return raidAutoStartIoctl();
- } else {
- 1;
+ raidAutoStartIoctl() or raidAutoStartRaidtab(@parts);
}
}
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index afff117ad..5b700d387 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -90,7 +90,10 @@ sub raids {
my ($hds) = @_;
my @parts = get_fstab(@$hds);
- (grep { isRawRAID($_) } @parts) && detect_devices::raidAutoStart() or return [];
+ {
+ my @l = grep { isRawRAID($_) } @parts or return [];
+ detect_devices::raidAutoStart(@l);
+ }
fs::get_major_minor(@parts);
my %devname2part = map { $_->{dev} => { %$_, device => $_->{dev} } } read_partitions();