dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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