From ab899591808dd3e5f955ab7693b54a83389cd35f Mon Sep 17 00:00:00 2001 From: "Nam T. Nguyen" Date: Thu, 13 Nov 2014 19:30:46 -0800 Subject: vboot: cgpt: Treat drive_path as the GPT storage Previously, "cgpt" called out to "flashrom" directly to read and write NOR area. This CL removes that dependency and always treats "drive_path" as the storage of GPT structs. This makes it consistent that whatever device that cgpt reads from or writes to is always the device that stores GPT structs. We only need to pass in the size of the drive that contains the partitions, but we do not need to access to that drive. More information is in the bug. BUG=chromium:432611 BRANCH=none TEST=unittest CQ-DEPEND=CL:228942 Change-Id: Id0139adf70463cec4f2924de8b9a4725dbec822b Reviewed-on: https://chromium-review.googlesource.com/229736 Reviewed-by: Bill Richardson Commit-Queue: Nam Nguyen Tested-by: Nam Nguyen --- cgpt/cgpt_show.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cgpt/cgpt_show.c') diff --git a/cgpt/cgpt_show.c b/cgpt/cgpt_show.c index 5b7974f7..32d62d38 100644 --- a/cgpt/cgpt_show.c +++ b/cgpt/cgpt_show.c @@ -482,7 +482,8 @@ int CgptShow(CgptShowParams *params) { if (params == NULL) return CGPT_FAILED; - if (CGPT_OK != DriveOpen(params->drive_name, &drive, O_RDONLY)) + if (CGPT_OK != DriveOpen(params->drive_name, &drive, O_RDONLY, + params->drive_size)) return CGPT_FAILED; if (drive.is_mtd) { -- cgit v1.2.1