diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c index 19581d3..7007193 100644 --- a/grub-core/osdep/linux/getroot.c +++ b/grub-core/osdep/linux/getroot.c @@ -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; -- cgit v0.9.0.2