Commit Graph

67 Commits

Author SHA1 Message Date
Randall Spangler
844bce5747 Run some tests under qemu when cross-compiling
BUG=chromium-os:26317
BRANCH=none
TEST=manual

sudo FEATURES=test emerge vboot_reference
FEATURES=test emerge-link vboot_reference chromeos-u-boot chromeos-installer
FEATURES=test emerge-daisy vboot_reference chromeos-u-boot chromeos-installer
make && make runtests (both inside and outside chroot)

Change-Id: Ie829e375736ce0df46ddd5a3345efb0ca7e33aba
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41317
2013-01-16 11:22:38 -08:00
Randall Spangler
a808dc9442 Fix missing dependency
BUG=chromium-os:26317
BRANCH=none
TEST=make && make runtests

Change-Id: I420e81a9f9cb1333c233abedfad5cae8984f11b7
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41233
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-01-15 10:46:42 -08:00
Bill Richardson
826db09fce Use 'install' to do installation, prepare for futility installation.
Previously we've been using manual cp and chmod operations to implement
"make install". This switches to using the install utility instead, which
can handle permissions and so forth.

This also tweaks the DESTDIR slightly to prepare the way for futility.

BUG=chromium-os:26317
BRANCH=none
TEST=manual

Run

  sudo emerge vboot_reference

Shouldn't see any difference.

Change-Id: I667ddbb9de3ab7713921ddd734d1fbcbe3b936b1
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41228
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-01-14 13:51:28 -08:00
Bill Richardson
acb2ee977b Add .PHONY targets for phony targets
We have a bunch of manual dependency targets. They need to be marked as
.PHONY so that they'll always work.

Also made the spacing around the ':' more consistent so it's easier to find
specific instances.

BUG=chromium-os:26317
BRANCH=none
TEST=manual

sudo emerge vboot_reference
emerge-link vboot_reference chromeos-u-boot chromeos-installer
emerge-daisy vboot_reference chromeos-u-boot chromeos-installer

Change-Id: I00a1b8abcd588bdbab33b172c64a4b305b6d7237
Reviewed-on: https://gerrit.chromium.org/gerrit/41185
Commit-Queue: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-01-14 09:51:23 -08:00
Randall Spangler
17f8d34109 Rename files and defines to simplify makefile.
BUG=chromium-os:26317
BRANCH=none
TEST=manual

sudo emerge vboot_reference
emerge-link vboot_reference chromeos-u-boot chromeos-installer
emerge-daisy vboot_reference chromeos-u-boot chromeos-installer

Signed-off-by: Randall Spangler <rspangler@chromium.org>
Change-Id: I8c55ca40f3f0cacf08530ab63c886fe351bcee8e
Reviewed-on: https://gerrit.chromium.org/gerrit/41152
2013-01-11 16:14:24 -08:00
Randall Spangler
5d9bbf2bbd Unify vboot build into a single makefile
This is a necessary precursor to getting coverage working.

BUG=chromium-os:26317
BRANCH=none
TEST=manual

sudo emerge vboot_reference
emerge-link vboot_reference chromeos-u-boot
emerge-daisy vboot_reference chromeos-u-boot

Change-Id: Ibed91c64a5ca5fa486169d64fb01a9e868ce27e5
Signed-off-by: Randall Spangler <rspangler@chromium.org>
(cherry picked from commit 13ed1f4812f810ee0a47b946ad990f1fa93f366c)
Reviewed-on: https://gerrit.chromium.org/gerrit/40906
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-01-11 14:20:53 -08:00
Randall Spangler
e8cfa31d54 Move lengthy tests from 'make runtests' to 'make runlongtests'
This reduces 'make runtests' from ~90 sec on a z620 to ~8 sec, which
is short enough we can run it as part of the continuous build.

BUG=chromium-os:26317
BRANCH=none
TEST=make && time make runtests && time make runlongtests

Change-Id: I8165efaf8b8290ca3c8f8da73e3f8a54c2bc19f9
Reviewed-on: https://gerrit.chromium.org/gerrit/40374
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Randall Spangler <rspangler@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2013-01-03 11:14:51 -08:00
Gabe Black
0aedbe1950 Add support for a V option which selects verbose Makefile output.
When V=1, the full command lines are printed. When V is not 1, then only a
small summary line is printed which shows what commands are being executed.
The command lines themselves are usually quite long and are overwhelming to
see fly by on the console. Abbreviated command lines are easier to read and
don't fill up your console so quickly.

This change is primarily targeted at vboot_fw.a and probably excludes some
things which could also be converted. The indentation between the action
string (OBJCOPY, CC, etc.) and the target is three spaces longer than "normal",
aka what's used in depthcharge, so that when this make is run from the other,
you can tell the difference between the commands run by each.

BUG=chrome-os-partner:8339
TEST=Built with and without V=1 and saw and did not see the full command
lines, respectively.
BRANCH=None

Change-Id: Ibee244c24dc44b8da109b8c23ac7273174836bb9
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/40011
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2012-12-21 12:42:42 -08:00
Mike Frysinger
121f3db2d5 respect pkg-config env settings
Rather than use the host's pkg-config, we want to use the target's.
This way we query the right .pc files.

BUG=None
TEST=`emerge vboot_reference` still works
TEST=`emerge-arm-generic vboot_reference` still works

Change-Id: I083a987ee6c23716f8d79eb14e7c38c12e18b8f8
Reviewed-on: https://gerrit.chromium.org/gerrit/24727
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-06-18 17:14:53 -07:00
Doug Anderson
d50b27d15d Switch vboot reference to hardfp
This allows it to compile without switching to a private libgcc.

BUG=chromium-os:30807
TEST=While making sure u-boot, vboot_reference and
vboot_reference-firmware were cros_workoned and grabbing
the associated U-Boot change (I3cdc86ee2846814a6522c7874e5b438be94164ab),
I did:

1. emerge-daisy chromeos-u-boot vboot_reference vboot_reference-firmware
2. cros_bundle_firmware --add-config-int load_env 1    \
     -d exynos5250-daisy -b daisy -o /tmp/uboot.bin
3. sudo dd if=/tmp/uboot.bin of=${SDCARD} bs=512 seek=1
...and then booted that.

Change-Id: I49d567e51d95c77f0e0fef8ec0f678e51b5ab77f
Reviewed-on: https://gerrit.chromium.org/gerrit/22479
Tested-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Terry Lambert <tlambert@chromium.org>
Tested-by: Terry Lambert <tlambert@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Commit-Ready: Doug Anderson <dianders@chromium.org>
2012-05-11 14:10:39 -07:00
Bill Richardson
f47291926a Require -Wall -Werror for everything.
BUG=none
TEST=none

Change-Id: Ib9781238274285f73d00d8fca4ecda28fc2c6678
Reviewed-on: https://gerrit.chromium.org/gerrit/21748
Commit-Ready: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
2012-05-03 17:38:57 -07:00
Jay Srinivasan
5fac757abe Enable building of Cgpt C++ Library for 32-bit.
The existing library had a bunch of dependencies which are too many to
build for the 32-bit platform. So this checkin prunes the dependency
list by building only things that are absolutely required for the
functionality used in 32-bit Post-Installer.

Made the use of libuuid restricted only to cgpt and unit tests so that
libcgpt-cc.a doesn't depend on it.

BUG=chromium-os:25374
TEST=Built 32-bit and 64-bit. Tested 32-bit post-install.
Change-Id: Idd0826fdf507a95728fee8adac9520e26f05d469
Reviewed-on: https://gerrit.chromium.org/gerrit/16433
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Commit-Ready: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
2012-02-23 15:10:38 -08:00
Jay Srinivasan
250549d3e7 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 <wfrichar@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Ready: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
2012-02-16 19:18:08 -08:00
Don Garrett
ed5fcc0191 Rename dump_kernel_config.a to libdump_kernel_config.a.
It should have been named this way from the beginning.

TEST=Made/emerged. Since it's only used at build time, this is sufficient.
BUG=None

Change-Id: I60cc6510e8494e3dde852efbdcb5af156e7400ac
Reviewed-on: https://gerrit.chromium.org/gerrit/15835
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Commit-Ready: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
2012-02-14 14:20:25 -08:00
Don Garrett
0fc9594634 Bundle up the utilities methods used in dump_kernel_config and
export them as a library to be used by post installer programs.

A matching change to vboot_reference-9999.ebuild is also required.

TEST=Built, verified library symbols with nm on x86-mario, amd64-generic.
BUG=chromium-os:25381

Change-Id: Icb23838a8cd804e0c66718c6d4d60f639ee6b72f
Reviewed-on: https://gerrit.chromium.org/gerrit/14770
Commit-Ready: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
2012-01-26 15:22:39 -08:00
Simon Glass
6d696e532c Allow caller to specify build output directory
This changes the Makefile to set the BUILD directory only if the caller
does not specify it.

This allows U-Boot to build vboot reference and put the resulting binaries
into its own output directory.

BUG=chromium-os:16808
TEST=emerge vboot_reference-firmware for tegra2-seaboard, x86-mario

Change-Id: I6b0bba47e397f86a130e67c4e18fbcf5fffdfd68
Reviewed-on: https://gerrit.chromium.org/gerrit/11638
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2011-11-23 16:40:52 -08:00
Simon Glass
8e85e98773 Revert "Revert "Add x86_64 architecture support""
This reverts commit 354630570900cd5c2180610acfa47422ff484fe6

Change-Id: I832a675911f66837f31ea47d19babf5c656bfaf9
Reviewed-on: https://gerrit.chromium.org/gerrit/12044
Commit-Ready: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2011-11-22 14:20:52 -08:00
Simon Glass
b265c34321 Revert "Revert "Revert "Revert "Break out common compile flags""""
This reverts commit 9d7d7c653bfac91180ec6e4a8047be8dc2e73448

Change-Id: Id4357ee6f22666b47734a8f754da67317265d348
Reviewed-on: https://gerrit.chromium.org/gerrit/11809
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Simon Glass <sjg@chromium.org>
2011-11-17 17:09:51 -08:00
David Hendricks
f287021864 Revert "Revert "Revert "Break out common compile flags"""
reverted again (due to build breakage on ARM)

This reverts commit 00e7bb9dd02287db868bc291e25d27066fc486da

Change-Id: I9d7d7c653bfac91180ec6e4a8047be8dc2e73448
Reviewed-on: https://gerrit.chromium.org/gerrit/11789
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Tested-by: David Hendricks <dhendrix@chromium.org>
2011-11-16 14:10:13 -08:00
Simon Glass
25c36746a2 Revert "Revert "Break out common compile flags""
This reverts commit 45e1067502da0c3cbf77d8b6aafc9d17b461cea3

Change-Id: I00e7bb9dd02287db868bc291e25d27066fc486da
Reviewed-on: https://gerrit.chromium.org/gerrit/11746
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2011-11-16 13:38:42 -08:00
Nick Sanders
6f5da79114 Revert "Break out common compile flags"
This reverts commit 5ca219f8d6eb854d95c5d811a4cfdeff2d8405b4

Mysterious ARM PFQ breakage

Change-Id: I45e1067502da0c3cbf77d8b6aafc9d17b461cea3
Reviewed-on: https://gerrit.chromium.org/gerrit/11663
Commit-Ready: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
2011-11-14 16:38:28 -08:00
Nick Sanders
52499b8f3c Revert "Add x86_64 architecture support"
This reverts commit fbf9de6b2ba3162a7183211872bd23ca52f58289

Mysterious ARM PFQ breakage

Change-Id: I354630570900cd5c2180610acfa47422ff484fe6
Reviewed-on: https://gerrit.chromium.org/gerrit/11664
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
2011-11-14 16:38:11 -08:00
Simon Glass
bf5540eb1e Add x86_64 architecture support
This is required for U-Boot's sandbox test system.

BUG=chromium-os:16808
TEST=emerge vboot_reference-firmware for tegra2-seaboard, x86-mario

Change-Id: I18b48b069dc56f9b2c826de99780dfff1e544ded
Reviewed-on: https://gerrit.chromium.org/gerrit/5980
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2011-11-14 15:53:15 -08:00
Simon Glass
77ce2e864e Break out common compile flags
Many of the compile flags are common between archs, so this makes that
more obvious.

BUG=chromium-os:16808
TEST=emerge vboot_reference-firmware for tegra2-seaboard, x86-mario

Change-Id: I62bfbaadac392e3dd03d6997f24055fafac162af
Reviewed-on: https://gerrit.chromium.org/gerrit/11549
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2011-11-14 15:52:53 -08:00
Stefan Reinauer
b7d2f1efca vboot_reference: clean up CFLAGS and enable unrolled loops
- loop unrolling has a positive effect on execution speed.
- This change also drops the -march=i386 and thus allows
  the compiler to use SSE instructions.
- A few duplicate options are dropped from CFLAGS.
- drop -fno-toplevel-reordering. This sneaked in from
  u-boot where it might be needed by some drivers.

With this change I just successfully booted my Stumpy in 833ms

BUG=chrome-os-partner:4675
TEST=boot tested on stumpy
Change-Id: I805cbcaec48b4f8d1d8fa7d7bed9241178f59a8e
Reviewed-on: https://gerrit.chromium.org/gerrit/11061
Tested-by: Stefan Reinauer <reinauer@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2011-11-02 13:00:14 -07:00
Che-Liang Chiou
6b0003c638 Remove -isystem from CFLAGS for firmware build
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>
2011-10-17 20:08:28 -07:00
Che-Liang Chiou
7604a7dba2 make: remove typo quote marks
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>
2011-06-21 17:44:00 -07:00
Che-Liang Chiou
74359b755c make: temporarily hard-coded compiler flags for firmware builds
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>
2011-06-21 16:26:36 -07:00
Che-Liang Chiou
8511f7891b Add option to use mocked TPM driver
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
2011-04-22 16:01:38 +08:00
Randall Spangler
287beaed7f Add default arch to fix compiling outside emake
Change-Id: I225c2ee7e703aad961c50ec8988ed2466886f266

R=wfrichar@chromium.org
BUG=none
TEST=make && make runtests

Review URL: http://codereview.chromium.org/6820018
2011-04-11 12:46:40 -07:00
Bill Richardson
856e072e81 Add test framework for bmpblk_utility.
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
2011-02-07 15:39:45 -08:00
Che-Liang Chiou
34be8273e0 Import firmware compiler flags
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
2011-01-27 16:44:36 +08:00
Chris Sosa
9f1973e271 Revert "Import firmware compiler flags"
This reverts commit 440ad516c4.

BUG=
TEST=

Review URL: http://codereview.chromium.org/6396002

Change-Id: I6b241e418cbba62c9dc82549f2a5c7a9485db1df
2011-01-26 18:54:57 -08:00
Che-Liang Chiou
440ad516c4 Import firmware compiler flags
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
2011-01-27 10:23:51 +08:00
Che-Liang Chiou
0a0e8d0bb2 Add firmware build mode to Makefiles
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
2010-11-30 09:30:45 +08:00
Che-Liang Chiou
89678602e6 Fix integration bugs (vboot side)
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
2010-11-09 08:33:36 +08:00
Luigi Semenzato
5896b9664d Added new commands and reactivated full rebuild after fixing for ARM ebuild.
Review URL: http://codereview.chromium.org/3116025

Change-Id: Ideb82562f6b1c3ce5cd9e0b79de250d0a7bd976e
2010-08-25 07:16:03 -07:00
David Rochberg
dd4cfdffab Temporarily remove problematic line while semenzato generates a real fix.
TBR: semenzato

BUG=None
TEST=emerge-arm-generic vboot_reference

Review URL: http://codereview.chromium.org/3069027
2010-08-04 13:38:48 -04:00
Luigi Semenzato
50d48feb9e Various bug fixes to tpm_lite. Some changes to the test suite.
Review URL: http://codereview.chromium.org/3091004
2010-08-04 08:35:12 -07:00
vbendeb
b2b0fcc0f6 Introduce ability to change the kernel command line.
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
2010-07-15 15:09:47 -07:00
Randall Spangler
39f66114c0 Add tpm lite to vboot reference
Review URL: http://codereview.chromium.org/2919010
2010-07-14 09:10:23 -07:00
Luigi Semenzato
18b814d9bc New targets to compile and install rollback tests only with USE=rbtest emerge ...
Review URL: http://codereview.chromium.org/2962002
2010-07-08 17:17:02 -07:00
Randall Spangler
93bccfc452 Fix makefiles to work with ebuild
Review URL: http://codereview.chromium.org/2951002
2010-07-08 15:26:35 -07:00
Randall Spangler
6832511d3f Also need to disable calling make tests install.
Review URL: http://codereview.chromium.org/2913005
2010-07-08 15:15:53 -07:00
Luigi Semenzato
416f681882 This test sets the TPM to a each of a large amount of "interesting" initial 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
2010-07-08 12:12:12 -07:00
Bill Richardson
a08b5c9d03 Adding --repack and --headeronly options to vbutil_kernel
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
2010-06-30 21:59:43 -07:00
vbendeb
3ecaf776d8 Make vboot_reference build in MSVC command line environment.
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
2010-06-24 16:19:53 -07:00
Randall Spangler
e2ec98412e Add VBDEBUG macro for debug output.
Replaced in firmware/ lib; not replaced in host-side utils/tests.

Review URL: http://codereview.chromium.org/2810026
2010-06-23 21:17:07 -07:00
Randall Spangler
d0dae7a438 More cleanup of MSVC errors
Review URL: http://codereview.chromium.org/2871019
2010-06-21 18:25:31 -07:00
vbendeb
6216f5abe9 Include BIOS specific definitions when required.
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
2010-06-21 08:40:26 -07:00