diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2001-06-11 22:17:14 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2001-06-11 22:17:14 +0000 |
commit | b8d75ed5914466dfc5c07916ac167f8f4728888c (patch) | |
tree | b1ae113abe5fcc13038f528a6bf0b9d5ed684da5 /perl-install/detect_devices.pm | |
parent | df52dd03d51f1728f15db0d89df54532811c1870 (diff) | |
download | drakx-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/detect_devices.pm')
-rw-r--r-- | perl-install/detect_devices.pm | 18 |
1 files changed, 18 insertions, 0 deletions
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 :( #-###################################################################################### |