summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cgpt/cgpt_find.c10
-rwxr-xr-xutility/dev_debug_vboot2
2 files changed, 10 insertions, 2 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) {
diff --git a/utility/dev_debug_vboot b/utility/dev_debug_vboot
index 890bfe1f..51ca8c53 100755
--- a/utility/dev_debug_vboot
+++ b/utility/dev_debug_vboot
@@ -274,7 +274,7 @@ log crossystem --all
log rootdev -s
log ls -aCF /root
log ls -aCF /mnt/stateful_partition
-devs=$(awk '/(mmcblk[0-9])$|(sd[a-z])$/ {print "/dev/"$4}' /proc/partitions)
+devs=$(awk '/(mmcblk[0-9])$|(sd[a-z])$|(nvme[0-9]+n[0-9]+)$/ {print "/dev/"$4}' /proc/partitions)
for d in $devs; do
log cgpt show $d
done