dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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