summaryrefslogtreecommitdiffstats
path: root/perl-install/patch/patch-2006-existing-md.pl
blob: ab30146d3359765f0669347205b31053240f73e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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];
};