summaryrefslogtreecommitdiff
path: root/cgpt/cgpt_wrapper.c
Commit message (Collapse)AuthorAgeFilesLines
* vboot: Remove the remainder of vb1 cryptolibRandall Spangler2016-11-061-1/+0
| | | | | | | | | | | | | | | At this point, all that's left are a few constants in the cryptolib header files, and they're only used by host-side code. So move them to a host-side header file and get rid of cryptolib. BUG=chromium:611535 BRANCH=none TEST=make runtests; emerge-kevin coreboot depthcharge Change-Id: I2235f0e84e13fef313afe54e749b73744b157884 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/400903 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Fix more coverity warnings in utilitiesRandall Spangler2016-09-151-3/+13
| | | | | | | | | | | | | | Assorted minor code issues, which we should fix so any new errors stand out more. BUG=chromium:643769 BRANCH=none TEST=make runtests Change-Id: I8fcf0c51e33d5dc49f650f4069f1579091cf188d Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/383713 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* vboot: Convert vboot1 SHA calls to use vboot2Randall Spangler2016-07-221-8/+15
| | | | | | | | | | | | | | | | | | This change replaces all calls to the old vboot1 SHA library with their vboot2 equivalents. This is the first in a long series of changes to move the core vboot kernel verification into vb2, and the control/display loop out to depthcharge. BUG=chromium:611535 BRANCH=none TEST=make runtests; build samus firmware and boot it Change-Id: I31986eb766176c0e39a192c5ce15730471c3cf94 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/344342 Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* include sys/sysmacros.h for major()Mike Frysinger2016-04-201-0/+1
| | | | | | | | | | | | | | | | The major() func is defined in the sys/sysmacros.h header, so include it explicitly for the prototype. Upstream C libs are moving away from having sys/types.h include it all the time implicitly. BUG=None TEST=precq passes BRANCH=None Change-Id: I56b84138f08ded2376193403f9c9db22c5f24f71 Reviewed-on: https://chromium-review.googlesource.com/339680 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Bill Richardson <wfrichar@google.com>
* cgpt_wrapper: Print error if execv() fails.Alex Deymo2015-02-231-1/+5
| | | | | | | | | | | | | | | | | | This shows an error message when cgpt.bin failed to run, with its reason. Without this patch, "cgpt" would just fail and return -1 in that case making it difficult to know the reason of the failure. BUG=chrome-os-partner:36061 TEST=replaced this binary in storm recovery initramfs 6699.0.0 and it shows the error message if cgpt.bin is not installed. BRANCH=None Change-Id: I3ffaba5a63c491ac7d5b16086d5ae21005f40317 Reviewed-on: https://chromium-review.googlesource.com/251868 Reviewed-by: Alex Deymo <deymo@chromium.org> Commit-Queue: Alex Deymo <deymo@chromium.org> Trybot-Ready: Alex Deymo <deymo@chromium.org> Tested-by: Alex Deymo <deymo@chromium.org>
* cgpt_wrapper: Fix non-zero return code when okayNam T. Nguyen2015-01-271-3/+4
| | | | | | | | | | | | | | | | I forgot to reset "ret" to zero in the case the two hashes come out the same. This CL fixes that silly logic bug. BUG=None BRANCH=None TEST=`cgpt show /dev/mtd0` should exit with status 0 Change-Id: I1c64ea215c861c8afb44e235d090c72a5d006d55 Reviewed-on: https://chromium-review.googlesource.com/243325 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Queue: Nam Nguyen <namnguyen@chromium.org> Trybot-Ready: Nam Nguyen <namnguyen@chromium.org> Tested-by: Nam Nguyen <namnguyen@chromium.org>
* cgpt_wrapper: Resolve the path to "cgpt" commandNam T. Nguyen2015-01-221-0/+17
| | | | | | | | | | | | | | | | Because we do not use "execvp", "cgpt.bin" is not resolved to the same directory as "cgpt". So we need to resolve the original command to its absolute path first, then append ".bin" to it. BUG=None BRANCH=None TEST="cgpt" no longer fails. Change-Id: Id22c2d97616867125e9744c00bbf527f8a176df4 Reviewed-on: https://chromium-review.googlesource.com/242294 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Nam Nguyen <namnguyen@chromium.org> Commit-Queue: Nam Nguyen <namnguyen@google.com>
* cgpt_wrapper: Only write rw_gpt back if changedNam T. Nguyen2015-01-221-2/+12
| | | | | | | | | | | | | | | | We always wrote back the rw_gpt file to NOR flash. This operation is too slow. This CL compares if the original file has been changed by cgpt.bin before writing the file back to NOR. BUG=None BRANCH=None TEST=/usr/bin/cgpt show /dev/mtd0 now does not write back to NOR Change-Id: I4c63f0d4da72f3674e06a896fa329f5fc964a885 Reviewed-on: https://chromium-review.googlesource.com/242293 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Nam Nguyen <namnguyen@chromium.org> Commit-Queue: Nam Nguyen <namnguyen@google.com>
* Add cgpt_wrapper binary to transparently support NANDNam T. Nguyen2015-01-171-0/+147
This CL adds a "cgpt_wrapper" binary that will forward to "cgpt" binary as needed to transparently support NAND. The idea is that if we are working with an MTD device, this binary will exec out to "flashrom" to read in the GPT section, then exec out to the actual "cgpt" binary to work on that file, and finally write it back with "flashrom". This CL introduces a make target "install_mtd" to install this wrapper. The corresponding ebuild should use this make target when "mtd" USE flag is on. BUG=chromium:442518 BRANCH=none CQ-DEPEND=CL:239573 TEST=unittest and some trial runs with mtdram TEST=test on a real device with NOR flash and NAND Change-Id: I54534afa9a970ec858f313f698c0eb210c827477 Reviewed-on: https://chromium-review.googlesource.com/239580 Tested-by: Nam Nguyen <namnguyen@chromium.org> Reviewed-by: Daniel Ehrenberg <dehrenberg@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Queue: Nam Nguyen <namnguyen@chromium.org>