Commit Graph

1662 Commits

Author SHA1 Message Date
Bill Richardson
a4090b5a61 Addtional -h args to dump_fmap will ignore overlap errors.
Snow was built with overlapping regions in its FMAP, so when we use
dump_fmap -h to see what the layout is, it complains and dies. This change
lets it keep going if you give it multiple -h args. Nothing else is different.

BUG=none
BRANCH=none
TEST=manual

This complains and quits:

  dump_fmap -h image-snow.bin

This complains and keeps going:

  dump_fmap -hh image-snow.bin

Change-Id: Ia4592b9ba6963b8c5064dd6f51625e9495db2845
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39551
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-12-11 11:13:12 -08:00
Kees Cook
34d515c5c1 mount-encrypted: retry TPM open
If the TPM hits an error other than ENOENT during open(), retry for 5
seconds with 100ms polling delays. Also switch to on-demand opening
of TPM, so umount will not hit delays if tcsd keeps the TPM open at
shutdown time.

BUG=chrome-os-partner:15960
TEST=daisy build, mount ok with kernel patched to return EBUSY for a few
 opens, platform_EncryptedStateful passes.
BRANCH=None

Change-Id: Ia597622bb54ccc4366be2a0c960c518406e6c0b2
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39445
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
2012-12-10 13:56:47 -08:00
Kees Cook
00cc72894f Tlcl: allow OS failures to bubble up to caller
If there were any errors communicating with the TPM at the OS layer
(open, read, write failures), the library would immediately exit, not
allowing the caller to make any decisions about how to handle it. This
introduces a way to initialize the library so that errors will get passed
back up to the caller instead of unceremoniously exiting.

Setting the environment variable "TPM_NO_EXIT=1" enables the feature. To
avoid needing to implement supporting functions in all backends, the
feature is currently limited to just the Tlcl stub implementation.

In the case of mount-encrypted, it can now survive the kernel returning
read/write failures. In the past it had only worked around having open
fail, but that has now been replaced with more sensible logic instead of
the environment variable trickiness.

BUG=chrome-os-partner:15960
TEST=daisy built with an always-failing kernel driver, u-boot builds too
BRANCH=None

Change-Id: Ic7b217017537980f9c239d678067398613045676
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/38791
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
2012-11-28 21:35:49 -08:00
Kees Cook
ca44b077a8 mount-encrypted: add error reporting to RNG failures
In the case of the TPM getting into a permanent failure mode
(e.g. crosbug.com/p/15785), the entropy system was not trying harder to
get entropy (i.e. falling back to system RNG), and was just using
whatever happened to be on the stack.

This adds the system RNG to the fallback list:
- try TPM RNG
- try system RNG
- use uninitialized stack contents

The reason for the last one being used is so we can make sure we're
getting a system up. It is extremely unlikely for both the TPM and
the system RNGs to be broken and if they are, it's likely a relatively
permanent failure condition. If we abort in this state, we'll cause an
infinite repair loop which is a very bad user experience. Instead, get
the system up using terrible entropy so the conditions can be examined.

BUG=chrome-os-partner:15960
TEST=daisy build with instrumented kernel tpm driver to always fail
BRANCH=none

Change-Id: I92c454925a78bb0d94262cdb3914c1b72010450e
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/38751
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
2012-11-27 14:53:22 -08:00
Paul Taysom
8a42c2718f remove verity regardless of dm device
Changed the pattern substitution to work with dm-[0-9]

BUG=chromium-os:25441
TEST=Turned off verity on stumpy both with and without bootcache
BRANCH=none

Change-Id: I519ad71879f2db847f450b869c8f7a67606f1e20
Reviewed-on: https://gerrit.chromium.org/gerrit/38691
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Paul Taysom <taysom@chromium.org>
2012-11-27 10:02:43 -08:00
Bill Richardson
640b1c4207 Add more recovery_reason codes
There are several places where the same recovery_reason was used to report
slightly different points of failure. Let's create some new codes instead.

Remember that recovery mode is handled by RO firmware, so if an updated RW
firmware uses one of the new error codes, pressing TAB at the recovery
screen will say "We have no idea what this means". That's not a bug. This CL
deprecates the original codes, so the fact that the RO firmware doesn't
recognize it just means it's a new code reported by a new RW BIOS.

BUG=chromium-os:36562
TEST=manual
BRANCH=parrot

Run

  make && make runtests

It should pass. You can test some of the error cases on actual hardware by
using

  crossystem recovery_reason=86
  reboot

and pressing TAB at the recovery screen. For that example you should see the
message

  recovery_reason: 0x56 TPM lock error in rewritable firmare

Change-Id: I123c781e6c6f6fe0284c4fd49f5f5a855eece7df
Reviewed-on: https://gerrit.chromium.org/gerrit/38652
Commit-Ready: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-11-26 12:04:42 -08:00
Kees Cook
b08c46a0da mount-encrypted: report numeric results on TPM failure
To help identify the specific failure conditions encountered when the
TPM goes weird, report them any time they are encountered.

BUG=chrome-os-partner:15960
TEST=daisy build, manual testing
BRANCH=none

Change-Id: I80b3bd23c88c19d807cbcafe8ea2736fe000e1d6
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/38468
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
2012-11-25 22:21:50 -08:00
Paul Taysom
0bbc17c69a Added handling of regex for dm params
To handle a more diverse set of configurations, added
processing of regular expressions for the dm params.

BUG=chromium-os:36441
TEST=rand security_test_image for various configurations
BRANCH=none

Change-Id: I4d9e610586cc9f63d55397e60462600ed9b9651f
Reviewed-on: https://gerrit.chromium.org/gerrit/38202
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Paul Taysom <taysom@chromium.org>
Tested-by: Paul Taysom <taysom@chromium.org>
2012-11-19 16:14:31 -08:00
Hung-Te Lin
7682e5e87a newbitmaps: Move files to new location (bmpblk).
BUG=none
TEST=none
BRANCH=none

Change-Id: I4a5ecedd4dd8e2ef866793edd825f4d5716402bf
Reviewed-on: https://gerrit.chromium.org/gerrit/38097
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-11-16 23:47:46 -08:00
Hung-Te Lin
5eaf916f52 newbitmaps: Increase font size & fix JP font.
Using PT=18 provides better screen on scaled screens.
IPAPGothic does not look good after being scaled, so let's use Droid Sans
Fallback again.

BRANCH=none
BUG=none
TEST=make # pass

Change-Id: I59f3768a14055d8f135e15b85107406d5a2d4924
Reviewed-on: https://gerrit.chromium.org/gerrit/38016
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-11-14 17:59:05 -08:00
Hung-Te Lin
8e32e75f4f newbitmaps: Get rid of ImageMagick and use PIL for image processing.
To simplify dependency (and prepare for building inside chroot), we need to get
rid of dependency for ImageMagick, which is now entirely replaceable by Python
Image Library.

BRANCH=none
BUG=none
TEST=make # pass

Change-Id: Ie3d3a4ac399b2fe58aa75f8e02e4475bcba21c51
Reviewed-on: https://gerrit.chromium.org/gerrit/37985
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-11-14 17:59:04 -08:00
Paul Stewart
0c69afc5b3 CHROMIUMOS: "flimflam" init file is now named "shill"
BUG=chromium-os:35909
TEST=None (need suggestions form semenzato)
BRANCH=none

Change-Id: Ife7c545a28fd70407ba2fe1a0a14e20df8e847f7
Reviewed-on: https://gerrit.chromium.org/gerrit/37020
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
2012-11-06 23:13:33 -08:00
Marc Jones
9754cae1c1 Add FAFT keyboard remap GBB flag
Add a new flag, 0x100, to indicate FAFT key stroke overrides.

BUG=chrome-os-partner:14056
TEST=none
BRANCH=stout

Change-Id: I76b7f3f4c51abec5528047f690f20a09b257abc2
Signed-off-by: Marc Jones <marc.jones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37074
Reviewed-by: Ronald G. Minnich <rminnich@chromium.org>
Reviewed-by: Gediminas Ramanauskas <gedis@chromium.org>
Tested-by: Gediminas Ramanauskas <gedis@chromium.org>
Commit-Ready: Marc Jones <marc.jones@se-eng.com>
2012-11-06 11:40:28 -08:00
Hung-Te Lin
3f9857420f newbitmaps: Speed up image conversion by using PIL.
Running ImageMagick + PIL is a redundant task; we should let PIL
do flatten, resize, and exporting to different format.

Before: real 11m54s, user 37m10s.
After: real 8m3s, user 16m33s.

BRANCH=none
BUG=none
TEST=make

Change-Id: I65f1e5b769161650310abca46851824755402d9b
Reviewed-on: https://gerrit.chromium.org/gerrit/37200
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-11-05 16:52:50 -08:00
Hung-Te Lin
7909cb8293 newbitmaps: Speed up make_default_yaml.
Sub-shell execution is slow. To improve shell script execution speed:
 - Replae $(expr) by $(()).
 - Cache image file data and avoid executing ImageMagick.
 - Prevent extra eval & subshell.
 - Remove bash-only syntax to allow using dash.

 # time ../make_default_yaml en
 Before change: Real 9s, User 1m7s.
 After (bash): Real 1.6s, User 8.8s.
 After (dash): Real 1.0s, User 6.9s.

BRANCH=none
BUG=none
TEST=make

Change-Id: I59626fb1a211de82cf58fcd1331a5641b97e2823
Reviewed-on: https://gerrit.chromium.org/gerrit/37006
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-11-05 16:20:11 -08:00
Hung-Te Lin
68a516a43c newbitmaps: Remove language navigation bar in TONORM_CONFIRM.
BRANCH=none
BUG=chrome-os-partner:15823
TEST=make # pass

Change-Id: Ibb998e71059146067403872386bf17659a50c0f3
Reviewed-on: https://gerrit.chromium.org/gerrit/37098
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-11-05 16:20:09 -08:00
Mike Frysinger
9e2c3b0b98 fix linking order
Libraries must come after objects when linking.  Otherwise their
references will be elided when earlier objects didn't need them.

BUG=None
TEST=`LDFLAGS=-Wl,--as-needed emerge-daisy vboot_reference` worked
BRANCH=None

Change-Id: Ic8237a767758d002cd848ed3293b17940884b609
Reviewed-on: https://gerrit.chromium.org/gerrit/37166
Reviewed-by: Kees Cook <keescook@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-11-01 19:13:17 -07:00
Hung-Te Lin
97625b69be newbitmaps: Add "USB2 only, no SD" profile.
Change *usb2 to "USB2 only, no SD" and add "*sdusb2" as "USB2 only, with SD".

Also fixed PIL conversion error on Ubuntu Precise edition.

BRANCH=none
BUG=chrome-os-partner:15738
TEST=make # pass

Change-Id: I9bc22b7f82bc6e58e6069ae6dd4951e882edb19c
Reviewed-on: https://gerrit.chromium.org/gerrit/36997
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Dave Parker <dparker@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-10-31 18:42:04 -07:00
Shawn Nematbakhsh
ba7fd8dff8 vboot_reference: Fix keyboard input lag at confirm screen.
Changing languages is terribly slow at the confirm screen, when
switching from dev to normal. Reduce sleep time to improve user
experience.

BUG=chrome-os-partner:15726
TEST=boot in dev, hit space, hit arrows rapidly to change language,
observe no lag.
BRANCH=butterfly, stout

Change-Id: I0943debc31d78dcfce87e7f7d4537ae47f5f8cfd
Reviewed-on: https://gerrit.chromium.org/gerrit/36956
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Shawn Nematbakhsh <shawnn@google.com>
Tested-by: Shawn Nematbakhsh <shawnn@google.com>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-10-30 18:23:50 -07:00
Hung-Te Lin
ca8c372e60 sign_official_build: Support signing additional RW firmware in shellball.
There will be more bios*.bin (ex, bios_rw.bin) in firmware updater, and we do
want to sign all files.

BRANCH=signer
BUG=chromium-os:35369
TEST=sign_official_build.sh ssd DEV_IMAGE ../../tests/devkeys

Change-Id: I2ea0c5c3d7a18c43df581f50b4bd907206dcd7ad
Reviewed-on: https://gerrit.chromium.org/gerrit/36890
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-10-30 15:33:29 -07:00
Luigi Semenzato
d2852eabf6 Add recovery reason for failure to correct TPM error
The TPM on snow devices may boot in an unusable state.  The workaround
is to detect this early and reboot.  The workaround code prevents
an infinite reboot loop by counting the number of reboots and entering
recovery mode with this reason after a small threshold has been reached.

BUG=chromium:156655
TEST=no test!  Not even compiled!
BRANCH=none

Change-Id: Ica2f14f8f7df8c46b7cbe5dbd578ba93c8f3a78c
Reviewed-on: https://gerrit.chromium.org/gerrit/36790
Tested-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Luigi Semenzato <semenzato@chromium.org>
2012-10-29 14:49:36 -07:00
Mike Frysinger
8b42ac8e26 Key increment scripts: fix incrementing keys not in $PWD
Part of the recent rewrite dropped changing of the active dir to
${KEY_DIR}.  Meant the scripts needed to be run inside of the key
dir since not all functions take the key dir as an argument but
instead assume they're in ${PWD}.

BUG=None
TEST=Ran increment_kernel_subkey_and_key_mp.sh and saw it work
BRANCH=None

Change-Id: Icbc02f123e999d186d9c40fd16528a134397699e
Reviewed-on: https://gerrit.chromium.org/gerrit/35803
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-10-16 23:25:29 -07:00
Kees Cook
b59d06e6e8 mount-encrypted: fix mount detection to use device
Instead of fsid, which is unpopulated for tmpfs, use device number
since that will increment for each different tmpfs.

BUG=chrome-os-partner:15192
TEST=parrot build, manual testing
BRANCH=none

Change-Id: I0024f7283c90684daaf1278d3cf6b76cc85bb253
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/35615
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
2012-10-16 11:26:39 -07:00
Kees Cook
adc6764229 mount-encrypted: handle missing TPM on Chrome OS
While not having a TPM was supported for non-Chrome devices, it was not
expected for Chrome devices. This adds logic to fail the TPM calls
before making them when the TPM is missing. The tpm_lite library doesn't
handle the TPM being missing, so we have to do this ourselves.

BUG=chrome-os-partner:15192
TEST=parrot build, verified operation after "mv /dev/tpm0 /dev/tpm0.bak"
BRANCH=none

Change-Id: I2f625305dce7fa698fcad33e412ee37c60da9bc2
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/35440
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
2012-10-12 14:24:42 -07:00
Gaurav Shah
9bf0d535fe resign_firmwarefd.sh: Fix flag option name
We didn't get bit by this bug because getlong_opt does partial matching
on long option names. So --flag also works.

BUG=none
TEST=resign a test firmware; ensure preamble flag is preserved.
BRANCH=none

Change-Id: Ifd87c627b82468529fe1241be3629198d194027b
Reviewed-on: https://gerrit.chromium.org/gerrit/35350
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Gaurav Shah <gauravsh@chromium.org>
2012-10-12 11:12:54 -07:00
Paul Taysom
212eb98136 Added patterns for bootcache
The bootcache will be changing the linux command line. Added additional
patterns that are acceptable to the signing software.

BUG=chromium-os:25441
TEST=ran security_test_image script against stumpy recovery images
BRANCH=none

Change-Id: I22d00ebc6191b5499f722974d90c260b78eb63b2
Reviewed-on: https://gerrit.chromium.org/gerrit/34959
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Paul Taysom <taysom@chromium.org>
Tested-by: Paul Taysom <taysom@chromium.org>
2012-10-09 13:45:13 -07:00
Mike Frysinger
4615b96345 signer scripts: return an error when loading configs fail
If we are given a config file that doesn't exist, return an error rather
ignoring it.  This way we don't accidentally give images a pass when we
didn't properly test them.

BUG=None
TEST=`./security_test_image --board=x86-alex --baselines=/` now shows 3 failures rather than all pass
BRANCH=None

Change-Id: I9d130db05befaeac8fcca921f0e43f47c2461f9f
Reviewed-on: https://gerrit.chromium.org/gerrit/34795
Reviewed-by: Ryan Cui <rcui@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-10-05 15:21:10 -07:00
Randall Spangler
09a8447862 crossystem devsw_cur returns devsw_boot if virtual dev switch
devsw_cur is really a meaningless concept on systems with virtual dev
switches; it exists primarily to support factory test of physical
developer switches.  However, some plugins use this instead of the
preferred devsw_boot, and it's easier to modify crossystem than the
plugins at this point in time.

BUG=chrome-os-partner:12928
BRANCH=none (affects all current products, but is an OS-level change, not FW)
TEST=manual

- On link, 'crossystem devsw_cur devsw_boot' with dev switch on -> '1 1'
- On link, 'crossystem devsw_cur devsw_boot' with dev switch off -> '0 0'
- On lumpy or earlier, 'crossystem devsw_cur' should return current dev
  switch position; check this by toggling the physical switch without
  rebooting and see that the reported value follows the switch value.

Change-Id: Ie7416e5cb03c133572c32af677b55ed18884dfb8
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34531
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2012-10-04 09:31:00 -07:00
Bill Richardson
788dbc34b0 Allow vbutil_what_keys to examine shellballs too
Currently vbutil_what_keys only displays the kernel keyblock info for disk
images. This adds a -v option (requiring sudo) to cause it to attempt to look
inside any rootfs partitions and extract the BIOS image from the shellball.

This CL also updates the list of known sha1sums.

Without -v:

  vbutil_what_keys recovery_image.bin
  IMAGE: recovery_image.bin
    part 2 kernel:   49d40533b0812d3f31232c5eedd47e7e11acc293 (!DEV DEV REC)
    part 4 kernel:   cc887372ac2d1c415eac93fc11e753629c387358 (!DEV DEV !REC)

With -v:

  vbutil_what_keys -v recovery_image.bin
  IMAGE: recovery_image.bin
    part 2 kernel:   49d40533b0812d3f31232c5eedd47e7e11acc293 (!DEV DEV REC)
    part 4 kernel:   cc887372ac2d1c415eac93fc11e753629c387358 (!DEV DEV !REC)
    part 3 shellball:
      hwid:          X86 LUMPY TEST 6638
      recovery key:  0d800afb53cdd05dd849addee0143ca1d96e893c
      root key:      4e92f07efd4a920c4e4f1ed97cf47b7b04ee1428

BUG=none
BRANCH=none
TEST=manual

This is an optional feature to a debugging utility. You can try the examples
above if you feel like testing it yourself.

Change-Id: Ie0dc918c1a99705c408314e960f4dc98aee7c1a9
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34537
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-10-03 14:37:55 -07:00
Hung-Te Lin
00311b8644 vboot_api_kernel: Print warning in Ctrl-U when dev_boot_usb is not enabled.
Ctrl-U used to simply beep without messages for why it does not work (due to NV
data dev_boot_usb). Since the system is already in Developer mode, it should be
fine to provide some debug information otherwise we can spent time trying to
figure out why the firmware doesn't work.

BRANCH=all
BUG=chrome-os-partner:14474
TEST=flash image to Link, enter DEV and press Ctrl-U; gets beep and warning messages.

Change-Id: Iab20ecdb2e1c4e267b7257a7bd241006241ddf70
Reviewed-on: https://gerrit.chromium.org/gerrit/34406
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-10-03 07:33:41 -07:00
Hung-Te Lin
cb85206ebf vboot_api_kernel: Print warning in TONORM when GBB flags force DEV.
We use gbb-flag-force-dev-switch-on in default firmware images to make
things easier for factory and some devs.

But when we request normal mode there should be some sort of warning/error
telling the user that this is not available, otherwise we can spent time trying
to figure out why the firmware doesn't work.

BRANCH=all
BUG=chrome-os-partner:14474
TEST=flash image to Link, set GBB flags to 0x39, boot to DEV screen
     and press SPACE (TONORM); gets beep and warning messages.

Change-Id: Id48c12693c7575001fae7fad92a868cb5465e83d
Reviewed-on: https://gerrit.chromium.org/gerrit/34172
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2012-09-27 19:08:01 -07:00
Mike Frysinger
283cbf89a9 sign_official_build.sh: add an update payload operation
This enables the signer script to sign update payloads.

BUG=chromium-os:34521
TEST=`./sign_official_build.sh update_payload testcase.sha256 . foo` produced a signed foo file
BRANCH=None

Change-Id: I27a9de89e760427251538deec38161944388a152
Reviewed-on: https://gerrit.chromium.org/gerrit/33535
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-09-26 16:12:48 -07:00
Vadim Bendebury
65d3c277a2 Make cgpt_add error messages a little more verbose
When the cgpt utility complaints about parameter errors, it is
impossible to tell what exactly went wrong. This change consolidates
error definitions and adds a function to convert integer error values
into text messages.

BRANCH=none
BUG=none
TEST=manual
  . emerge-link vbooot_reference
  . copy generated `cgpt' to a Link device
  . run command with wrong arguments with respect to the existing GPT:
   localhost var # ./cgpt add -i 3 -b 3985408 -s 1757184 -t rootfs -l ROOT-A /dev/sda
   ERROR: cgpt add: Starting LBA overlaps
   ERROR: cgpt add: -i 3 -l ROOT-A -b 3985408 -s 1757184 -t 3CB8E202-3B7E-47DD-8A3C-7FF2A13CFCEC
  . on the host, in the chroot in src/platform/vboot_reference run

   $ make && make runtests

   observe all tests succeed

Change-Id: Ibd23ca0430a875f70524adc99e0509b26ae699b2
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34003
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-09-26 12:02:24 -07:00
Che-Liang Chiou
210c5ef2d9 crossystem should not grumble about older firmware
Older firmware does not provide nonvolatile-context-storage FDT
property, and crossystem complains about it.

This is harmless; so just make it quiet.

Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>

BRANCH=none
BUG=chrome-os-partner:14475
TEST=manual, see blow

Run crossystem and make sure its output does not contain
  "Unable to open FDT property nonvolatile-context-storage"
messages.

Check crossystem still works by comparing its output w/ and w/o this
change.

Change-Id: I0b8f40775833457a75d801f185344e931ac08847
Reviewed-on: https://gerrit.chromium.org/gerrit/33896
Commit-Ready: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-09-24 16:29:03 -07:00
Randall Spangler
be94d55d4f Rename RANDOM_POWER_OFF to a more descriptive SAVE_LOCALE_IMMEDIATELY
--snark; no functional change.

BUG=none
TEST=build code
BRANCH=none

Change-Id: Id3a8c5aaf0e5a9d0e1949af602840efcc1895f50
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33898
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2012-09-24 11:36:39 -07:00
Stefan Reinauer
a2326ee152 Add CTRL-L in dev screen to support a "legacy boot option"
This option is disabled per default and can be enabled with
crossystem dev_boot_legacy=1
or by setting the GBB flag
GBB_FLAG_FORCE_DEV_BOOT_LEGACY      0x00000080

BUG=chrome-os-partner:6108
TEST=crossystem dev_boot_legacy=1
     boot to dev mode screen, press CTRL-L, see SeaBIOS start
     (other CLs needed)
BRANCH=link
Signed-off-by: Stefan Reinauer <reinauer@chromium.org>

Change-Id: I593d2be7cff5ca07b8d08012c4514a172bd75a38
Reviewed-on: https://gerrit.chromium.org/gerrit/31265
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Stefan Reinauer <reinauer@chromium.org>
2012-09-20 17:32:22 -07:00
Kris Rambish
40bc7b7802 Do not create the kernel data keys.
BUG=None
TEST=Ran it
BRANCH=None

Change-Id: Ib494c64d81c4ee80991a01b2172c7c47b60d5658
Reviewed-on: https://gerrit.chromium.org/gerrit/33659
Tested-by: Kris Rambish <krisr@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
2012-09-19 18:45:21 -07:00
Stefan Reinauer
b7b865cfee Support alternative GPT header signature
In order to dual boot Windows and ChromeOS, Windows must
not find a GPT partition table on the disk. So change
ChromeOS to cope with an alternative signature "CHROMEOS"
instead of the standard "EFI PART"

BUG=chrome-os-partner:6108
TEST=rebuild chromeos, install it,
     run cgpt legacy /dev/sda
     dd if=/dev/sda of=/tmp/x bs=1k
     hexdump -C /tmp/X
     see the string CHROMEOS
BRANCH=link
Signed-off-by: Stefan Reinauer <reinauer@chromium.org>

Change-Id: Ia88eff33b9880bd73a78c1b8e026c1f8298c4557
Reviewed-on: https://gerrit.chromium.org/gerrit/31264
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
2012-09-19 15:33:30 -07:00
Kris Rambish
40d8651bb3 Add scripts to increment single fm/kernel keys.
For firmware and kernel key increment testing we need to be able to
rev only particular keys and verify an autoupdate works.

BUG=None
TEST=Ran it
BRANCH=None

Change-Id: Ic814480b4bf8fbc994132fcd7ba519c3be9b0ccd
Reviewed-on: https://gerrit.chromium.org/gerrit/32458
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Kris Rambish <krisr@chromium.org>
Tested-by: Kris Rambish <krisr@chromium.org>
2012-09-18 16:05:00 -07:00
Che-Liang Chiou
770c1b772c crossystem should switch on VbNvContext storage type
We may have multiple storage types (disk or mkbp) of VbNvContext.
crossystem should switch the type and choose the corresponding device
driver.

After patching U-Boot, you may check storage type:
  [ "mkbp" = "$(cat /proc/device-tree/firmware/chromeos/nonvolatile-context-storage)" ]

And cross-verify crossystem with mosys:

  $ mosys nvram vboot read
  70000000000000000000000000000020
  $ crossystem recovery_request
  0

  $ crossystem recovery_request=123
  $ mosys nvram vboot read
  70007b0000000000000000000000005d

  $ mosys nvram vboot write 70000000000000000000000000000020
  $ crossystem recovery_request
  0

More importantly, crossystem should also work with older version of
firmware, which does not pass down this information.

Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>

BRANCH=none
BUG=chrome-os-partner:13766
TEST=Check storage type on a Snow device:
     [ "mkbp" = "$(cat /proc/device-tree/firmware/chromeos/nonvolatile-context-storage)" ]
     Make sure that FAFT is still happy:
     ./run_remote_tests.sh --remote $ADDR --board daisy 'firmware_TryFwB/control$'
     ./run_remote_tests.sh --remote $ADDR --board daisy 'firmware_TryFwB/control.dev$'
     More importantly, check crossystem worked well even when ChromeOS
     is booted from an older version of firmware.

Change-Id: I3989a8c181efe03cd9f06127743763e0ad97e281
Reviewed-on: https://gerrit.chromium.org/gerrit/32470
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Commit-Ready: Che-Liang Chiou <clchiou@chromium.org>
2012-09-18 15:05:03 -07:00
Tom Wai-Hong Tam
46c01a2d2b scripts: Add the new GBB_FLAG_ENTER_TRIGGERS_TONORM usage
This GBB_FLAG_ENTER_TRIGGERS_TONORM is new added for allowing Enter
(default is Space) to trigger the TONORM screen. This flag is
used by FAFT testing.

Chage the usage of set_gbb_flags.sh to help an user.

BUG=chrome-os-partner:12699
TEST=None. Trivial comment change.

Change-Id: I8a1efa880627965570719f22dedfa0e31ab2d5f5
Reviewed-on: https://gerrit.chromium.org/gerrit/33404
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-09-17 07:47:03 -07:00
Hung-Te Lin
35f5474788 newbitmaps: Remove language in UPDATE screen.
Currently we don't accept keyboard input in UPDATE screen.

BRANCH=none
BUG=chrome-os-partner:13821
TEST=make # no more languages on UPDATE screen.

Change-Id: I08fa6dab7415e9a461ca8096073e98a155a8489e
Reviewed-on: https://gerrit.chromium.org/gerrit/33161
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Dave Parker <dparker@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-09-12 21:17:14 -07:00
Hung-Te Lin
b4b324a8b4 utility: Add "enable_dev_usb_boot".
A shortcut and easier way to enable USB booting without always calling the huge
firmware updater.

BRANCH=none
BUG=none
TEST=./enable_dev_usb_boot # successfully set dev_usb_boot value.

Change-Id: I9ebb3ce79ef58bc0a32926866d5e1827a92b6e74
Reviewed-on: https://gerrit.chromium.org/gerrit/33046
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2012-09-12 20:39:46 -07:00
Mike Frysinger
22bd8b0c29 sign_official_build.sh: rename "install" to "factory"
This lines up with the terminology that people have been using, and the
valid types that can appear in signer instruction files.  We keep around
the old "install" so that other code continues to work.

BUG=None
TEST=None
BRANCH=none

Change-Id: I8d0d2ab4c0ae61f6bcdbcc24ec9796d9eabe386e
Reviewed-on: https://gerrit.chromium.org/gerrit/33056
Reviewed-by: David McMahon <djmm@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-09-12 00:29:28 -07:00
Hung-Te Lin
4b193b7f5c newbitmaps: Add 1280x* with AR=8x5 profiles
For larger panels, we want to support 1280x* profiles.

BRANCH=none
BUG=chrome-os-partner:12896
TEST=make # all profiles generated.

Change-Id: I5b6729e4335bc0ade3948151e766c02ab937435d
Reviewed-on: https://gerrit.chromium.org/gerrit/32892
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Dave Parker <dparker@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-09-11 19:22:36 -07:00
Hung-Te Lin
599565b4dd newbitmaps: Remove SD card asset for USB-only profiles.
BRANCH=none
BUG=chrome-os-partner:13767
TEST=make # success, s1024usb profiles don't have SD in Remove page.

Change-Id: Ifa605dea50d9d8538fca6032743662e9d8dc7e6c
Reviewed-on: https://gerrit.chromium.org/gerrit/32683
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Dave Parker <dparker@chromium.org>
Commit-Ready: Dave Parker <dparker@chromium.org>
2012-09-10 23:15:40 -07:00
Simon Glass
c92c81ecf5 Don't copy BMP data on ARM
This just chews up memory and wastes time on ARM, since the data is already
in memory.

BUG=chrome-os-partner:13492
BRANCH=snow
TEST=manual
Build and boot on snow with manually modified code, to see that the bmpfv
pointer is in the same region as the bmp region.

Build and boot on link and see that displaying screens is still fast.

Change-Id: I98349b73671e38fa6cace966b6953a2abf129fab
Reviewed-on: https://gerrit.chromium.org/gerrit/32629
Reviewed-by: Mike Truty <truty@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Commit-Ready: Simon Glass <sjg@chromium.org>
2012-09-10 16:17:16 -07:00
Simon Glass
69f0d0bac9 Define all screens in enum ScreenIndex and use them
This enum seems partially complete, and not used in vboot_reference.
Complete it and use it.

BUG=chrome-os-partner:13492
BRANCH=snow
TEST=manual
Build and boot through to recovery on snow. Run through the various
screens and check that they still appear correctly.

Change-Id: Ifca54d072457d9a0396a38026f44f8334efb9cf5
Reviewed-on: https://gerrit.chromium.org/gerrit/32628
Reviewed-by: Mike Truty <truty@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Commit-Ready: Simon Glass <sjg@chromium.org>
2012-09-10 15:03:30 -07:00
Gabe Black
172360ec5d Replace %L with %ll in format strings.
%L is, in some standard libraries like U-Boot's, a synonym for %ll which is
for long long integers, required by the C99 standard to be at least 64 bits.
For practical purposes that basically means %ll should be used with 64 bit
values. Since %L seems to be non-standard and, at least in U-Boot's case, %ll
is recognized in the same way, %ll seems preferable.

BUG=chrome-os-partner:8339
TEST=Booted ChromeOS using depthcharge and U-Boot. Booted with
depthcharge/libpayload which does not support %L and saw a number where %L had
been printed.
BRANCH=None

Change-Id: Id51fb5c9295e0dd65b42a5c0738eb34c8210a2b2
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/32660
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-09-09 20:52:21 -07:00
Simon Glass
985e90e263 Remove power button work-around for ARM
On x86 U-Boot cannot see the power button, which means that the EC must
deal with it, and may power off the unit at any time. To get around this,
we write the vbcontext every time we change it.

Since this isn't a problem on ARM, and we want to avoid spurious writes
(due to delay and disk wear), make this code execute only on x86 machines.

BUG=chrome-os-partner:13717
BUG=chrome-os-partner:7689
BRANCH=snow,link
TEST=manual
On snow, see that the EC no longer gets MKBP messages to write the nv
context.
On link, manually add a print to U-Boot's nvstorage_write_disk() function
and see that changing language in recovery still causes a write.

Change-Id: I62508739c9fc3aca46fba58b196a8af45269af2a
Reviewed-on: https://gerrit.chromium.org/gerrit/32464
Commit-Ready: Tom Wai-Hong Tam <waihong@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
2012-09-07 01:00:04 -07:00