summaryrefslogtreecommitdiff
path: root/host/include/cgpt_params.h
diff options
context:
space:
mode:
authorNam T. Nguyen <namnguyen@chromium.org>2015-01-21 09:40:17 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-01-22 21:14:18 +0000
commit549205787527d85dead8968af7a1e1064cafa00e (patch)
treea83e80bac3fa6bdfe5e2f7b09a60a221963b1b99 /host/include/cgpt_params.h
parent004851f6612d15e8b958f911550eeb2b208773b3 (diff)
downloadvboot-549205787527d85dead8968af7a1e1064cafa00e.tar.gz
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 <wfrichar@chromium.org> Tested-by: Nam Nguyen <namnguyen@chromium.org> Commit-Queue: Nam Nguyen <namnguyen@google.com>
Diffstat (limited to 'host/include/cgpt_params.h')
-rw-r--r--host/include/cgpt_params.h7
1 files changed, 7 insertions, 0 deletions
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 {