Blame SOURCES/0047-grub-install-support-for-partitioned-partx-loop-devi.patch

a85e8e
From 5fc42eeb85e2971ea777fbe2c95e2b0d384bb86d Mon Sep 17 00:00:00 2001
a85e8e
From: Mike Gilbert <floppym@gentoo.org>
a85e8e
Date: Sun, 26 Jan 2014 02:56:04 +0100
a85e8e
Subject: [PATCH 047/260] grub-install: support for partitioned partx loop
a85e8e
 devices.
a85e8e
a85e8e
	* grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Detect
a85e8e
	/dev/loopX as being the parent of /dev/loopXpY.
a85e8e
---
a85e8e
 ChangeLog                       |  7 +++++++
a85e8e
 grub-core/osdep/linux/getroot.c | 13 +++++++++++++
a85e8e
 2 files changed, 20 insertions(+)
a85e8e
a85e8e
diff --git a/ChangeLog b/ChangeLog
a85e8e
index 67b4d5c2a..bbec1e70b 100644
a85e8e
--- a/ChangeLog
a85e8e
+++ b/ChangeLog
a85e8e
@@ -1,3 +1,10 @@
a85e8e
+2014-01-26  Mike Gilbert <floppym@gentoo.org>
a85e8e
+
a85e8e
+	grub-install: support for partitioned partx loop devices.
a85e8e
+
a85e8e
+	* grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Detect
a85e8e
+	/dev/loopX as being the parent of /dev/loopXpY.
a85e8e
+
a85e8e
 2014-01-26  Vladimir Serbinenko  <phcoder@gmail.com>
a85e8e
 
a85e8e
 	* grub-core/term/serial.c (grub_serial_register): Fix invalid free.
a85e8e
diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c
a85e8e
index 772de0a9b..19581d329 100644
a85e8e
--- a/grub-core/osdep/linux/getroot.c
a85e8e
+++ b/grub-core/osdep/linux/getroot.c
a85e8e
@@ -883,6 +883,19 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st,
a85e8e
 	  *pp = '\0';
a85e8e
 	  return path;
a85e8e
 	}
a85e8e
+
a85e8e
+      /* If this is a loop device */
a85e8e
+      if ((strncmp ("loop", p, 4) == 0) && p[4] >= '0' && p[4] <= '9')
a85e8e
+	{
a85e8e
+	  char *pp = p + 4;
a85e8e
+	  while (*pp >= '0' && *pp <= '9')
a85e8e
+	    pp++;
a85e8e
+	  if (*pp == 'p')
a85e8e
+	    *is_part = 1;
a85e8e
+	  /* /dev/loop[0-9]+p[0-9]* */
a85e8e
+	  *pp = '\0';
a85e8e
+	  return path;
a85e8e
+	}
a85e8e
     }
a85e8e
 
a85e8e
   return path;
a85e8e
-- 
a85e8e
2.13.0
a85e8e