2008-12-28 Felix Zielcke <fzielcke@z-51.de>

* util/getroot.c (grub_util_get_grub_dev): Add support for
	/dev/md/dNNpNN style partitionable mdraid devices.
This commit is contained in:
fzielcke 2008-12-28 16:20:30 +00:00
parent 3ced05cf17
commit 278922e80b
2 changed files with 22 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2008-12-28 Felix Zielcke <fzielcke@z-51.de>
* util/getroot.c (grub_util_get_grub_dev): Add support for
/dev/md/dNNpNN style partitionable mdraid devices.
2008-12-12 Alex Smith <alex@alex-smith.me.uk> 2008-12-12 Alex Smith <alex@alex-smith.me.uk>
* fs/i386/pc/pxe.c (grub_pxefs_open): Handle the one open connection * fs/i386/pc/pxe.c (grub_pxefs_open): Handle the one open connection

View file

@ -441,11 +441,26 @@ grub_util_get_grub_dev (const char *os_dev)
if (os_dev[7] == '_' && os_dev[8] == 'd') if (os_dev[7] == '_' && os_dev[8] == 'd')
{ {
/* This a partitionable RAID device of the form /dev/md_dNNpMM. */ /* 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); 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] == '/' && 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'); q = strchr (p, 'p');
if (q) if (q)
*q = ','; *q = ',';