dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

28f7f8
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
39700a
From: Mike Gilbert <floppym@gentoo.org>
39700a
Date: Sun, 26 Jan 2014 02:56:04 +0100
28f7f8
Subject: [PATCH] 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
 grub-core/osdep/linux/getroot.c | 13 +++++++++++++
28f7f8
 ChangeLog                       |  7 +++++++
39700a
 2 files changed, 20 insertions(+)
39700a
39700a
diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c
28f7f8
index 772de0a9bc4..19581d32997 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;
28f7f8
diff --git a/ChangeLog b/ChangeLog
28f7f8
index 67b4d5c2add..bbec1e70bbd 100644
28f7f8
--- a/ChangeLog
28f7f8
+++ b/ChangeLog
28f7f8
@@ -1,3 +1,10 @@
28f7f8
+2014-01-26  Mike Gilbert <floppym@gentoo.org>
28f7f8
+
28f7f8
+	grub-install: support for partitioned partx loop devices.
28f7f8
+
28f7f8
+	* grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Detect
28f7f8
+	/dev/loopX as being the parent of /dev/loopXpY.
28f7f8
+
28f7f8
 2014-01-26  Vladimir Serbinenko  <phcoder@gmail.com>
28f7f8
 
28f7f8
 	* grub-core/term/serial.c (grub_serial_register): Fix invalid free.