mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
* grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Support NVMe device names.
This commit is contained in:
1 parent
4afd0107ef
commit
9706066791
2 files changed
+22
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user