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

d41074
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
a85e8e
From: Mike Gilbert <floppym@gentoo.org>
a85e8e
Date: Sun, 26 Jan 2014 02:56:04 +0100
d41074
Subject: [PATCH] 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
 grub-core/osdep/linux/getroot.c | 13 +++++++++++++
d41074
 ChangeLog                       |  7 +++++++
a85e8e
 2 files changed, 20 insertions(+)
a85e8e
a85e8e
diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c
d41074
index 772de0a9bc4..19581d32997 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;
d41074
diff --git a/ChangeLog b/ChangeLog
d41074
index 67b4d5c2add..bbec1e70bbd 100644
d41074
--- a/ChangeLog
d41074
+++ b/ChangeLog
d41074
@@ -1,3 +1,10 @@
d41074
+2014-01-26  Mike Gilbert <floppym@gentoo.org>
d41074
+
d41074
+	grub-install: support for partitioned partx loop devices.
d41074
+
d41074
+	* grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Detect
d41074
+	/dev/loopX as being the parent of /dev/loopXpY.
d41074
+
d41074
 2014-01-26  Vladimir Serbinenko  <phcoder@gmail.com>
d41074
 
d41074
 	* grub-core/term/serial.c (grub_serial_register): Fix invalid free.