From b8d75ed5914466dfc5c07916ac167f8f4728888c Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Mon, 11 Jun 2001 22:17:14 +0000 Subject: include patch to autodetect raid arrays (still needs a kernel that implements the ioctl..) --- perl-install/detect_devices.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'perl-install/detect_devices.pm') diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 03d90cda2..c12767aa7 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -355,6 +355,24 @@ sub hasMousePS2 { my $t; sysread(tryOpen($_[0]) || return, $t, 256) != 1 || $t ne "\xFE"; } +sub raidAutoStartIoctl { + eval { modules::load('md') }; + my $md = devices::make("md0"); + local *F; + sysopen F, $md, 2 or return; + ioctl F, 2324, 0; +} + +sub raidAutoStart { + log::l("raidAutoStart"); + 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()) { + log::l("RAID: autostart needs personality from $_"), eval { modules::load($_) } foreach @needed_perso; + return raidAutoStartIoctl(); + } +} + #-###################################################################################### #- Wonderful perl :( #-###################################################################################### -- cgit v1.2.1