diff --git a/ChangeLog b/ChangeLog index f3864223d..301346eb2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-12-28 Felix Zielcke + + * util/getroot.c (grub_util_get_grub_dev): Add support for + /dev/md/dNNpNN style partitionable mdraid devices. + 2008-12-12 Alex Smith * fs/i386/pc/pxe.c (grub_pxefs_open): Handle the one open connection diff --git a/util/getroot.c b/util/getroot.c index ae2a07556..ffb581da8 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -441,11 +441,26 @@ grub_util_get_grub_dev (const char *os_dev) 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'); + 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'); if (q) *q = ',';