Commit Graph

585 Commits

Author SHA1 Message Date
Che-Liang Chiou
7d1c22b75a Fix compiler error
BUG=chromium-os:17304
TEST=make successfully

Change-Id: Icebd25069a445960eb4e1e92f10dec195ea3fbf1
Reviewed-on: http://gerrit.chromium.org/gerrit/4152
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-07-14 21:41:57 -07:00
Randall Spangler
8bf0d5ff0f Add vboot support for RO-normal code path.
BUG=chromium-os:17304
TEST=make && make runtests

Change-Id: I4d0f8afd516649fba67119845ec1c4479ba54c43
Reviewed-on: http://gerrit.chromium.org/gerrit/4065
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-07-14 17:07:10 -07:00
Olof Johansson
3a6e2f10b2 arm: convert to new device tree usage
This also includes reading the nonvolatile storage from disk instead of
through the device-tree, since it's not updated there.

BUG=none
TEST=read and write a few crossystem variables

Change-Id: I6836a6eb0c92a0560dd393e694690a694bdb77a6
Reviewed-on: http://gerrit.chromium.org/gerrit/4078
Tested-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
2011-07-14 01:13:27 -07:00
Randall Spangler
a712e01ae7 Add support for flags in the firmware preamble.
The old (v2.0) parser is compatible with new (v2.1) structs.  That is,
this won't break existing firmware or vbutil_firmware.

A new (v2.1) parser parsing an old (v2.0) struct will return 0 for the
flags.

This will be used to support the RO-normal code path in a subsequent CL.

BUG=chromium-os:17304
TEST=added unit tests; make && make runtests

Change-Id: I73bcd8acd3330b0d7d143061b5ef838e6d79cf1a
Reviewed-on: http://gerrit.chromium.org/gerrit/4030
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-07-13 10:13:12 -07:00
Rong Chang
d70241f37d Introduce arm fdt support in crossystem utility
This CL builds upon recent changes in u-boot and kernel. (see issue
ids: 15744, 16665)

 - Remove /sys/kernel/debug/chromeos_arm share memory mechanism
 - Load properties from /proc/device-tree/crossystem/*
 - Write NVCXT to /dev/mmcblk0:lba[0]

BUG=chromium-os:17300
TEST=manual

Run crossystem on device console. Check current values of gpio
switches. All other values are exported from FDT directly.

Change-Id: Ib8db4a4aeb6dc36308ad8882403cb2f5978a5c70
Signed-off-by: Rong Chang <rongchang@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/3676
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
2011-07-11 21:38:29 -07:00
Randall Spangler
64ca788195 Add support for merged normal+dev firmware
BUG=chromium-os:17457
TEST=make && make runtests

When this is merged into an actual firmware build, can test it:
* dev switch off -> no dev screen, won't boot self-signed kernel
* dev switch on --> dev warning screen, will boot self-signed kernel
(e.g., it acts like the Cr-48)

Change-Id: I985428256e48b7e05dd4d8fe582a0c0103bf5fb2
Reviewed-on: http://gerrit.chromium.org/gerrit/3901
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-07-11 18:16:56 -07:00
Randall Spangler
daa807c51e Add support for dev_boot_usb flag
BUG=chromium-os:17433
TEST=make && make runtests.  Additional manual tests:

0. Insert a valid dev-signed USB key.

1. Boot with dev switch off.
`crossystem dev_boot_usb` should print 0.

2. Flip dev switch on.
`crossystem dev_boot_usb` should print 0.
Ctrl+U at dev screen should beep, but not boot USB.

3. Type `crossystem dev_boot_usb=1`.  Should succeed.
`crossystem dev_boot_usb` should print 1.

4. Reboot system.
At the dev mode warning, press Ctrl+U
System should boot from USB key
`crossystem dev_boot_usb` should print 0.

5. Flip dev switch off.
`crossystem dev_boot_usb` should print 0.

6. Flip dev switch on.
`crossystem dev_boot_usb` should print 0.

Note that this does not apply to Cr-48, Alex, or ZGB.

Change-Id: Idf85fdd642f38f531c89e5fa5b1679e84936d4da
Reviewed-on: http://gerrit.chromium.org/gerrit/3875
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-07-11 18:16:03 -07:00
Randall Spangler
9619112a57 Vboot wrapper - add recovery reason, refactor timing
Pressing Tab at a firmware screen now displays real data, including
the recovery reason, HWID, and contents of VbNvStorage.

Entry point start/end time tracking in VbSharedData now refers to the
new wrapper APIs.

Added capability for calling firmware to request recovery mode (for
example, if it's unable to initialize RAM, can't find the SSD, etc.).
Previously, calling firmware had no (good) way to do this other than
faking the recovery button being pressed.

BUG=chromium-os:17018
TEST=emerge on x86 and tegra2_seaboard

Change-Id: I7d377f279842b30a10d945d13571c41c464633f1
Reviewed-on: http://gerrit.chromium.org/gerrit/3814
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-07-08 16:19:07 -07:00
Randall Spangler
1b1998dff0 Vboot wrapper initial implementation
Patch 1: Initial change
Patch 2: Fix comment in vboot_struct.h
Patch 3: Revert files unintentionally reverted
Patch 4: (rebase)
Patch 5: (rebase)
Patch 6: Revert files unintentionally reverted (again)
Patch 7: Fix mocked tlcl for ARM build

BUG=chromium-os:17010
TEST=make && make runtests; works on H2C; emerge-tegra2_seaboard chromeos-bootimage compiles

Change-Id: I6e5ce72d41b9297c07a3f330a881eba68cfabee2
Reviewed-on: http://gerrit.chromium.org/gerrit/3593
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-07-08 13:31:36 -07:00
Randall Spangler
e49e8af65f Port vboot_reference to use new wrapper API utility functions
Third time's the charm.  Now that we've moved to u-boot-next, this
won't break the ARM build.

BUG=chromium-os:17006
TEST=make && make runtests; emerge vboot_reference; emerge-tegra2_seaboard chromeos-bootimage

Change-Id: Ib4fa26c7a23868dd2ffd2b321ee8dc08c66ea322
Original-Change-Id: I771085dcdf79d9592de64f35e3b758111a80dd9f
Original-Reviewed-on: http://gerrit.chromium.org/gerrit/3263
Original-Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/3803
Tested-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2011-07-08 13:13:15 -07:00
Randall Spangler
4ae77c50cd Fix compiler warning in vboot_reference
BUG=none
TEST=none

Change-Id: I60089b4bfb5f4ba2f0df66f335794b3fed1495f3
Reviewed-on: http://gerrit.chromium.org/gerrit/3787
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-07-08 09:33:35 -07:00
Randall Spangler
bebe53c919 Add string utility functions.
These are used by the coming-soon vboot wrapper (vboot_api_kernel) to
display debug information when Tab is pressed at a BIOS screen.

BUG=chromium-os:17035
TEST=make && make runtests (runs new test!)

Change-Id: I4893f31e9333f4e9d458a6e347213eef22f770cd
Reviewed-on: http://gerrit.chromium.org/gerrit/3759
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-07-08 09:17:07 -07:00
Gabe Black
93cf15e9a1 Introduce GUID type for Chrome OS read/write firmware.
This change teaches cgpt a new GUID type to be used for the Chrome OS
read/write firmware. The GUID is CAB6E88E-ABF3-4102-A07A-D4BB9BE3C1D3.

BUG=chrome-os-partner:4843
TEST=Built and installed on my host, used a separate change to repurpose
partition 11 for the R/W firmware using cgpt and the "firmware" type, inspected
the image using cgpt. Built and installed an image and used cgpt on the device
to inspect it's GPT.

Signed-off-by: Gabe Black <gabeblack@google.com>

Change-Id: I3b2801b2e1f71b3275bbddbc45fb63bde5bce5a7
Reviewed-on: http://gerrit.chromium.org/gerrit/3763
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2011-07-07 16:33:47 -07:00
Luigi Semenzato
ebb1eda9bb Reduce race conditions in TPM initialization.
With this change, the firmware creates and initializes the kernel space first,
then the firmware space.  Thus, if the initialization is interrupted (by
cutting power) in between the two spaces, at the next boot the initialization
path will be taken again, since it is triggered by a missing firmware space.
A space creation succeeds when the space already exists (the space is
removed and recreated), so this eliminates two races.  There is still
the possibility that the power is cut between creating the firmware
space and initializing it, but let's assume it's not a problem until
proven otherwise.  (It won't be a security problem anyhow.)

BUG=chromium-os:17049
TEST=none (too hard to reproduce the race)

Change-Id: Iae4c1cc2b9a5056cb5d858e71b680e27a442357e
Reviewed-on: http://gerrit.chromium.org/gerrit/3520
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
2011-07-06 11:02:48 -07:00
Randall Spangler
cfd841d3c2 Revert "Verified boot wrapper - replace utility functions"
This reverts commit 0184886c8cb35e8e01d610622df448a7cb063e06

(This works with uboot-next, but not uboot, which doesn't implement its half of the new wrapper API.  So rolling back to leave uboot working.

Change-Id: I1f9e3c63e5bbdb20b9195cd68787bef89f24afee
Reviewed-on: http://gerrit.chromium.org/gerrit/3588
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-07-01 15:36:42 -07:00
Randall Spangler
f8c6549159 Verified boot wrapper - replace utility functions
This is part 3 of the vboot wrapper API refactoring.  It replaces the
function calls to utility.c functions with new API calls.  (It also
fixes up some integer type mismatches in cryptolib that were causing
warnings on the H2C build; those had been fixed a while ago in H2C but
hadn't been propagated across.)

This is a re-commit of the original; I've verified it compiles on both
x86-alex and tegra2, for both vboot_reference and
vboot_reference-firmware, now that the patch from
1c1a883bc7 is checked in.

BUG=chromium-os:17006
TEST=make && make runtests, and emerged on both x86-alex and tegra2

Original-Change-Id: I771085dcdf79d9592de64f35e3b758111a80dd9f
Original-Reviewed-on: http://gerrit.chromium.org/gerrit/3263
Original-Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
(cherry picked from commit bd81b3a7d3)

Change-Id: Iefdbfb3d10eb9aa385fb6dfc3bf0896f637cb64b
Reviewed-on: http://gerrit.chromium.org/gerrit/3582
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-07-01 14:33:12 -07:00
Hung-Te Lin
a7a879e0fb make_dev_ssd: support new %U parameter
The %U is better since arm and x86 both supports it now.

BUG=chromium-os:15683
TEST=./make_dev_ssd.sh # need latest kernel patch

Change-Id: I94a6471788d3496cfa7ef263493e89877bb2b593
Reviewed-on: http://gerrit.chromium.org/gerrit/3551
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2011-07-01 03:12:03 -07:00
Hung-Te Lin
c3b877d8cb make_dev_ssd: fix ARM device names
BUG=chromium-os:15061
TEST=(on arm) ./make_dev_ssd.sh --remove_rootfs_verification # works

Change-Id: I0ed5e02cd566c89b2604a2e77b87413dc957471e
Reviewed-on: http://gerrit.chromium.org/gerrit/3375
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2011-06-30 18:15:54 -07:00
Hung-Te Lin
fbb52dfa9c crossystem: fix VbSharedDataHeader size
The content in VbSharedMem should be VbSharedData instead of FMAP.

BUG=chromium-os:17168
TEST=crossystem # seeing correct value
     (the test need a u-boot with fix included)

Change-Id: I3d7d1eb2b35c9475c2047e9479cee69464da20b1
Reviewed-on: http://gerrit.chromium.org/gerrit/3436
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2011-06-30 03:52:51 -07:00
mukesh agrawal
a7b9481f34 Revert "Verified boot wrapper - replace utility functions"
This reverts commit bd81b3a7d3.

Change-Id: I2be2c076a37bf0e49569248691fceac417254f0b
Reviewed-on: http://gerrit.chromium.org/gerrit/3295
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
2011-06-27 20:02:36 -07:00
Randall Spangler
1c1a883bc7 Fix ARM build for vboot_reference crossystem lib
BUG=none
TEST=none

Change-Id: I655cd69a0e1d2a3ad6ce9f326cbd989fc8ecb43d
Reviewed-on: http://gerrit.chromium.org/gerrit/3270
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-06-27 15:51:38 -07:00
Randall Spangler
bd81b3a7d3 Verified boot wrapper - replace utility functions
This is part 3 of the vboot wrapper API refactoring.  It replaces the
function calls to utility.c functions with new API calls.  (It also
fixes up some integer type mismatches in cryptolib that were causing
warnings on the H2C build; those had been fixed a while ago in H2C but
hadn't been propagated across.)

BUG=chromium-os:17006
TEST=make && make runtests

Change-Id: I771085dcdf79d9592de64f35e3b758111a80dd9f
Reviewed-on: http://gerrit.chromium.org/gerrit/3263
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-06-27 14:57:50 -07:00
Randall Spangler
32a6526d25 Verified boot wrapper - add stub implementations for host
This is part 2 of the wrapper API refactor.  It adds stub
implementations for the host, and changes the host-side utilities to
use them.  Firmware implementation is unchanged in this CL (other than
a few updates to macros).

BUG=chromium_os:16997
TEST=make && make runtests

Change-Id: I63989bd11de1f2239ddae256beaccd31bfb5acef
Reviewed-on: http://gerrit.chromium.org/gerrit/3256
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-06-27 13:30:41 -07:00
Randall Spangler
7adcc60e6f Vboot wrapper API - crossystem and header files
Header file changes for wrapper API implementation

Crossystem support for reading recovery reason from VbSharedData, and
explicit support for version 1 VbSharedData structs.

BUG=chromium-os:16970
TEST=make && make runtests; run crossystem on Alex and make sure it still reports recovery_reason in recovery mode.

Change-Id: I15195b899583e425d3c9e8df09842d764528e2cb
Reviewed-on: http://gerrit.chromium.org/gerrit/3203
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-06-27 09:24:28 -07:00
Luigi Semenzato
c76136cd0d Produce better error message when TPM device cannot be opened.
BUG=chromium-os:16925
TEST=run "tpmc getvf" before stopping tcsd and observe that the error message no longer says "forgot to call TlclLibInit()"

Change-Id: I867c010c07286c0aa4cec49dda60524de1c2bec1
Reviewed-on: http://gerrit.chromium.org/gerrit/3147
Tested-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2011-06-24 14:03:36 -07:00
Randall Spangler
a45ee21bb0 Vboot wrapper API
New APIs for the wrapper funtions (VbSelectFirmware() and
VbSelectKernel()) and the APIs for the firmware services they need.

BUG=none
TEST=none

Change-Id: Id8ddc456d062095b12495dd534e21342b5490aee
Reviewed-on: http://gerrit.chromium.org/gerrit/2195
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-06-23 16:08:51 -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
Bill Richardson
f155ab3a26 Add vbutil_what_keys utility to figure out how a disk image is signed.
BUG=none
TEST=none

Change-Id: I8a2e0d07384f0437064b964c6b292af9c3a67ea1
Reviewed-on: http://gerrit.chromium.org/gerrit/2802
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
2011-06-17 10:22:22 -07:00
Rajesh Chenna
8fbdc10eba Firmware generate script for boot scenarios.
BUG=16488
TEST=Manual. Run firmware_boot.sh <BIOS name without .fd extension>

Change-Id: Iff4751803782d0f65bf4469e845100d40ae9cb6c
Reviewed-on: http://gerrit.chromium.org/gerrit/2618
Tested-by: Rajesh Chenna <rchenna@chromium.org>
Reviewed-by: Rajesh Chenna <rchenna@chromium.org>
2011-06-14 16:28:56 -07:00
Bill Richardson
9a2c3b25fd Add -p option to dump_fmap to make output prettier.
BUG=chromium-os:16456
TEST=manual

To test: run dump_fmap with and without the '-p' option.

Without -p, the output looks like this:

  area:            14
  area_offset:     0x00110000
  area_size:       0x000f0000 (983040)
  area_name:       RW_SECTION_B
  area:            15
  area_offset:     0x00110000
  area_size:       0x00010000 (65536)
  area_name:       VBLOCK_B

With -p, the output looks like this:

  RW_SECTION_B 1114112 983040
  VBLOCK_B 1114112 65536

Change-Id: I53a3527fa92d22fef16563b0a950366a3a3db8a4
Reviewed-on: http://gerrit.chromium.org/gerrit/2545
Tested-by: Rajesh Chenna <rchenna@google.com>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2011-06-13 13:02:45 -07:00
Kazuhiro Inaba
53306d984f Fix compilation failure of mocked_tlcl.c
BUG=none
TEST=none

Change-Id: I97d1c95eda62439e4f3ae23bf4f39bb4451acea7
Reviewed-on: http://gerrit.chromium.org/gerrit/2522
Tested-by: Takayoshi Kochi <kochi@chromium.org>
Reviewed-by: Takayoshi Kochi <kochi@chromium.org>
2011-06-12 21:53:22 -07:00
Gaurav Shah
3cac6e7289 kernel command line test: add optional regular expression parameter support
Add support for matching an optional kernel command line parameter that must
be matched via a regular expression.

BUG=none
TEST=manually on R12, R13 and R14 recovery images. Tests pass.

Change-Id: I82c1e6c9bd98f41912ab2054840fb2edec4698d9
Reviewed-on: http://gerrit.chromium.org/gerrit/2474
Reviewed-by: Jim Hebert <jimhebert@chromium.org>
Tested-by: Gaurav Shah <gauravsh@chromium.org>
2011-06-10 15:37:18 -07:00
Vadim Bendebury
ad3e3ac8a3 Expand dev_debug_vboot to cover both x86 and arm platforms.
The script needs to use proper device names when looking for
'hard drive' and USB storage. This change makes these names
platforms specific. Another change is to look for the USB device
when running off SSD and include it in report if found.

BUG=chromium-os:15896
TEST=manual

Ran dev_debug_vboot in the four permutations (on Alex or Kaen,
off USB or SSD), observed expected results reported, for instance
when running off USB stick on Kaen with a valid system installed
on the SSD partitions 2/4:

localhost chronos # dev_debug_vboot
Saving verbose log as /tmp/debug_vboot_IhtMvRsGt/noisy.log
Extracting BIOS image from flash...
Extracting kernel images from drives...
Extracting BIOS components...
Pulling root and recovery keys from GBB...
Verify firmware A with root key... OK
Verify firmware B with root key... OK
Test kernel_subkey_a.vbpubk... OK
Test kernel_subkey_b.vbpubk... OK
Test hd_kern_a.blob... OK
Test hd_kern_b.blob... OK
Test usb_kern_a.blob... OK
Verify hd_kern_a.blob with kernel_subkey_a.vbpubk... OK
Verify hd_kern_b.blob with kernel_subkey_a.vbpubk... FAILED
Verify usb_kern_a.blob with kernel_subkey_a.vbpubk... FAILED
Verify hd_kern_a.blob with kernel_subkey_b.vbpubk... OK
Verify hd_kern_b.blob with kernel_subkey_b.vbpubk... FAILED
Verify usb_kern_a.blob with kernel_subkey_b.vbpubk... FAILED
Verify hd_kern_a.blob with recoverykey.vbpubk... FAILED
Verify hd_kern_b.blob with recoverykey.vbpubk... FAILED
Verify usb_kern_a.blob with recoverykey.vbpubk... OK
exporting log file as /var/log/debug_vboot_noisy.log

On the same system after corrupting the SSD kernel:
localhost tmp # dev_debug_vboot
Saving verbose log as /tmp/debug_vboot_uLSfFS2g9/noisy.log
Extracting BIOS image from flash...
Extracting kernel images from drives...
Extracting BIOS components...
Pulling root and recovery keys from GBB...
Verify firmware A with root key... OK
Verify firmware B with root key... OK
Test kernel_subkey_a.vbpubk... OK
Test kernel_subkey_b.vbpubk... OK
Test hd_kern_a.blob... FAILED
Test hd_kern_b.blob... OK
Test usb_kern_a.blob... OK
Verify hd_kern_a.blob with kernel_subkey_a.vbpubk... FAILED
Verify hd_kern_b.blob with kernel_subkey_a.vbpubk... FAILED
Verify usb_kern_a.blob with kernel_subkey_a.vbpubk... FAILED
Verify hd_kern_a.blob with kernel_subkey_b.vbpubk... FAILED
Verify hd_kern_b.blob with kernel_subkey_b.vbpubk... FAILED
Verify usb_kern_a.blob with kernel_subkey_b.vbpubk... FAILED
Verify hd_kern_a.blob with recoverykey.vbpubk... FAILED
Verify hd_kern_b.blob with recoverykey.vbpubk... FAILED
Verify usb_kern_a.blob with recoverykey.vbpubk... OK
exporting log file as /var/log/debug_vboot_noisy.log

Change-Id: I4f4cd2377c6acf3db433d629ed0a5c43a5d1a76c
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/1938
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2011-06-02 11:28:57 -07:00
Gaurav Shah
6bd03d4a88 Update the install kernel on the recovery image with the right vblock
This avoids the need to read the vblock off the stateful partition to
re-construct the right SSD install kernel. The recovery installer can
also perform its verification checks (e.g. rollback to old version)
by directly reading kernel partition B instead of re-constructing it by
mounting the stateful partition.

We still copy the SSD vblock on the stateful for tools that still use
them (by overwriting the SSD kernel vblock). That operation is basically a
no-op now. This unnecessary step will be removed from the tools as part of
separate CLs.

BUG=chromium-os:8378, chrome-os-partner:3309
TEST=signed a new recovery image, made sure it installs

Change-Id: Ic4308fba1355f67a3b2821ae7e8d438bf658b0d1
Reviewed-on: http://gerrit.chromium.org/gerrit/1648
Tested-by: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
2011-06-01 15:33:58 -07:00
Luigi Semenzato
7b90cf3f00 Tolerate lack of TPM reset in common cases.
This is a temporary workaround for Tegra boards that don't reset the TPM
when the CPU is reset.  It makes the firmware more lenient when execution
starts with an already locked TPM.

BUG=chromeos-partner:3574
TEST=none (yet)

Change-Id: If6a060595c1eb41e95e0935f8467de8bb6256b12
Reviewed-on: http://gerrit.chromium.org/gerrit/1429
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
2011-05-25 17:21:13 -07:00
Nick Sanders
a78123412d Allow ARM uuid find
BUG=chromium-os:15268
TEST=not yet

Change-Id: I09c821fe58145bdfd65536e3c3c02d36fcd881ed
Reviewed-on: http://gerrit.chromium.org/gerrit/1541
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
2011-05-25 16:26:41 -07:00
Doug Anderson
cbc86f786c Fixed compiler warning in v-boot reference.
The error was:
  arch/arm/lib/crossystem_arch.c: In function ‘VbReadSharedMemory’:
  arch/arm/lib/crossystem_arch.c:134: error: format ‘%d’ expects type ‘int’, but argument 5 has type ‘long unsigned int’

BUG=none
TEST=(outside choot): cd src/platform/vboot_reference; make

Change-Id: I5e1f69abd125fe06cf6ae04a7946568bdbcef83e
Reviewed-on: http://gerrit.chromium.org/gerrit/1547
Tested-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2011-05-25 13:21:11 -07:00
Che-Liang Chiou
a7b612a29d enhance pack_firmware_image
* including fmap header in fmap areas
* initializing blobs by string value

BUG=chromium-os:15633
TEST=emerge-tegra2_{seaboard,kaen} chromeos-bios

Change-Id: Ib87a3f60fb11804888c4bc023d595629e017f589
Reviewed-on: http://gerrit.chromium.org/gerrit/1427
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-05-24 02:07:08 -07:00
Gabe Black
27b0dce002 Add a biosincludes.h header file for x86 (i386).
The types used in this file are based off of standard Linux header files for
32 bit x86 (i386) under the assumption that the types generated by gcc will be
the right size.

BUG=chrome-os-partner:3895
TEST=Built vboot_reference for x86-mario and saw it succeed.

Change-Id: I948652d4ecd50391ac8797efd91192d4c900a8ca
Reviewed-on: http://gerrit.chromium.org/gerrit/1337
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2011-05-23 00:18:38 -07:00
Che-Liang Chiou
78b05174b7 crossystem: arm: fix incorrect mainfw_act output
BUG=chromium-os:15626
TEST=manual

when not recovery boot
$ [ $(crossystem mainfw_act) = "A" ] || [ $(crossystem mainfw_act) = "B" ]

when recovery boot
$ [ $(crossystem mainfw_act) = "recovery" ]

Change-Id: I3917106b61e2979d8cb07f01fd0cec044ae725cb
Reviewed-on: http://gerrit.chromium.org/gerrit/1345
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2011-05-22 20:24:17 -07:00
Vadim Bendebury
a3ec5c40f8 Ensure ARM crossystem gpio readings match u-boot.
U-boot and crossystem interpret the same switch state differently
for 'recovery mode' and 'write protect', This change adds the
ability to invert certan GPIO readings such that crossystem and
u-boot return the same values.

BUG=chromium-os:15393
TEST=manual

Running crossystem on the target with developer u-boot image:

- observe that recoverysw_cur reading matches recoverysw_boot and
  wpsw_cur reading matches_wpsw_boot.

- try rebooting with recovery or developer mode buttons pressed,
  observe the change in reported values of devsw_boot and
  recoverysw_boot.

- observe reported values of devsw_cur and recoverysw_cur
  following pressing of the buttons.

Change-Id: I628f59b60008719bbff1722d23154ce934af6c36
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/1193
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2011-05-19 13:39:40 -07:00
Bill Richardson
8ba3d790e1 Add locale_string decoder into BmpBlock.
This change adds an additional (optional) section to the .yaml file which
can enumerate the names of the locales. If present, these names will be
appended to the end of the bmpblock and the (new) locale_string_offset field
in the BmpBlockHeader will point to it. The names are encoded as a series of
null-terminated ASCII strings. The end of the series is indicated by an
extra null (for example, "en_US\0fr\0\0" names two locales).

The BIOS does not use this information. Factory or OOBE could use it to
select the initiale locale for the BIOS screens from the list of locales
included in the BmpBlock.

BUG=chrome-os-partner:3868
TEST=none

Change-Id: I34fd9ece27343d56ec43772de975ac6f2ad7c9a6
Reviewed-on: http://gerrit.chromium.org/gerrit/1156
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
2011-05-19 08:37:14 -07:00
Che-Liang Chiou
c3fb9a2690 load_firmware_test accepts boot flag input
BUG=none
TEST=emerge vboot_reference && load_firmware_test -b 1 image.bin

Change-Id: Iec4730dad335770eb04151fe66875dfb09ceedca
Reviewed-on: http://gerrit.chromium.org/gerrit/916
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-05-17 19:50:23 -07:00
Randall Spangler
c90e7e8cd9 Fix indentation; no code change.
BUG=none
TEST=none (since nothing changed)

Change-Id: Ifea9a0c0105e70d9cea2b173d0991849770dc14b
Reviewed-on: http://gerrit.chromium.org/gerrit/1067
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-05-17 15:29:58 -07:00
Gaurav Shah
9dc90d36f8 Add /sbin and /usr/sbin to the search path
Some tools (such as dumpe2fs) may reside in paths that are not in the system
non-root path.

BUG=chromium-os:13564
TEST=Can now run sign_official_build without sudo.

Change-Id: I48737e7735551c9004a6fa19359da664ca67b423
Reviewed-on: http://gerrit.chromium.org/gerrit/867
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Gaurav Shah <gauravsh@chromium.org>
2011-05-13 16:47:04 -07:00
Randall Spangler
7ecb39d419 Check whether key block and preamble fit in padding.
Also add --pad as a valid option to --repack and --verify, so that
kernels with larger-than-normal padding can be verified.

BUG=chromium-os:13720
TEST=see bug 13720

Using the supplied kernel images from the bug,

vbutil_kernel --verify 007 --debug
vbutil_kernel --verify 008 --debug

These should now fail with an error that the key block extends past the padding.

Next, supply a large enough padding size that the key block and
preamble fit.  For example:

vbutil_kernel --verify 007 --pad 0x900000 --debug
vbutil_kernel --verify 008 --pad 0x900000 --debug

These should now make it past the padding check, and fail on a
subsequent test (for example, no kernel blob found).

Change-Id: I7ec32b4def29970e302bf922b96d3e206d97fe82
Reviewed-on: http://gerrit.chromium.org/gerrit/810
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-05-13 12:49:22 -07:00
Randall Spangler
ae87b92cbe Add --minversion option to vbutil_kernel to check for rollback.
BUG=chrome-os-partner:3309
TEST=manual:

1. Extract a kernel partition from an image, for example, using
unpack_partitions.sh.  Or if running this on a device, use /dev/sda2
or /dev/sda4 for the kernel filename.

2. vbutil_kernel --verify part_2

3. Note the data key version and kernel version printed.  For example,

  Data key version:    1
  Kernel version:      3

4. Test specifying the same version.  This should succeed.

   vbutil_kernel --verify part_2 --minversion 0x00010003

5. Test specifying a higher data key version.  This should fail with a
data key version error.

   vbutil_kernel --verify part_2 --minversion 0x00020003

6. Test specifying a higher kernel version.  This should fail with a
kernel version error.

   vbutil_kernel --verify part_2 --minversion 0x00010004

Change-Id: I7b69041cf41527fc59ad29995135f30d9f496fac
Reviewed-on: http://gerrit.chromium.org/gerrit/792
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-05-12 15:08:28 -07:00
Randall Spangler
4dd03035c2 Fix build break
BUG=none
TEST=emerge-x86-generic vboot_reference

Change-Id: Ic34f0aedbb6522e2ac4bbea3cb33f303435a0d33
Reviewed-on: http://gerrit.chromium.org/gerrit/608
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-05-10 12:56:01 -07:00
Randall Spangler
9243e616d7 Add more specific recovery reasons for RW firmware invalid
BUG=chrome-os-partner:3698
TEST=manual

1. Run the firmware key/version autoupdate test; this rolls forward your stored TPM version numbers.
2. Put back the original firmware.
3. Reboot.
4. Press TAB at recovery screen.
5. Should see Recovery Reason 0x14.

Change-Id: I7791f594dbd8919e74d1e6b97b99775cf1e73d1d
Reviewed-on: http://gerrit.chromium.org/gerrit/567
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-05-10 12:23:56 -07:00