[1935] 2008-12-28 Felix Zielcke <[email protected]>

Felix Zielcke <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 1935
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=1935
Author:   fzielcke
Date:     2008-12-28 16:20:30 +0000 (Sun, 28 Dec 2008)

Log Message:
-----------
2008-12-28  Felix Zielcke  <[email protected]>

	* util/getroot.c (grub_util_get_grub_dev): Add support for
	/dev/md/dNNpNN style partitionable mdraid devices.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/util/getroot.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2008-12-12 04:12:05 UTC (rev 1934)
+++ trunk/grub2/ChangeLog	2008-12-28 16:20:30 UTC (rev 1935)
@@ -1,3 +1,8 @@
+2008-12-28  Felix Zielcke  <[email protected]>
+
+	* util/getroot.c (grub_util_get_grub_dev): Add support for
+	/dev/md/dNNpNN style partitionable mdraid devices.
+
 2008-12-12  Alex Smith  <[email protected]>
 
 	* fs/i386/pc/pxe.c (grub_pxefs_open): Handle the one open connection

Modified: trunk/grub2/util/getroot.c
===================================================================
--- trunk/grub2/util/getroot.c	2008-12-12 04:12:05 UTC (rev 1934)
+++ trunk/grub2/util/getroot.c	2008-12-28 16:20:30 UTC (rev 1935)
@@ -441,9 +441,9 @@
       if (os_dev[7] == '_' && os_dev[8] == 'd')
 	{
 	  /* This a partitionable RAID device of the form /dev/md_dNNpMM. */
-	  
-	  char *p , *q;
 
+	  char *p, *q;
+
 	  p = strdup (os_dev + sizeof ("/dev/md_d") - 1);
 
 	  q = strchr (p, 'p');
@@ -453,6 +453,21 @@
 	  asprintf (&grub_dev, "md%s", p);
 	  free (p);
 	}
+      else if (os_dev[7] == '/' && os_dev[8] == 'd')
+	{
+	  /* This a partitionable RAID device of the form /dev/md/dNNpMM. */
+
+	  char *p, *q;
+
+	  p = strdup (os_dev + sizeof ("/dev/md/d") - 1);
+
+	  q = strchr (p, 'p');
+	  if (q)
+	    *q = ',';
+
+	  asprintf (&grub_dev, "md%s", p);
+	  free (p);
+	}
       else if (os_dev[7] >= '0' && os_dev[7] <= '9')
 	{
 	  asprintf (&grub_dev, "md%s", os_dev + sizeof ("/dev/md") - 1);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.