dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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