From 91b3cff7370ce5ebac761c40c8c41a35345a51b0 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 27 Aug 2007 09:43:50 +0000 Subject: - fix loading linux software raid (mdadm) kernel modules (after rename raid5&raid6 -> raid456) --- perl-install/raid.pm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'perl-install/raid.pm') diff --git a/perl-install/raid.pm b/perl-install/raid.pm index 0475b68ef..91b6e9faf 100644 --- a/perl-install/raid.pm +++ b/perl-install/raid.pm @@ -96,11 +96,16 @@ sub updateSize { sub module { my ($part) = @_; - my $mod = $part->{level}; + my $level = $part->{level}; + log::l("level $level"); - $mod = 5 if $mod eq "4"; - $mod = "raid$mod" if $mod =~ /^\d+$/; - $mod; + if (member($level, 4, 5, 6)) { + 'raid456'; + } elsif ($level eq '1') { + 'raid1'; + } else { + $level; + } } @@ -191,7 +196,7 @@ sub detect_during_install_once { run_program::run('mdadm', '>>', '/etc/mdadm.conf', '--examine', '--scan'); foreach (@{parse_mdadm_conf(scalar cat_('/etc/mdadm.conf'))->{ARRAY}}) { - eval { modules::load($_->{level}) }; + eval { modules::load(module($_)) }; } run_program::run('mdadm', '--assemble', '--scan'); } @@ -266,6 +271,7 @@ sub parse_mdadm_conf { push @{$conf{DEVICE}}, split(' ', $1); } elsif (my ($md, $md_conf) = /^ARRAY\s+(\S+)\s*(.*)/) { my %md_conf = map { if_(/(.*)=(.*)/, $1 => $2) } split(' ', $md_conf); + $md_conf{level} =~ s/^raid//; $md_conf{device} = $md; push @{$conf{ARRAY}}, \%md_conf; } -- cgit v1.2.1