dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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