From 38c3705b4eee672aca75ec6e863f1c980f2ec857 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 18 Oct 2005 09:06:48 +0000 Subject: "mdadm --detail --brief" doesn't contain "devices=..." anymore (since mdadm 1.12.0), it needs option "-v" to keep previous behaviour --- perl-install/patch/patch-2006-existing-md.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 perl-install/patch/patch-2006-existing-md.pl diff --git a/perl-install/patch/patch-2006-existing-md.pl b/perl-install/patch/patch-2006-existing-md.pl new file mode 100644 index 000000000..ab30146d3 --- /dev/null +++ b/perl-install/patch/patch-2006-existing-md.pl @@ -0,0 +1,14 @@ +log::l("PATCH: 2006-existing-md"); + +use raid; +package raid; + +undef *get_md_info; +*get_md_info = sub { + my ($dev) = @_; + my $conf = parse_mdadm_conf(scalar run_program::get_stdout('mdadm', '--detail', '--brief', '-v', $dev)); + + @{$conf->{ARRAY}} or return; + @{$conf->{ARRAY}} == 1 or internal_error("too many answers"); + $conf->{ARRAY}[0]; +}; -- cgit v1.2.1