summaryrefslogtreecommitdiff
path: root/firmware/lib/cgptlib/include/cgptlib.h
Commit message (Collapse)AuthorAgeFilesLines
* vboot: replace sysincludes.h with 2sysincludes.hJoel Kitching2019-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | sysincludes.h and 2sysincludes.h are almost identical except for one extra header (ctype.h) in the vboot1 variant. Add this to 2sysincludes.h, and nuke sysincludes.h. Depends on: https://review.coreboot.org/c/coreboot/+/33525 BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: Iaba21a9b8bb2ae0c081184019576663898317bd1 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:1680325 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1659990 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Auto-Submit: Joel Kitching <kitching@chromium.org>
* cgptlib: Add functions to cgptlib APIFurquan Shaikh2015-01-241-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following changes are done to the cgptlib API in order to allow backend component of fastboot to perform erase and write operations on partitions and manipulate GPT entries: GptFindNthEntry - Returns the nth entry in GPT that matches provided GUID. GptGetEntrySizeLba - Returns size of a partition in lba. GptGetEntrySizeBytes - Returns size of a partition in bytes. GptUpdateKernelWithEntry - Given kernel entry is updated using the provided update_type. GptUpdateKernelEntry calls this function with entry for current_kernel. Add flags GPT_UPDATE_ENTRY_RESET and GPT_UPDATE_ENTRY_INVALID for calls to GptUpdateKernelEntry. These operations are used by write image and erase partition respectively. BUG=chrome-os-partner:35861 BRANCH=None TEST=Compiles successfully and all the newly added functions work as expected. Change-Id: I82c87e4c97de2d207e80209dbd4922b4bcd5880a Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/240268 Trybot-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Commit-Queue: Furquan Shaikh <furquan@chromium.org>
* cgpt: Separate out certain GPT manipluation functionsstabilize-6415.Bfoo-testDan Ehrenberg2014-10-291-104/+1
| | | | | | | | | | | | | | | | | For kernel NAND support, some vboot/cgptlib functionality is needed from depthcharge. This patch moves certain function declarations to a new header in firmware/include and puts their definitions in a common place. TEST=make runalltests passes and packages build BRANCH=none BUG=chromium:403432 Change-Id: Idd42b1f9f531651d78bb4afb80ca90c24aae93d9 Reviewed-on: https://chromium-review.googlesource.com/224996 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Queue: Daniel Ehrenberg <dehrenberg@chromium.org> Tested-by: Daniel Ehrenberg <dehrenberg@chromium.org>
* Implement cgptlib for MTD devices.Albert Chaulk2013-05-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Defines MTD on-disk structures & API in mtdlib.h/c that closely mirrors the existing cgpt implementation. Currently, the disk structures do not contain guids or labels, and the number of available partition types and quantities are limited, exactly what we want to support should be decided before we ship this. Adds appropriate test coverage to the unit test library - either by modifying existing tests, or copying them and changing them accordingly. BUG=chromium:221745 TEST=added appropriate tests to the unittests BRANCH=none Change-Id: Iee19864498024c72229bc3c7811594fe762f52de Original-Change-Id: I031eca69d6c8e825b02bd0522d57e92b05eb191a Reviewed-on: https://gerrit.chromium.org/gerrit/46082 Tested-by: Albert Chaulk <achaulk@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Albert Chaulk <achaulk@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48793 Reviewed-by: Albert Chaulk <achaulk@chromium.org>
* Reformat cgptlib to kernel styleRandall Spangler2013-01-311-63/+76
| | | | | | | | | | | | | No code changes, just reformatting. BUG=none BRANCH=none TEST=make runtests Change-Id: Ib8748df93c64395c88e1f789805393fcfe3ac419 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42397 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Improve coverage of cgptlib.cRandall Spangler2013-01-241-1/+3
| | | | | | | | | | | BUG=chromium-os:38139 BRANCH=none TEST=make runtests Change-Id: I5719c6b8aa1a23fc65bf38d7096320479152f0ca Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/41955 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Make cgpt_add error messages a little more verboseVadim Bendebury2012-09-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | When the cgpt utility complaints about parameter errors, it is impossible to tell what exactly went wrong. This change consolidates error definitions and adds a function to convert integer error values into text messages. BRANCH=none BUG=none TEST=manual . emerge-link vbooot_reference . copy generated `cgpt' to a Link device . run command with wrong arguments with respect to the existing GPT: localhost var # ./cgpt add -i 3 -b 3985408 -s 1757184 -t rootfs -l ROOT-A /dev/sda ERROR: cgpt add: Starting LBA overlaps ERROR: cgpt add: -i 3 -l ROOT-A -b 3985408 -s 1757184 -t 3CB8E202-3B7E-47DD-8A3C-7FF2A13CFCEC . on the host, in the chroot in src/platform/vboot_reference run $ make && make runtests observe all tests succeed Change-Id: Ibd23ca0430a875f70524adc99e0509b26ae699b2 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34003 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Change debug messages to use 1-based GPT partition numbers.Bill Richardson2011-09-081-1/+4
| | | | | | | | | | BUG=none TEST=none Change-Id: Ib717f1008edbb6c11d73fbe42d533ebe45800a45 Reviewed-on: http://gerrit.chromium.org/gerrit/7410 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org>
* Remove unused files, and tidy the directory structure of the remaining ones.Randall Spangler2010-06-171-0/+115
Review URL: http://codereview.chromium.org/2815011