diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2016-10-13 13:18:37 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-10-21 21:20:46 -0700 |
commit | 08d56aa7a7df69e80aa0a1fd6e847aa1adde5f9c (patch) | |
tree | 21a6df7fca0e5382ee9040d5102566f71221a3ac /cgpt | |
parent | ea72ee454aea5e0f378275fe7114cf683b7db938 (diff) | |
download | vboot-08d56aa7a7df69e80aa0a1fd6e847aa1adde5f9c.tar.gz |
cgpt: Add support for NVMe
find: A p is added betwen device name and partition whenever the last
character of a device is a number, as written in disk_name() in kernel
block/partition-generic.c file.
debug_vboot: Add regex for nvme device.
BUG=chromium:655192
BRANCH=none
TEST=Check that when a machine boots from NVMe, chromeos-setgoodkernel
set "successful" field properly.
Run " dev_debug_vboot --cleanup", check the NVMe device kernel
partitions are verified.
Change-Id: I6a9342c95500fa582f51f06e48c1ff90684c2a27
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/398338
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Diffstat (limited to 'cgpt')
-rw-r--r-- | cgpt/cgpt_find.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cgpt/cgpt_find.c b/cgpt/cgpt_find.c index c099a9c4..c35aade2 100644 --- a/cgpt/cgpt_find.c +++ b/cgpt/cgpt_find.c @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <ctype.h> #include <string.h> #include <sys/stat.h> #include <sys/types.h> @@ -74,7 +75,14 @@ static int match_content(CgptFindParams *params, struct drive *drive, static void showmatch(CgptFindParams *params, char *filename, int partnum, GptEntry *entry) { char * format = "%s%d\n"; - if (strncmp("/dev/mmcblk", filename, 11) == 0) + + /* + * Follow convention from disk_name() in kernel block/partition-generic.c + * code: + * If the last digit of the device name is a number, add a 'p' between the + * device name and the partition number. + */ + if (isdigit(filename[strlen(filename) - 1])) format = "%sp%d\n"; if (params->numeric) { |