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

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