From 250549d3e742cddaf72b4f53d5739e54faf5db96 Mon Sep 17 00:00:00 2001 From: Jay Srinivasan Date: Thu, 16 Feb 2012 17:40:45 -0800 Subject: Implementation of CgptManager C++ library and unit tests. CgptManager exposes the cgpt commands via a C++ library so that the post-installer for 32- to 64-bit upgrade can link directly against a library and thus avoid any shell dependency. The default make target will not build libcgpt-cc.a since it requires some dependencies that are available only in chroot. A separate follow-up checkin to the vboot_reference ebuild will enable emerging the libcgpt-cc.a by default. BUG=chromium-os:25374 TEST=Tested with the new unit tests for CgptManager, ran existing cgpt unit tests, as well as running the cgpt commands manually. Built on both amd64 and x86. Tested that vboot_reference is also buildable outside of chroot. Tested that vboot_reference-firmware and vboot_reference-tests also build fine with these changes. CQ-DEPEND=I99f6c321e09c2425eaa8171d78685d2d731954c8 Change-Id: I59a896255b8ea2fc8b1b2150ae7c4ff9d0769699 Reviewed-on: https://gerrit.chromium.org/gerrit/15730 Reviewed-by: Bill Richardson Reviewed-by: Gaurav Shah Commit-Ready: Jay Srinivasan Tested-by: Jay Srinivasan --- cgpt/cgpt_find.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cgpt/cgpt_find.c') diff --git a/cgpt/cgpt_find.c b/cgpt/cgpt_find.c index 30d0e8b0..20070209 100644 --- a/cgpt/cgpt_find.c +++ b/cgpt/cgpt_find.c @@ -17,7 +17,7 @@ // fill comparebuf with the data to be examined, returning true on success. -static int FillBuffer(CgptFindParams *params, int fd, uint64_t pos, +static int FillBuffer(CgptFindParams *params, int fd, uint64_t pos, uint64_t count) { uint8_t *bufptr = params->comparebuf; @@ -38,7 +38,7 @@ static int FillBuffer(CgptFindParams *params, int fd, uint64_t pos, } // check partition data content. return true for match, 0 for no match or error -static int match_content(CgptFindParams *params, struct drive *drive, +static int match_content(CgptFindParams *params, struct drive *drive, GptEntry *entry) { uint64_t part_size; @@ -70,7 +70,7 @@ static int match_content(CgptFindParams *params, struct drive *drive, } // This needs to handle /dev/mmcblk0 -> /dev/mmcblk0p3, /dev/sda -> /dev/sda3 -static void showmatch(CgptFindParams *params, char *filename, +static void showmatch(CgptFindParams *params, char *filename, int partnum, GptEntry *entry) { char * format = "%s%d\n"; if (strncmp("/dev/mmcblk", filename, 11) == 0) @@ -217,8 +217,8 @@ void cgpt_find(CgptFindParams *params) { if (params == NULL) return; - if (params->driveName != NULL) - do_search(params, params->driveName); + if (params->drive_name != NULL) + do_search(params, params->drive_name); else scan_real_devs(params); } -- cgit v1.2.1