From 549205787527d85dead8968af7a1e1064cafa00e Mon Sep 17 00:00:00 2001 From: "Nam T. Nguyen" Date: Wed, 21 Jan 2015 09:40:17 -0800 Subject: cgpt: Properly show ChromeOS-scheme MTD partitions When working on NAND, we do not actually work with one device name. We work on a temporary file instead. Moreover, depending on the type of the partition, we need to show different devices. BUG=None BRANCH=None TEST=All commands must be run on storm_nand TEST=/usr/bin/cgpt.bin find -t kernel should print out /dev/mtd2 TEST=/usr/bin/cgpt.bin find -t rootfs should print out /dev/ubiblock5_0 TEST=/usr/bin/cgpt.bin find -t data should print out /dev/ubi1_0 Change-Id: Ia36777ffa6a9cfc7c8ec4b128e49ece140428238 Reviewed-on: https://chromium-review.googlesource.com/242291 Reviewed-by: Bill Richardson Tested-by: Nam Nguyen Commit-Queue: Nam Nguyen --- host/include/cgpt_params.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'host/include/cgpt_params.h') diff --git a/host/include/cgpt_params.h b/host/include/cgpt_params.h index e7ac7327..97d89e6a 100644 --- a/host/include/cgpt_params.h +++ b/host/include/cgpt_params.h @@ -78,6 +78,9 @@ typedef struct CgptPrioritizeParams { int orig_priority; } CgptPrioritizeParams; +struct CgptFindParams; +typedef void (*CgptFindShowFn)(struct CgptFindParams *params, char *filename, + int partnum, GptEntry *entry); typedef struct CgptFindParams { char *drive_name; uint64_t drive_size; @@ -96,6 +99,10 @@ typedef struct CgptFindParams { char *label; int hits; int match_partnum; /* 1-based; 0 means no match */ + /* when working with MTD, we actually work on a temp file, but we still need + * to print the device name. so this parameter is here to properly show the + * correct device name in that special case. */ + CgptFindShowFn show_fn; } CgptFindParams; typedef struct CgptLegacyParams { -- cgit v1.2.1