summaryrefslogtreecommitdiff
path: root/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* vboot: remove obsolete COPY_BMP_DATAJoel Kitching2019-08-271-5/+0
| | | | | | | | | | | | | | | No longer relevant with GBB refactor. BUG=b:124141368, chromium:954774 TEST=make clean && make runtests BRANCH=none Change-Id: I84479ae3bd8a936728d83d7937f4981ef6a37247 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1763972 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* Makefile: Add -Wno-unknown-warningJulius Werner2019-08-261-2/+2
| | | | | | | | | | | | | | | | | We need to disable some warnings that only exist for clang, but we don't want GCC to choke on them with "unrecognized command line option" either. We still want external users to be able to build vboot (even host utilities) with GCC if they prefer. Therefore, add -Wno-unknown-warning to prevent GCC from choking. BRANCH=None BUG=chromium:991812 TEST=make runtests Change-Id: I753bd4c1240d5064a815e3f1d019ad3b67d686a2 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1772177 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Makefile: Enable -Wimplicit-fallthroughJacob Garber2019-08-241-1/+1
| | | | | | | | | | | | | | | | | | Implicit fallthroughs are always a source of trouble, so let's get the compiler to catch them for us. Intentional fallthroughs can be marked using the /* fall through */ comment to silence this warning. BUG=none TEST=make clean && make runtests BRANCH=none Change-Id: I66a9edc810674a732c0530cd78b5aa8a2c37f562 Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1742640 Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org>
* vboot_reference: Fix building with fuzzer builds.stabilize-12441.BManoj Gupta2019-08-201-6/+8
| | | | | | | | | | | | | | | | | vboot_reference builds most tools as static but address sanitizer does not support static linking. Put more tools under NO_BUILD_TOOLS condition (set only in fuzzer builders) to make fuzzer builders happy. BUG=chromium:995340 TEST=USE="asan fuzzer" emerge-amd64-generic vboot_reference works. Change-Id: I76beffb10744c8d9c5b6b4a50e971f1332113491 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1761012 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Dhanya Ganesh <dhanyaganesh@chromium.org>
* Makefile: Enable linker garbage collectionJulius Werner2019-08-161-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables -ffunction-sections, -fdata-sections and -Wl,--gc-sections for host builds. These flags already get passed by firmware builds anyway, so having host builds match that behavior should be a good idea in general. They may also occasionally help save a bit of code size (though not much since vboot is a library, but I still get about half a KB out of futility), and they will prevent clang from omitting relocations for function calls inside the same file, which means we don't have to splatter test_mockable all over our codebase anymore. (We still need it for vb2_get_gbb() since that is so small that both GCC and clang want to inline it, even if they are outputting a discrete copy anyway.) (Also add a comment about why GenerateGuid() has nothing do to with this even though it is also a weak function, and why it is like that.) BRANCH=None BUG=chromium:991812 TEST=make runtests with both GCC and clang Change-Id: Iede9d29e20b99b75a0c86bc7ecb907d2a0e5e3a1 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1754969 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Minor fixes for clangJulius Werner2019-08-091-1/+2
| | | | | | | | | | | | | | | | | | We want to switch over from GCC to clang for userspace utilities. It comes with a new default warning that we happen to trigger, so silence that. It also comes with a dumb reachability checker that can't tell when the use of one variable is guarded by another, so need to unnecessarily initialize a variable in load_kernel_test. BRANCH=none BUG=chromium:991812 TEST=Built for Kevin with clang. Change-Id: If9fc391ade0243aea1cae8d682e31390dc082f77 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1744667 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot: remove Boot Descriptor Block (BDB) library and utilitiesJoel Kitching2019-07-241-76/+7
| | | | | | | | | | | | | | | | Remove unused BDB code, previously created for a cancelled SoC project. BUG=b:124141368, chromium:986177 TEST=make clean && make runtests BRANCH=none Change-Id: I91faf97d9850f8afb816fa324ad9a4d9f3842888 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1710336 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot: replace Min macro with VB2_MINstabilize-12331.BJoel Kitching2019-07-061-2/+0
| | | | | | | | | | | | | | | | Replace old vboot1-style Min macro with VB2_MIN, and relocate tests accordingly. BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: I73d630147eaf23f97dd750769fb1e911dae01848 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1675866 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* futility: drop mtd support via android_mtdutilsMike Frysinger2019-06-261-5/+0
| | | | | | | | | | | | | | | No one is using this, so drop the dependency. BUG=chromium:978563 TEST=cq passes BRANCH=None Change-Id: I50595675f7f24f8af06a5a8ec3de21690e2ecb34 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1677105 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
* vboot: rewrite GBB functions and APIJoel Kitching2019-06-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Old vboot1-style GBB accessor functions were awkwardly located within region-init.c. Rewrite GBB accessor functions for vboot2, and formally expose HWID retrieval function via vboot2 API. workbuf is used for key retrieval functions, while a buffer provided by the caller is used for HWID retrieval function. Reintroduce vboot_display_tests to `make runtests` test suite. Move GBB tests from vboot_display_tests to vb2_gbb_tests. Properly propagate vb2_workbuf objects within the function call stack (vb2_load_partition). BUG=b:124141368, chromium:954774 TEST=Build and flash to eve, check that Chrome OS boots TEST=Build with CL:1627469 applied, check HWID TEST=make clean && make runtests BRANCH=none Change-Id: I398d1329f0b092de35aac73d98dfd9aee6e4e7de Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1584488 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Jason Clinton <jclinton@chromium.org>
* vboot: move vb2_packed_key and several functions from lib20 to 2libJoel Kitching2019-06-071-0/+1
| | | | | | | | | | | | | | | | | | | * Move vb2_packed_key from vb2_struct.h to 2struct.h * Move vb2_verify_member_inside from lib20/common.c to 2common.c * Move vb2_packed_key_data and vb2_verify_packed_key_inside from lib20/packed_key.c to 2packed_key.c * Relocate tests accordingly BUG=b:124141368, chromium:968464 TEST=make clean && make runtests BRANCH=none Change-Id: I6a9338ffdb640aad071941c3768427e15cd2aa93 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1642773 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* Makefile: Enable more warnings for host utilities / testsJulius Werner2019-05-141-15/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a bunch of more warnings that are already enabled in coreboot and thus already enabled for firmware builds anyway (because coreboot just passes its CFLAGS through). Enabling it in the vboot Makefile means they also apply to host utilities and tests, which sounds desirable for consistency. Fix enough of the cruft and bad coding practices that accumulated over the years of not having warnings enabled to get it to build again (this includes making functions static, removing dead code, cleaning up prototypes, etc.). Also remove -fno-strict-aliasing from the x86 firmware build options, because it's not clear why it's there (coreboot isn't doing this, so presumably it's not needed). BRANCH=None BUG=None TEST=make runtests Change-Id: Ie4a42083c4770a4eca133b22725be9ba85b24184 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1598721 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
* utility: Remove efi(de)compressJulius Werner2019-05-141-3/+0
| | | | | | | | | | | | | | | These utilities used to be a bmpblk dependency way back in the day. Now that bmpblk utilities have been removed, we don't need them anymore. BRANCH=None BUG=None TEST=make runtests Change-Id: I73b77b853dc03a7c867b8726de3cdeb01314916e Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1601677 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Joel Kitching <kitching@chromium.org>
* Remove code for displaying screen from GBBDaisuke Nojiri2019-05-071-26/+1
| | | | | | | | | | | | | | | | | | | This patch removes the code displaying vboot screens using bitmap and layout data stored in GBB. bmpblk_utility, and futility support for BmpBlock is also removed. BUG=chromium:622501,chrome-os-partner:54619,b:124141368 BRANCH=none CQ-DEPEND=CL:373123 TEST=Verified screens on eve && emerge-eve chromeos-bootimage && make runtests Change-Id: I1a8dd8ff0162965e81df121d5a87ea64310a0854 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/367882 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
* build: Evaluate YAML_LIBS and LZMA_LIBS lazilyPatrick Georgi2019-04-131-2/+2
| | | | | | | | | | | | | | | No need to check for a package that is only needed for a few targets. BUG=chromium:683381 TEST=no more "Package yaml-0.1 was not found in the pkg-config search path." when emerge'ing sys-boot/coreboot Change-Id: I56cacea59d9ac13ee3ba587e475e1ff451e535a9 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/1564472 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: remove tinyhostlib from MakefileJoel Kitching2019-03-281-35/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vboot Makefile contains a target library called libtinyvboot_host.a, and claims it is used by autoupdate installer since it must sometimes be a 32-bit executable. (See CL:44442.) As far as I can tell, this lib is no longer used, and we can safely remove it: (1) I don't see any mention of this file in any repo's git history: $ repo list | sed -e 's@ :.*@@' | while read dir; do ( cd $dir; out=`git --no-pager log --no-renames -p -Svboot_host | grep tinyvboot_host`; [ -z "$out" ] || echo "$dir\n$out" ); done; src/platform/vboot_reference +TINYHOSTLIB = ${BUILD}/libtinyvboot_host.a (2) The library doesn't get installed in vboot_reference's ebuild. BUG=b:124141368, chromium:440078 TEST=build vboot_reference BRANCH=none Change-Id: I0ff41f0596f911ac1d969bfabcdaab7fc2c883f7 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/1535459 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* vboot: add diagnostic modeMatt Delco2019-03-211-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds diagnostic mode. When enabled for a board (based on defconfig in depthcharge) the user can press Ctrl-C or F12 at a recovery mode screen, at which point an nv bit is set and the system reboots. Upon reboot, if the nv bit is set then the user is prompted to confirm launch of the diagnostic rom via the power button. If user confirms then the diagnostic payload is verified and run (if verify fails or payload doesn't run then a recovery reason is recorded and system reboots to recovery mode). If the user does not confirm then the system reboots. BUG=b:124358784 BRANCH=None TEST=Locally built and flashed using change that enabled feature for atlas and set to use payload 2 (tianocore) rather than 5 (diagnostic). Confirmed that Ctrl-C is functional or not based on defconfig and that Ctrl-C sets NV bit and reboots. Confirmed that NV bit can be set and queried via crossystem. Confirmed that during boot confirmation screen appears or not based on NV bit. Confirmed that pressing power button caused payload to be verified and run. Confirmed that non-matching hash (build configured to use sha1 rather than sha256) caused payload to not be run and system reboot to recovery. Confirmed that Esc or timeout caused system to reboot. CQ-DEPEND=CL:1471056 Change-Id: I8979d4eeb443bf64b727ee86a814c46d1d27ff37 Signed-off-by: Matt Delco <delco@google.com> Reviewed-on: https://chromium-review.googlesource.com/1470723 Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: Add ui for setting vendor data in VPDfirmware-atlas-11827.12.BMathew King2019-02-221-0/+9
| | | | | | | | | | | | | | | BUG=b:124297157 TEST=make runtest test on device BRANCH=none CQ-DEPEND=CL:1466822 Change-Id: Ic3b1b502b1aff14a795397da3024f8a12eb04775 Reviewed-on: https://chromium-review.googlesource.com/1466290 Commit-Ready: Mathew King <mathewk@chromium.org> Tested-by: Mathew King <mathewk@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Mathew King <mathewk@chromium.org>
* Add cgpt_find to libvboothostFletcher Woodruff2019-01-111-0/+3
| | | | | | | | | | | | | | | | Includes cgpt_find.c and some dependencies in the make rule for libvboothost so that they can be used by the new C++ clobber-state. BUG=chromium:884520 TEST=vboothost successfully builds BRANCH=none Change-Id: I4cedd7625c8dd905b4391de39477f42ad0dc4902 Reviewed-on: https://chromium-review.googlesource.com/1395811 Commit-Ready: Fletcher Woodruff <fletcherw@chromium.org> Tested-by: Fletcher Woodruff <fletcherw@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* cgpt: enable calling CgptEditMatt Delco2018-12-061-0/+2
| | | | | | | | | | | | | | | | | | | | | This change allows CgptEdit to be called via the API. Prior to this change link fails in an app that uses CgptEdit due to undefined reference. The underlying implementation wasn't checking set_unique so I've fixed that as well. BRANCH=none BUG=None TEST=Added CgptEdit(0) call to extern.c and verified that build failed. Added cgpt_edit.c to Makefile and confirmed that build is now successful. Successfully ran unit tests on both vboot_reference and the app I'm working on that calls CgptEdit (which also has a unit test for setting the drive ID). Change-Id: Ie0a46ff96406eb83d0564d3f1eac978e0565ed76 Signed-off-by: Matt Delco <delco@google.com> Reviewed-on: https://chromium-review.googlesource.com/1361948 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* Create a new file for common vboot UI functionsSimon Glass2018-11-011-0/+1
| | | | | | | | | | | | | | | | | Rather than having vboot_ui be the common file between that and vboot_ui_menu, create a new file. For now just move over vb2_error_beep(). The other common functions are being removed in future CLs. BUG=chromium:837018 BRANCH=none TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: Iff6917642ff79ea0b5cce60b383876b6f7174d20 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1310794 Reviewed-by: Julius Werner <jwerner@chromium.org>
* futility: updater: Add '--archive' to read from an archive or directoryHung-Te Lin2018-10-131-2/+14
| | | | | | | | | | | | | | | | | | | | | | A firmware update is usually released as a package with multiple images, instructions, signed vblocks and other files. To work with that, a new argument '--archive' is added. The --archive accepts a directory or file, and will determine the correct driver automatically. For resources (for example --image) in relative path, updater should find files from archive. Note in current implementation, only ZIP is supported for file type drivers (and need the system to have libzip already installed). BUG=chromium:875551 TEST=TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: I6a91cbe73fb4ee203c5fa4607f6651a39ba854d5 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1253229 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* futility: updater: Refactor: move quirks to 'updater_quirks.c'Hung-Te Lin2018-10-021-0/+1
| | | | | | | | | | | | | There will be more and more board-specific quirks in future and we want to put them together into a special module. BUG=chromium:875551 TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: I4fd2ff5e2b2e891cbd3da8c9393c6fbdf7024c75 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1245645
* futility: updater: Refactor: move command line processing to cmd_update.cHung-Te Lin2018-10-021-0/+1
| | | | | | | | | | | | | | Move the do_update back to cmd_update with better initialization. The update.c now has few APIs to invoke the firmware updater without relying command line processing. BUG=chromium:875551 TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: I99f792bf902ed72e487242ac8872aec384783555 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1245643
* futility: update: Refactor: move updater logic to 'updater.c'Hung-Te Lin2018-09-271-1/+1
| | | | | | | | | | | | | | | | | | The updater is getting more complicated and we may want to split into few modules, for example "updater", "quirks", and "host". The first step is to change cmd_update.c to updater.c (to preserve most GIT history). BUG=chromium:875551 TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: Icae37db8720162130cf38767fec14a970cc9899d Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1245642 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot_reference: set CC=armv7a-cros-linux-gnueabihf-gcc for ARMYunlian Jiang2018-09-261-1/+1
| | | | | | | | | | | | | | | We want to drop armv7a-cros-linux-gnueabi toolchain, so we need to use armv7a-cros-linux-gnueabihf-gcc instead. BRANCH=None BUG=chromium:711369 TEST=emerge-kevin vboot_reference Change-Id: Ie6831079162916eb11e98da3aecdcd8c0bd0d82d Reviewed-on: https://chromium-review.googlesource.com/1241856 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Yunlian Jiang <yunlian@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* futility: Remove FUTIL_STATIC build rulesHung-Te Lin2018-09-201-21/+13
| | | | | | | | | | | | | | | | After CL:1210342, the 'futility_s' is no longer needed so we may drop the related build rules. People who wants to build static version of futility can do: make STATIC=true futil BUG=chromium:765499 TEST=precq passes; make futil; make clean; make STATIC=1 futil BRANCH=none Change-Id: I80e83a80eaa273f09288f850c59a52494dc5bec9 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1235795 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* futility: drop static buildMike Frysinger2018-09-071-10/+3
| | | | | | | | | | | | | | We shouldn't need this anywhere anymore, so drop it. BUG=chromium:765499 TEST=precq passes BRANCH=none Change-Id: I0f1adb2bf120e1a20c79d2641a0d2fe96d8e6908 Reviewed-on: https://chromium-review.googlesource.com/1210342 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* futility: Add 'update' command for updating firmwareHung-Te Lin2018-08-311-0/+1
| | | | | | | | | | | | | | | | A reference firmware updater for all systems running vboot using FMAP for layout. The updater is currently a dummy implementation and will be completed with incoming changes. BUG=chromium:875551 TEST=make futil; build/futility/futility update; tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: I57bec91c178749b79a19789f9599f5f9048fced8 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1182701 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cgpt: add edit commandstabilize-nocturne-10986.Bstabilize-11021.84.Bstabilize-11020.Bstabilize-11005.Bstabilize-10985.Brelease-R70-11021.Bfirmware-servo-11011.Bfirmware-nocturne-10984.Bfactory-nocturne-10984.BMatt Delco2018-08-151-0/+2
| | | | | | | | | | | | | | | | This change adds a command to cgpt to change the GUID of the drive. BRANCH=none BUG=None TEST=Compiled and ran utility to verify that GUID changes. Also verified that the new and existing tests completed successfully. Change-Id: Ia8a815447509626312e2b06c6f293901290c73c3 Signed-off-by: Matt Delco <delco@google.com> Reviewed-on: https://chromium-review.googlesource.com/1171834 Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot_reference: fix the build for arm64stabilize-nocturne.10828.Bstabilize-nocturne.10819.Bstabilize-atlas.10819.BAdam Kallai2018-06-141-1/+1
| | | | | | | | | | | | | | | | | Add "arm64" support to Makefile to use crossystem_arch.c implementation from host/arm/lib directory, in order to avoid the code duplication. BUG=None TEST='emerge-arm64-generic vboot_reference' works correctly BRANCH=None Change-Id: I349f8b2055c9be6ebaeb6f322e3b22260465dd5a Reviewed-on: https://chromium-review.googlesource.com/1082195 Commit-Ready: Adam Kallai <kadam@inf.u-szeged.hu> Tested-by: Adam Kallai <kadam@inf.u-szeged.hu> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* stop statically linking crossystemMike Frysinger2018-05-311-3/+2
| | | | | | | | | | | | | | | | | Now that initramfs, firmware updater, and auto-updater are all using dynamically linked programs, there's no need to produce a static build of crossystem anymore. BUG=chromium:765499 TEST=precq passes (includes vmtests w/AU) BRANCH=None Change-Id: I5aa123e662040ff5d9f2328c0f036b648fc629fb Reviewed-on: https://chromium-review.googlesource.com/667881 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Don Garrett <dgarrett@chromium.org>
* vboot_reference: Build host tools conditionally.Manoj Gupta2018-05-161-1/+6
| | | | | | | | | | | | | | | | | Some of the tools and utilities in vboot_reference do not build with sanitizers enabled. To avoid this, do not build them when NO_BUILD_TOOLS is defined. CQ-DEPEND=CL:1060156 BUG=chromium:841588 TEST=USE="fuzzer" emerge-amd64-generic vboot_reference does not build host tools TEST=emerge-falco vboot_reference builds all tools. Change-Id: If238c98d4058db20765731237153bc6969a06375 Reviewed-on: https://chromium-review.googlesource.com/1060154 Commit-Ready: Manoj Gupta <manojgupta@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* tpm_lite: Implement TakeOwnership supportMattias Nissler2018-04-131-0/+4
| | | | | | | | | | | | | | | | | | Add the ability to take TPM ownership. This requires two new commands: TPM_OIAP to start an auth session and TPM_TakeOwnership to establish ownership. TPM_TakeOwnership requires an auth session and proper command authentication to work, which is also added. BRANCH=None BUG=chromium:788719 TEST=new unit tests Change-Id: Ib70144eedb0b1c7c43b26c06529d33ccbaa51a0e Reviewed-on: https://chromium-review.googlesource.com/790414 Reviewed-by: Andrey Pronin <apronin@chromium.org> Tested-by: Mattias Nissler <mnissler@chromium.org> Trybot-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Trybot-Ready: Mattias Nissler <mnissler@chromium.org>
* tpm_lite: Implement ReadPubek command.Mattias Nissler2018-04-131-0/+2
| | | | | | | | | | | | | | | | Add a TlclReadPubek library function to read the public endorsement key. BRANCH=None BUG=chromium:788719 TEST=New unit tests. Change-Id: I5f23b76b88198d656f4ba5782d2b4f25aaa082b1 Reviewed-on: https://chromium-review.googlesource.com/790413 Reviewed-by: Andrey Pronin <apronin@chromium.org> Tested-by: Mattias Nissler <mnissler@chromium.org> Trybot-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Trybot-Ready: Mattias Nissler <mnissler@chromium.org>
* tpm_lite: Drop FOR_TEST for tlcl.cMattias Nissler2018-04-091-7/+0
| | | | | | | | | | | | | | | | | | firmware/lib/tpm_lite.c turned off CHROMEOS_ENVIRONMENT if FOR_TEST is enabled, resulting in a situation where code specific to CHROMEOS_ENVIRONMENT couldn't be tested. Fortunately, AFAICS tlcl_tests does not use FOR_TEST for anything useful any longer, so just drop it. BRANCH=None BUG=None TEST=FEATURES=test emerge-$BOARD -v1 vboot_reference Change-Id: I7f08ef6d2343bc60a6d2982c3cc7bae0507d94d5 Reviewed-on: https://chromium-review.googlesource.com/937703 Commit-Ready: Mattias Nissler <mnissler@chromium.org> Tested-by: Mattias Nissler <mnissler@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* image_signing: unit tests for Android imageNicolas Norvez2018-02-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | - move helper functions that detect which keys should be used depending on the build flavor to a separate lib - add unit tests for that lib BUG=b:72947583 TEST=unit tests TEST=run against caroline image, scripts detects 'cheets' build flavor TEST=run against novato-arc64 image (SDK), script detects 'cheets' build flavor TEST=run against newbie image (AOSP), script detects 'aosp' build flavor TEST=run against invalid build property 'paosp_cheets_...', script aborts as expected BRANCH=None Change-Id: I5595c10a5a063e7658d0cf17c77dbeead429cd97 Reviewed-on: https://chromium-review.googlesource.com/923097 Commit-Ready: Nicolas Norvez <norvez@chromium.org> Tested-by: Nicolas Norvez <norvez@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Revert "Makefile: Build futility without utillib to extend arch support"Randall Spangler2018-01-111-25/+22
| | | | | | | | | | | | | | | | This reverts commit f59d2e41977032f8f3eac113358b93574fc27b4f. The change breaks 'make runtests'. More specifically, 'make runfutiltests'. Also, fix the duplicate FWLIB20 in LDLIBS when linking futility. BUG=None BRANCH=None TEST=make runtests (more specifically, make runfutiltests) Change-Id: Ia079924a814d98e1a3937b8de6ade7b001ff70ef Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/832848
* Makefile: Add pthread library to the futility static buildPaul Kocialkowski2018-01-111-1/+1
| | | | | | | | | | | | | | This adds the pthread library to the linker flags for the static futility build, which allows it to build with recent GCC versions. BUG=None BRACH=None TEST=Build futility and futility_s with a recent GCC version Change-Id: I16d9b94b76d6e9586278cfdc0b99ae749160138a Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-on: https://chromium-review.googlesource.com/805374 Reviewed-by: Martin Roth <martinroth@chromium.org>
* firmware: Prune down old region APIRandall Spangler2018-01-091-15/+4
| | | | | | | | | | | | | | | | | | | | | | | | The region API was a way for firmware and kernel verification to get at various blocks of caller-provided data. In practice, we only used it internally as a way to get at parts of the GBB. Prune it down to access only the bits of GBB we still need, from the buffer we already know we have. In the long run we should use the same vb2ex_read_resource() API that vb2 firmware verification does, but that should be done in a follow-up CL since it'll need to be coordinated with support in depthcharge. No change in functionality. BUG=chromium:611535 BRANCH=none TEST=make -j runtests; build bob firmware and boot it Change-Id: I5715cb8d88274164a1a73ed4a56bbd93af46f9bf Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/852798 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
* firmware: simplify audioRandall Spangler2018-01-051-13/+1
| | | | | | | | | | | | | | | | | | | | | | Vboot firmware previously supported a rather complex audio looping library. Our original intent was to allow developers to flash a custom beep sequence / tune as an easter egg. We never fully supported that, but the code to allow it lived on. Get rid of that. Vboot also previously made no assumptions about the frequency of VbExGetTimer(), which was only used by the vboot_audio library. So it spent 10ms every boot measuring the frequency. Which is silly now, because depthcharge implements that as a microsecond timer. Get rid of that measurement and define the timer as a microsecond timer. BUG=chromium:611535 BRANCH=none TEST=make -j runtests; build bob firmware and boot it Change-Id: I350246874fb36b00149423696285cfcaca0fc526 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/847311 Reviewed-by: Shelley Chen <shchen@chromium.org>
* vboot: introduce get_gbb_flags.shRuben Rodriguez Buchillon2017-12-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | introduce get_gbb_flags.sh command to make automatic annotation of power measurements easier. Also, fix issue where declaring local variables on same line as executing a command would obfuscate error code, thus not triggering set -c and continuing execution. https://github.com/koalaman/shellcheck/wiki/SC2155 Usage: $ /usr/share/vboot/bin/get_gbb_flags.sh [...] ChromeOS GBB set flags: 0x00000329. $ /usr/share/vboot/bin/get_gbb_flags.sh -e [...] ChromeOS GBB set flags: 0x00000329. ChromeOS GBB set flags listed: GBB_FLAG_DEV_SCREEN_SHORT_DELAY GBB_FLAG_FORCE_DEV_SWITCH_ON GBB_FLAG_DISABLE_FW_ROLLBACK_CHECK GBB_FLAG_FAFT_KEY_OVERIDE GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC BUG=chromium:760267 BRANCH=none TEST=manual emerge-soraka vboot_reference cros deploy <IP> vboot_reference (on DUT) /usr/share/vboot/bin/get_gbb_flags.sh -e <same output as above> Change-Id: Idb3b993706c03e7f2831eed2cef12a04b9469fea
* detachables: Add unit testsShelley Chen2017-12-191-0/+2
| | | | | | | | | | | | | | | | | | Initial unit tests for detachable menu UI. With these tests, the coverage is at 81.2% for lines for code and 87.5% for function coverage. I will improve this to closer to 100%, but wanted to get this in as it's still significantly better than before, which was 0%. There are still a lot of tests in the code that are #if 0'd out currently. I still need to go through an enabled/delete those. BUG=b:65025540 BRANCH=None TEST=run COV=1 make and make sure passes without errors Change-Id: If17bfc24fb7f65deb3d2286cc39cdc311d8a6d93 Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/830680 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Makefile: Build futility without utillib to extend arch supportPaul Kocialkowski2017-12-181-23/+26
| | | | | | | | | | | | | | | | | | | This removes utillib from the futility build and adds only the required files from utillib to its build. Utillib includes arch-specific components (required for crossystem) that only have a limited number of supported architectures, which is undesirable for futility. The number of archs that futility can run on is no longer restricted. BUG=None BRACH=None TEST=Build futility and futility_s Change-Id: Ia9ad2a72b374b5cc3d6004d36c0b7090dbcc97a2 Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-on: https://chromium-review.googlesource.com/666625 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
* Makefile: Add support for aarch64 arch for crossystem buildPaul Kocialkowski2017-12-181-0/+2
| | | | | | | | | | | | | | This handles the aarch64 machine returned by uname as arm to allow crossystem to build. BUG=None BRACH=None TEST=Build futility and futility_s on ARMv8 Change-Id: I1d847568a36f47d084e7572b28e2603b9b6ec673 Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-on: https://chromium-review.googlesource.com/785911 Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: Use 2nvstorage instead of vboot_nvstorageRandall Spangler2017-12-111-4/+1
| | | | | | | | | | | | | | | | | | Remove the old vboot1 vboot_nvstorage library (VbNv*() functions) and use the vboot2 library (vb2_nv_*()) instead. This is needed in preparation for moving to 64-byte records; no sense in implementing that change twice... Should be (better be) no change in system behavior. BUG=chromium:789276 BRANCH=none TEST=make runtests compare output of crossystem before/after change (should be identical) Change-Id: I10f9975b0824263064b9a74a3c6daadcecc085d3 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/794732
* futility_s: add vbutil_firmware & vbutil_keyMike Frysinger2017-10-101-0/+4
| | | | | | | | | | | | | | The firmware updater relies on these, so include them. BUG=chromium:772862 TEST=build works and futility_s includes new commands BRANCH=None Change-Id: I973e339d11df4d5b72f70d3a9e28916cca4ebbf6 Reviewed-on: https://chromium-review.googlesource.com/708236 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* Makefile: Build utils for both dynamic and static version.Hung-Te Lin2017-09-151-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The auto update process (especially firmware updater) needs static vboot utilitys but normal OS images, including recovery images, don't need that. We should build both dynamic and static binaries at the same time for images to choose what they need. Currently only `crossystem` will build static version. And after this change is merged: (cd /build/reef/usr/bin; file crossystem*) crossystem: ELF 64-bit LSB shared object crossystem_s: ELF 64-bit LSB executable (cd /build/reef/usr/bin; du -sh crossystem*) 40K crossystem 808K crossystem_s BUG=chromium:764753,chromium:765499 TEST=emerge-reef vboot_reference BRANCH=None Change-Id: Ibd66c87bb44c5593767aeb710240e0165103f016 Reviewed-on: https://chromium-review.googlesource.com/668274 Commit-Ready: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Fix arch detection for i686stabilize-9901.35.BPaul Kocialkowski2017-08-311-0/+2
| | | | | | | | | | | | | | | | | This adds detection for the i686 arch and replaces it with x86, allowing it to build. BRANCH=none BUG=none TEST=Build host_stuff on an i686 machine Change-Id: Idab7c762a7fbb97ec5318b9aa860756b4dd0bc25 Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-on: https://chromium-review.googlesource.com/645086 Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
* Makefile: Add gentestcases targetNicolas Boichat2017-02-111-0/+5
| | | | | | | | | | | | | | | | | This calls gen_test_cases.sh in the proper environment. Also, prevent gen_test_cases.sh from overriding test_file, to provide stable signature (and avoid large git diff for no reason). BRANCH=none BUG=chromium:684354 TEST=make gentestcases -j8; git diff => no changes Change-Id: I556285fd1a07a4d84f4ebd3fd7881ae06743716e Reviewed-on: https://chromium-review.googlesource.com/439064 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>