* grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Support NVMe device names.

This commit is contained in:
Vladimir Serbinenko 2014-04-03 21:31:12 +02:00
parent 4afd0107ef
commit 9706066791
2 changed files with 22 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2014-04-03 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Support NVMe
device names.
2014-03-31 Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
btrfs: fix get_root key comparison failures due to endianness

View file

@ -896,6 +896,23 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st,
*pp = '\0';
return path;
}
/* If this is a NVMe device */
if ((strncmp ("nvme", p, 4) == 0) && p[4] >= '0' && p[4] <= '9')
{
char *pp = p + 4;
while (*pp >= '0' && *pp <= '9')
pp++;
if (*pp == 'n')
pp++;
while (*pp >= '0' && *pp <= '9')
pp++;
if (*pp == 'p')
*is_part = 1;
/* /dev/nvme[0-9]+n[0-9]+p[0-9]* */
*pp = '\0';
return path;
}
}
return path;