summaryrefslogtreecommitdiff
path: root/sys-boot/grub/files/grub-2.02_beta2-lvm2-raid1.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@rogentos.ro>2016-03-24 10:02:04 +0000
committerV3n3RiX <venerix@rogentos.ro>2016-03-24 10:02:04 +0000
commit0ee1b38bf6cd303d09003b08fdfd50876d394d5b (patch)
treef1203508990b84338122590555432b3123c3b81b /sys-boot/grub/files/grub-2.02_beta2-lvm2-raid1.patch
parentd3b9de9e515a63d6b780435704aa2d1430b36ad5 (diff)
import grub from gentoo
Diffstat (limited to 'sys-boot/grub/files/grub-2.02_beta2-lvm2-raid1.patch')
-rw-r--r--sys-boot/grub/files/grub-2.02_beta2-lvm2-raid1.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/sys-boot/grub/files/grub-2.02_beta2-lvm2-raid1.patch b/sys-boot/grub/files/grub-2.02_beta2-lvm2-raid1.patch
new file mode 100644
index 00000000..76c72a62
--- /dev/null
+++ b/sys-boot/grub/files/grub-2.02_beta2-lvm2-raid1.patch
@@ -0,0 +1,68 @@
+From: Andrei Borzenkov <arvidjaar@gmail.com>
+Date: Thu, 19 Mar 2015 18:30:27 +0000 (+0300)
+Subject: core: add LVM RAID1 support
+X-Git-Url: http://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff_plain;h=527eeeeee6c8d3d8e3bb1fac408d47bb1dcbec95;hp=7c9309e50a124817e67de38b30c6291acecad560
+
+core: add LVM RAID1 support
+
+Closes 44534.
+---
+
+diff --git a/grub-core/disk/lvm.c b/grub-core/disk/lvm.c
+index 1e7f197..9b97004 100644
+--- a/grub-core/disk/lvm.c
++++ b/grub-core/disk/lvm.c
+@@ -577,13 +577,17 @@ grub_lvm_detect (grub_disk_t disk,
+ if (is_pvmove)
+ seg->node_count = 1;
+ }
+- else if (grub_memcmp (p, "raid", sizeof ("raid") - 1)
+- == 0 && (p[sizeof ("raid") - 1] >= '4'
+- && p[sizeof ("raid") - 1] <= '6')
++ else if (grub_memcmp (p, "raid", sizeof ("raid") - 1) == 0
++ && ((p[sizeof ("raid") - 1] >= '4'
++ && p[sizeof ("raid") - 1] <= '6')
++ || p[sizeof ("raid") - 1] == '1')
+ && p[sizeof ("raidX") - 1] == '"')
+ {
+ switch (p[sizeof ("raid") - 1])
+ {
++ case '1':
++ seg->type = GRUB_DISKFILTER_MIRROR;
++ break;
+ case '4':
+ seg->type = GRUB_DISKFILTER_RAID4;
+ seg->layout = GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC;
+@@ -608,16 +612,18 @@ grub_lvm_detect (grub_disk_t disk,
+ goto lvs_segment_fail;
+ }
+
+- seg->stripe_size = grub_lvm_getvalue (&p, "stripe_size = ");
+- if (p == NULL)
++ if (seg->type != GRUB_DISKFILTER_MIRROR)
+ {
++ seg->stripe_size = grub_lvm_getvalue (&p, "stripe_size = ");
++ if (p == NULL)
++ {
+ #ifdef GRUB_UTIL
+- grub_util_info ("unknown stripe_size\n");
++ grub_util_info ("unknown stripe_size\n");
+ #endif
+- goto lvs_segment_fail;
++ goto lvs_segment_fail;
++ }
+ }
+
+-
+ seg->nodes = grub_zalloc (sizeof (seg->nodes[0])
+ * seg->node_count);
+
+@@ -625,7 +631,7 @@ grub_lvm_detect (grub_disk_t disk,
+ if (p == NULL)
+ {
+ #ifdef GRUB_UTIL
+- grub_util_info ("unknown mirrors\n");
++ grub_util_info ("unknown raids\n");
+ #endif
+ goto lvs_segment_fail2;
+ }