[1973] 2009-02-04 Felix Zielcke <[email protected]>

Felix Zielcke <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 1973
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=1973
Author:   fzielcke
Date:     2009-02-04 10:52:25 +0000 (Wed, 04 Feb 2009)

Log Message:
-----------
2009-02-04  Felix Zielcke  <[email protected]>

	util/getroot.c (grub_util_get_grub_dev): Add support for /dev/mdNpN and
	/dev/md/NpN style mdraid devices.

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

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-02-03 22:33:45 UTC (rev 1972)
+++ trunk/grub2/ChangeLog	2009-02-04 10:52:25 UTC (rev 1973)
@@ -1,3 +1,8 @@
+2009-02-04  Felix Zielcke  <[email protected]>
+
+	util/getroot.c (grub_util_get_grub_dev): Add support for /dev/mdNpN and
+	/dev/md/NpN style mdraid devices.
+
 2009-02-03  Felix Zielcke  <[email protected]>
 
 	* util/unifont2pff.rb: Remove.

Modified: trunk/grub2/util/getroot.c
===================================================================
--- trunk/grub2/util/getroot.c	2009-02-03 22:33:45 UTC (rev 1972)
+++ trunk/grub2/util/getroot.c	2009-02-04 10:52:25 UTC (rev 1973)
@@ -470,11 +470,29 @@
 	}
       else if (os_dev[7] >= '0' && os_dev[7] <= '9')
 	{
-	  asprintf (&grub_dev, "md%s", os_dev + sizeof ("/dev/md") - 1);
+	  char *p , *q;
+
+	  p = strdup (os_dev + sizeof ("/dev/md") - 1);
+
+	  q = strchr (p, 'p');
+	  if (q)
+	    *q = ',';
+
+	  asprintf (&grub_dev, "md%s", p);
+	  free (p);
 	}
       else if (os_dev[7] == '/' && os_dev[8] >= '0' && os_dev[8] <= '9')
 	{
-	  asprintf (&grub_dev, "md%s", os_dev + sizeof ("/dev/md/") - 1);
+	  char *p , *q;
+
+	  p = strdup (os_dev + sizeof ("/dev/md/") - 1);
+
+	  q = strchr (p, 'p');
+	  if (q)
+	    *q = ',';
+
+	  asprintf (&grub_dev, "md%s", p);
+	  free (p);
 	}
       else
 	grub_util_error ("Unknown kind of RAID device `%s'", os_dev);
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.