summaryrefslogtreecommitdiffstats
path: root/perl-install/patch
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/patch')
-rw-r--r--perl-install/patch/patch-2006-fix-parsing-dmraid.pl42
1 files changed, 42 insertions, 0 deletions
diff --git a/perl-install/patch/patch-2006-fix-parsing-dmraid.pl b/perl-install/patch/patch-2006-fix-parsing-dmraid.pl
new file mode 100644
index 000000000..4e42dde56
--- /dev/null
+++ b/perl-install/patch/patch-2006-fix-parsing-dmraid.pl
@@ -0,0 +1,42 @@
+log::l("PATCH: 2006-fix-parsing-dmraid");
+
+use fsedit;
+package fsedit;
+
+my $old_handle_dmraid = \&handle_dmraid;
+
+undef *handle_dmraid;
+*handle_dmraid = sub {
+ my ($drives) = @_;
+
+ @$drives > 1 or return;
+
+ devices::make($_->{device}) foreach @$drives;
+
+ require fs::dmraid;
+
+ log::l("PATCH: 2006-fix-parsing-dmraid (inside handle_dmraid)");
+
+ undef *fs::dmraid::_raid_devices_raw;
+ *fs::dmraid::_raid_devices_raw = sub {
+ map {
+ chomp;
+ log::l("got: $_");
+ my %l; @l{qw(pv format vg level status size)} = split(':');
+ if_(defined $l{size}, \%l);
+ } fs::dmraid::call_dmraid('-ccr');
+ };
+
+
+ undef *fs::dmraid::_sets_raw;
+ *fs::dmraid::_sets_raw = sub {
+ map {
+ chomp;
+ log::l("got: $_");
+ my %l; @l{qw(name size stride level status subsets devs spares)} = split(':');
+ if_(defined $l{spares}, \%l);
+ } fs::dmraid::call_dmraid('-ccs');
+ };
+
+ &$old_handle_dmraid;
+};