summaryrefslogtreecommitdiff
path: root/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* Remove -isystem from CFLAGS for firmware buildrelease-R16-1193.BChe-Liang Chiou2011-10-171-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The -isystem and the rest of the CFLAGS for firmware builds is copied from U-Boot, where U-Boot generates it on the fly, as a temporary solution before we figure out how make the CFLAGS right. Given that, the hard-coded -isystem is both incorrect (since tool chain is upgraded to a new version) and unnecessary. It is unnecessary because firmware lib is carefully written that the lib does not (and probably should not) depend on any system header. Even if in the future a system header is added to the firmware lib, because firmware build sets -nostdinc to CFLAGS, the compiler will safely report missing header instead of silently using the standard system header. So this commit removes the -isystem. BUG=chromium-os:16808 TEST=Make sure non-firmware build still works by running `emerge-{tegra2_seaboard,x86-alex} vboot_reference` TEST=Run firmware build successfully `emerge-{tegra2_seaboard,x86-alex} vboot_reference-firmware` TEST=Add #include<stdarg.h> to any header in firmware/include/ and run firmware build again and observe build fail on missing stdarg.h Change-Id: I8291390f21a975446993640d7a92a3eed4750e32 Reviewed-on: http://gerrit.chromium.org/gerrit/10072 Tested-by: Che-Liang Chiou <clchiou@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* make: remove typo quote marksChe-Liang Chiou2011-06-211-2/+2
| | | | | | | | | | BUG=chromium-os:16808 TEST=run "make FIRMWARE_ARCH=arm" and make sure CFLAGS are set properly Change-Id: I4cd5d8d03dabf256706a2961b6776c64c03c72ac Reviewed-on: http://gerrit.chromium.org/gerrit/2966 Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Tested-by: Che-Liang Chiou <clchiou@chromium.org>
* make: temporarily hard-coded compiler flags for firmware buildsChe-Liang Chiou2011-06-211-4/+25
| | | | | | | | | | | | | | | | | | Before this commit, u-boot and vboot_reference are inter-dependent on each other; the former needs to be linked with the latter, and the latter needs the compiler flags of the former to be built properly. This commit hard-code u-boot's compiler flags into Makefile, and thus removes the inter-dependency. Note that this is just a temporarily measure before we get the compiler flags right. BUG=chromium-os:16808 TEST=emerge-{tegra2_seaboard,x86-alex} vboot_reference-firmware Change-Id: Ia3b487b32775afd98fa15db29dbff51ae9d8a94d Reviewed-on: http://gerrit.chromium.org/gerrit/2947 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Che-Liang Chiou <clchiou@chromium.org>
* Add option to use mocked TPM driverChe-Liang Chiou2011-04-221-0/+1
| | | | | | | | | | | | | Some ARM boards, such as Seaboard, have buggy TPM chip that bricks the borad. This commit adds a option to use mocked TPM driver. R=rongchang@chromium.org,rspangler@chromium.org,wad@chromium.org BUG=chromium-os:14239 TEST=Run verified boot on Seaboard Review URL: http://codereview.chromium.org/6883040 Change-Id: Iae6133f081c2e3d9daa4e14bb711550e2658e9df
* Add default arch to fix compiling outside emakeRandall Spangler2011-04-111-0/+5
| | | | | | | | | | Change-Id: I225c2ee7e703aad961c50ec8988ed2466886f266 R=wfrichar@chromium.org BUG=none TEST=make && make runtests Review URL: http://codereview.chromium.org/6820018
* Add test framework for bmpblk_utility.Bill Richardson2011-02-071-0/+3
| | | | | | | | | | | | | | | | | BUG=chromium-os:11742 TEST=manual Check out sources, run: cd src/platform/vboot_reference make make runbmptests It should pass. Change-Id: I50ebdef26662e7446828315a3f5e2786624508b9 Review URL: http://codereview.chromium.org/6246150
* Import firmware compiler flagsChe-Liang Chiou2011-01-271-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If passed into Makefile, firmware compiler flags (CC and CFLAGS) will override old values to make sure that the compiled vboot_reference library has calling convention and alike compatible with the firmware. CL:6257018 had caused buildbot failure due to combination of two reasons: First, the Makefile rule for tlcl_generator that uses HOSTCC, which is not the cross-compiler passed to Makefile, but wrongly passes CFLAGS, rather than stuff like HOSTCFLAGS, into HOSTCC. Second, CL:6257018 changed the behavior of Makefile, and so it did not override CFLAGS value passed by emerge-${BOARD}, which is incompatible with HOSTCC. Thus, this CL preserves the previous the behavior of Makefile that always overrides CFLAGS value received from outside world. See also CL:6355014 BUG=None TEST=See below 1. Run emerge-tegra2_seaboard vboot_reference-firmware successfully, and check if vboot.a is compiled with CFLAGS from u-boot-cflags.mk 2. Run emerge and emerge-${BOARD} vboot_reference successfully Review URL: http://codereview.chromium.org/6297017 Change-Id: I4b85079c520efdb7043c012b994817b47ebe831c
* Revert "Import firmware compiler flags"Chris Sosa2011-01-261-20/+6
| | | | | | | | | | | This reverts commit 440ad516c4840882557bfb76ddf497ea0041fc03. BUG= TEST= Review URL: http://codereview.chromium.org/6396002 Change-Id: I6b241e418cbba62c9dc82549f2a5c7a9485db1df
* Import firmware compiler flagsChe-Liang Chiou2011-01-271-6/+20
| | | | | | | | | | | | | | | If passed into Makefile, compiler flags for firmware (so far CC and CFLAGS) will override old values to make sure that the compiled vboot_reference library has calling convention and etc. compatible with the firmware. See also CL:6355014 BUG=None TEST=See the CL for related ebuilds Review URL: http://codereview.chromium.org/6257018 Change-Id: I46f77c576d2355f5cde506a0240dd2e2d4a74f0e
* Add firmware build mode to MakefilesChe-Liang Chiou2010-11-301-1/+17
| | | | | | | | | | | | | This CL also includes a biosincludes.h for ARM platform. The changes to ebuilds are in a separated CL:5352002. BUG=None TEST=Run 'make' and 'make FIRMWARE_ARCH=arm' successfully Review URL: http://codereview.chromium.org/5301004 Change-Id: I76738972a8215e346910a76a664a91f6f6927747
* Fix integration bugs (vboot side)Che-Liang Chiou2010-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | BUG=chromium-os:8621 TEST=See below 1. Build and run tests of vboot (including linktest) $ make && make runtests 2. Check if *_stub.o are not in vboot_fw.a $ nm /build/<board>/usr/lib/vboot_fw.a | grep _stub.o 3. Build and boot x86-generic image $ ./build_packages --board=x86-generic && ./build_image --board=x86-generic (Then successfully boot the image you just built) See CL=4372001 for u-boot side changes Review URL: http://codereview.chromium.org/4266002 Change-Id: Icc2bcc551c998f370e4b737fbe442ebf029cd81c
* Added new commands and reactivated full rebuild after fixing for ARM ebuild.Luigi Semenzato2010-08-251-1/+2
| | | | | | Review URL: http://codereview.chromium.org/3116025 Change-Id: Ideb82562f6b1c3ce5cd9e0b79de250d0a7bd976e
* Temporarily remove problematic line while semenzato generates a real fix.David Rochberg2010-08-041-1/+0
| | | | | | | | | TBR: semenzato BUG=None TEST=emerge-arm-generic vboot_reference Review URL: http://codereview.chromium.org/3069027
* Various bug fixes to tpm_lite. Some changes to the test suite.Luigi Semenzato2010-08-041-3/+1
| | | | Review URL: http://codereview.chromium.org/3091004
* Introduce ability to change the kernel command line.vbendeb2010-07-151-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After this change vbutil_kernel allows to repack an existing signed ChromeOS kernel such that the kernel command line is changed on operator's request. The new command line parameter is --verbose which causes --verify to print out current contents of the kernel command line. Some refactoring and cleaning were also done: - provide a macro to access command line buffer inside a kernel blob - ReadConfigFile() a new wrapper to preprocess the config file. - keep the key_block and preamble in the blob when unpacking an existing signed kernel for --repack and --verify. - make --pack expect at least one of the two: --config or --keyblock, thus allowing to change the command line without replacing anything else in the signed kernel image. - refactor Verify() to use OldBlob() to preprocess the image. The top level Makefile was changed to allow compiling for debugging. Build with DEBUG=1 in the make command line to enable gdb debugging and debug printouts. Build with DISABLE_NDEBUG=1 in the make command line to enable cryptolib debug outputs. BUG=http://code.google.com/p/chromium-os/issues/detail?id=4814 TEST=see below 1. Observe that all unit tests still pass by running (vboot_reference $) RUNTESTS=1 make 2. On a working DVT system copy the running kernel into a file using dd if=/dev/sda2 of=/tmp/dev.kernel and transfer the file to the host into /tmp/try/dev.kernel Then create the new config file in /tmp/try/new.conf.txt and run the following commands: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv (vboot_reference $) ./build/utility/vbutil_kernel --verify /tmp/try/dev.kernel --signpubkey tests/devkeys/kernel_subkey.vbpubk --verbose Key block: Size: 0x4b8 Data key algorithm: 4 RSA2048 SHA256 Data key version: 1 Flags: 7 Preamble: Size: 0xfb48 Header version: 2.0 Kernel version: 1 Body load address: 0x100000 Body size: 0x302000 Bootloader address: 0x3fe000 Bootloader size: 0x4000 Body verification succeeded. Config: earlyprintk=serial,ttyS0,115200 console=ttyS0,115200 init=/sbin/init add_efi_memmap boot=local rootwait ro noresume noswap i915.modeset=1 loglevel=7 cros_secure root=/dev/sd%D%P dm_verity.error_behavior=2 dm_verity.max_bios=1024 dm="0 2097152 verity ROOT_DEV HASH_DEV 2097152 1 sha1 a7fbd641ba25488509987959d5756d802790ef8f" noinitrd (vboot_reference $) ./build/utility/vbutil_kernel --repack /tmp/try/dev.kernel.repacked --signprivate tests/devkeys/kernel_data_key.vbprivk --oldblob /tmp/try/dev.kernel --config /tmp/try/new.conf.txt (vboot_reference $) ./build/utility/vbutil_kernel --verify /tmp/try/dev.kernel.repacked --signpubkey tests/devkeys/kernel_subkey.vbpubk --verbose Key block: Size: 0x4b8 Data key algorithm: 4 RSA2048 SHA256 Data key version: 1 Flags: 7 Preamble: Size: 0xfb48 Header version: 2.0 Kernel version: 1 Body load address: 0x100000 Body size: 0x302000 Bootloader address: 0x3fe000 Bootloader size: 0x4000 Body verification succeeded. Config: console=tty2 init=/sbin/init add_efi_memmap boot=local rootwait ro noresume noswap i915.modeset=1 loglevel=7 cros_secure root=/dev/sd%D%P dm_verity.error_behavior=2 dm_verity.max_bios=1024 dm="0 2097152 verity ROOT_DEV HASH_DEV 2097152 1 sha1 ff06384015a7726baff719ee68eab312b1d45570" noinitrd (vboot_reference $) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Observe the chanegd command line printed by --verify --verbose. Then transfer the new kernel image back to the DVT system, dd it into /dev/sda2 and restart the DVT system. Observe kernel startup messages dumped on the screen (due to the changed kernel command line). Then examine /proc/cmdline to verify that the command line indeed matches the contents of /tmp/try/new.conf.txt on the host. 3. Build the code with (vboot_reference$) DEBUG=1 make observe that debug information is visible by gdb. Build the code with (vboot_reference$) DISABLE_DEBUG=1 make and observe that -DNDEBUG is dropped from the compiler invocation line. Review URL: http://codereview.chromium.org/3004001
* Add tpm lite to vboot referenceRandall Spangler2010-07-141-1/+4
| | | | Review URL: http://codereview.chromium.org/2919010
* New targets to compile and install rollback tests only with USE=rbtest ↵Luigi Semenzato2010-07-081-1/+3
| | | | | | emerge ... Review URL: http://codereview.chromium.org/2962002
* Fix makefiles to work with ebuildRandall Spangler2010-07-081-1/+1
| | | | Review URL: http://codereview.chromium.org/2951002
* Also need to disable calling make tests install.Randall Spangler2010-07-081-1/+1
| | | | Review URL: http://codereview.chromium.org/2913005
* This test sets the TPM to a each of a large amount of "interesting" initial ↵Luigi Semenzato2010-07-081-0/+1
| | | | | | | | states, and runs the firmware code at user level. This code compiles and installs using a modified ebuild (which needs to be committed after this change). Review URL: http://codereview.chromium.org/2857030
* Adding --repack and --headeronly options to vbutil_kernelBill Richardson2010-06-301-1/+1
| | | | | | | | | | | | The --repack option lets us sign a previously signed kernel blob with a new kernel data key. The --headeronly option is so we can emit the new verification header separately from the kernel blob. More work to come... Review URL: http://codereview.chromium.org/2812034
* Make vboot_reference build in MSVC command line environment.vbendeb2010-06-241-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a mostly NOOP change which modifies the source code to compile cleanly in the MSVC command line build environment. A new makefile is introduced (msc/nmakefile) along with a README.txt in the same directory explaining how to build the code in the DOS window. As of this submission the build is running in a 32 bit environment, the intention is to use the same makefile for 64 bit builds in the future. Enabling high compilation warnings level allowed to identify a couple of bugs in the code which are being fixed. Not all sources are being compiled in the MSVC environment, only those in firmware/ and most of those in test/ subdirectories. The benchmark calculations require porting of the timer facilities and are being postponed. TEST Built in DOS and linux environments. Ran unit tests in linux environment. Review URL: http://codereview.chromium.org/2809037
* Add VBDEBUG macro for debug output.Randall Spangler2010-06-231-1/+2
| | | | | | Replaced in firmware/ lib; not replaced in host-side utils/tests. Review URL: http://codereview.chromium.org/2810026
* More cleanup of MSVC errorsRandall Spangler2010-06-211-1/+1
| | | | Review URL: http://codereview.chromium.org/2871019
* Include BIOS specific definitions when required.vbendeb2010-06-211-1/+1
| | | | | | | | | | | | | | | | | This is a noop for host/chroot environment. When compiling in the firmware space the standard include files will not be included, the definitions will be supplied by the BIOS, through the new file (firmware/include/sysincludes.h). Testing ======= RUNTESTS=1 make in the top level directory succeeds, confirming that the tree compiles cleanly and the unit tests pass. Review URL: http://codereview.chromium.org/2862019
* Remove unused files, and tidy the directory structure of the remaining ones.Randall Spangler2010-06-171-5/+3
| | | | Review URL: http://codereview.chromium.org/2815011
* Remove old firmware verification code, now that firmware build has switched ↵Randall Spangler2010-06-161-1/+1
| | | | | | to the new algorithms. Review URL: http://codereview.chromium.org/2835006
* Rework the vboot_reference make system.vbendeb2010-06-141-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After this change the generated files are placed in a separate tree (such thet they don't show in the `git status' output anymore) and the dependencies are followed properly (if a .h file changes the appropriate .o files and apps get rebuilt). Tested as follows: > $ make clean > $ make # build succeeds > $ git status # shows clean directory > $ RUNTESTS=1 make # (captured test output matches that of the test run before any changes) > $ touch ./vboot_firmware/include/tlcl.h > $ make # make succeeds > $ find build -type f -newer ./vboot_firmware/include/tlcl.h build/vboot_firmware/lib/rollback_index.o build/vboot_firmware/lib/rollback_index.o.d build/vboot_firmware/a.out build/vboot_fw.a build/utility/vbutil_key build/utility/kernel_utility.d build/utility/vbutil_key.d build/utility/verify_data build/utility/load_kernel_test.d build/utility/vbutil_keyblock.d build/utility/vbutil_kernel build/utility/vbutil_kernel.d build/utility/firmware_utility build/utility/signature_digest_utility.d build/utility/kernel_utility build/utility/verify_data.d build/utility/vbutil_keyblock build/utility/signature_digest_utility build/utility/load_kernel_test build/utility/firmware_utility.d build/tests/vboot_common3_tests build/tests/vboot_common2_tests build/host/a.out $ > Review URL: http://codereview.chromium.org/2845001
* Nearly complete rewrite of cgpt tool.Bill Richardson2010-06-111-1/+3
| | | | | | | | | This fixes a number of bugs, adds a bunch of commands, and essentially makes cgpt ready to use as a replacement for gpt. Still to do is to add commands and options that will let it generated intentionally bad partitions, for use in testing. Review URL: http://codereview.chromium.org/2719008
* Major refactoring of structures, with unit tests. This matches the doc I ↵Randall Spangler2010-06-101-1/+3
| | | | | | | | | | sent out earlier. Firmware-side code for LoadKernel() is in place now. LoadFirmware() replacement coming soon. The new functions are implemented in parallel to the existing ones (i.e., everything that used to work still does). Review URL: http://codereview.chromium.org/2745007
* Add a Makefile target to run all vboot_reference tests.Gaurav Shah2010-06-031-0/+3
| | | | Review URL: http://codereview.chromium.org/2561003
* Add install target to put utilities into chroot (in /opt/bin/)Bill Richardson2010-05-271-0/+3
| | | | Review URL: http://codereview.chromium.org/2225008
* Moved cgptlib into vboot_firmwareRandall Spangler2010-05-271-3/+2
| | | | | | Moved cgptlib tests into tests Review URL: http://codereview.chromium.org/2303003
* Rearrange vboot_reference directories to isolate external components.Bill Richardson2010-05-261-3/+5
| | | | | | | | This creates a new vboot_firmware subdirectory, and which contains the entirety of the BIOS code. There shouldn't be anything in this directory that is NOT required by the BIOS. Review URL: http://codereview.chromium.org/2219004
* add cgpt framework and attribute support.Louis Yung-Chieh Lo2010-05-211-2/+4
| | | | Review URL: http://codereview.chromium.org/2082015
* rename cgpt files with cgptlib prefix (to avoid conflicts to cgpt utility)Louis Yung-Chieh Lo2010-05-171-2/+3
| | | | Review URL: http://codereview.chromium.org/2082007
* VBoot Reference: Refactoring Part 3Gaurav Shah2010-03-311-3/+5
| | | | | | | | | | | | | | | | | | | Refactor and restructure reference code into individual self-contain modules. I have revamped the way the code is structured to make it easy to determine which parts belong in the firmware and which are used by userland tools. common/ - common utilities and stub functions (Firmware) cryptolib/ - crypto library (Firmware) misclibs/ - miscellaneous userland libraries (Userland) sctips/ - Miscellaenous scripts (Userland) tests/ - Tests (Userland) vfirmware/ - Verified Firmware Implementation vfirmware/firmware_image_fw.c (Firmware) vfirmware/firmware_image.c (Userland) vkernel/ - Verified Kernel Implementation vkernel/kernel_image_fw.c (Firmware) vkernel/kernel_image.c (Userland) Review URL: http://codereview.chromium.org/1581005
* Vboot Reference: Make length types explicitly sized.Gaurav Shah2010-03-101-1/+1
| | | | Review URL: http://codereview.chromium.org/744002
* Add a README and turn-on optimizations.Gaurav Shah2010-03-031-1/+1
| | | | Review URL: http://codereview.chromium.org/665009
* Vboot Reference: Conditionally set Makefile CC variable so that it ↵Gaurav Shah2010-02-171-1/+1
| | | | | | cross-compiles. Review URL: http://codereview.chromium.org/629003
* Vboot Reference: Misc style fixes to Makefile and fix testing script.Gaurav Shah2010-02-161-5/+5
| | | | Review URL: http://codereview.chromium.org/600114
* RSA signature verification and SHA-1/256/512 reference implementation for ↵Gaurav Shah2010-01-281-0/+21
verified boot. Also contains some preliminary tests for these primitives. Review URL: http://codereview.chromium.org/553023