summaryrefslogtreecommitdiffstats
path: root/perl-install/patch/patch-2006-existing-md.pl
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-10-18 09:06:48 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-10-18 09:06:48 +0000
commit38c3705b4eee672aca75ec6e863f1c980f2ec857 (patch)
treebc42b0a36b6bb7546ab0ecd8892b9a5420c61c98 /perl-install/patch/patch-2006-existing-md.pl
parentd19e29a2f391ce804e45d7d24c685c275e3296a3 (diff)
downloaddrakx-backup-do-not-use-38c3705b4eee672aca75ec6e863f1c980f2ec857.tar
drakx-backup-do-not-use-38c3705b4eee672aca75ec6e863f1c980f2ec857.tar.gz
drakx-backup-do-not-use-38c3705b4eee672aca75ec6e863f1c980f2ec857.tar.bz2
drakx-backup-do-not-use-38c3705b4eee672aca75ec6e863f1c980f2ec857.tar.xz
drakx-backup-do-not-use-38c3705b4eee672aca75ec6e863f1c980f2ec857.zip
"mdadm --detail --brief" doesn't contain "devices=..." anymore (since mdadm 1.12.0),
it needs option "-v" to keep previous behaviour
Diffstat (limited to 'perl-install/patch/patch-2006-existing-md.pl')
-rw-r--r--perl-install/patch/patch-2006-existing-md.pl14
1 files changed, 14 insertions, 0 deletions
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];
+};