Commit Graph

1662 Commits

Author SHA1 Message Date
Simon Glass
74fa20748d Check keyboard more often in recovery mode
Currently we check the keyboard each 250ms. This makes for a pretty choppy
experience when changing languages. Change to check every 20ms, without
changing the disk check interval (which remains 1s).

BUG=chrome-os-partner:13717
BRANCH=snow
TEST=manual
Boot into recovery
Try changing language on snow with left/right arrow and see that it updates
instantly.

Change-Id: I2ae411bc36fdb2badac11595b099bca43f116669
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32463
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:03 -07:00
Simon Glass
cf67ca4eb3 Cache GBB images to speed up display
Rather than read the images from slow flash every time we need them, cache
them the first time and use that cache thereafter.

BUG=none
BRANCH=snow,link
TEST=manual
Go into recovery mode on link
See that we can display a new screen in roughly 20ms instead of the 250ms
it previously took on link.

Also tested on snow and shown to have no ill effects.

Change-Id: Ieb39c44bddeb6315da8983669f19f550888659bd
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32462
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 00:21:35 -07:00
Hung-Te Lin
2607e39f0e newbitmaps: Add more locales & fix locale 'ms' (Malay).
Adding 'update' and language description for locale 'ms'.
Also fixed 'model' height in 'th' locale.

BRANCH=none
BUG=chrome-os-partner:11969
TEST=make # success.

Change-Id: I3eb12d43284bab8c3c243cf86e3dc90c7c0e5497
Reviewed-on: https://gerrit.chromium.org/gerrit/32440
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-06 18:13:20 -07:00
Vincent Palatin
56c85db710 Allow vbutil_kernel to work on block devices
Block devices return a size of 0 when stat'ed.
In order to be able to verify directly a raw partition, let's add a
special case to query the block device size.

BUG=chromium-os:34176
TEST="vbutil_kernel --verify /dev/sda4 --verbose" shows the actual
content not an error message.
BRANCH=none

Change-Id: Ibecf0a88816abf97305f0f87c0131ba7b66e386c
Reviewed-on: https://gerrit.chromium.org/gerrit/32302
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Jon Salz <jsalz@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
2012-09-06 17:32:38 -07:00
Randall Spangler
0b4c028891 Esc at DEV screen no longer triggers TONORM
BUG=chrome-os-partner:13765
BRANCH=all
TEST=manual

1. boot in dev mode.  see DEV screen
2. press space -> TONORM
3. press esc -> DEV
4. press esc -> (still at DEV)

Change-Id: I9ed2fd2ff2380b058f1aa677ccd516d9fd5679d2
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32454
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2012-09-06 17:32:33 -07:00
Gaurav Shah
7b3e34a236 Key increment script: Preserve extension and take the target keyset directory
First, preserve extensions for the backed up keys (and keyblocks). Useful since
our wrapping scripts look at the extension in deciding what needs wrapping.

Second, instead of having to run the script from within a keyset directory,
take the keyset path as an argument and increment the versions for
the keys in there.

BUG=chrome-os-partner:13748
TEST=ran on devkeys
BRANCH=none

Change-Id: I9e8c3e58149e5cb4cd5557521e047e25c06b0cd6
Reviewed-on: https://gerrit.chromium.org/gerrit/32417
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Gaurav Shah <gauravsh@chromium.org>
2012-09-06 16:29:24 -07:00
Che-Liang Chiou
3ae4dd7052 signing script: Resign just firmware body, not the entire section
The signing script extracted firmware body sections FW_MAIN_{A,B} and
resigned the whole section instead of just firmware body.

As a result, read-only firmware spends more time loading read-write
firmware from SPI flash.

Since vblock has firmware body size information, signing script should
retrieve it and use it to sign just firmware body.

This may reduce boot time for ~560ms, depending on firmware image size,
section size and SPI flash/bus throughput.

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

BRANCH=snow,link
BUG=chrome-os-partner:13094
TEST=For Snow (or boards that use cros_bundle_firmware), check that
       after resigning, VBLOCK_{A,B} and FW_MAIN_{A,B} are unchanged
     For Alex and ZGB, check that old and new resign_firmwarefd.sh
       generates identical output

(Test for Snow; repeat for A and B)

dump_fmap -x image.bin VBLOCK_A FW_MAIN_A
mv VBLOCK_A VBLOCK_A.orig
mv FW_MAIN_A FW_MAIN_A.orig

resign_firmwarefd.sh image.bin image-resigned.bin \
  firmware_data_key.vbprivk \
  firmware.keyblock \
  dev_firmware_data_key.vbprivk \
  dev_firmware.keyblock \
  kernel_subkey.vbpubk

dump_fmap -x image-resigned.bin VBLOCK_A FW_MAIN_A
cmp VBLOCK_A.orig VBLOCK_A
cmp FW_MAIN_A.orig FW_MAIN_A

(Test for Alex and ZGB; repeat for old and new resign_firmwarefd.sh)

resign_firmwarefd.sh image.bin image-resigned-{old or new}.bin \
  firmware_data_key.vbprivk \
  firmware.keyblock \
  dev_firmware_data_key.vbprivk \
  dev_firmware.keyblock \
  kernel_subkey.vbpubk

cmp image-resigned-old.bin image-resigned-new.bin

Change-Id: Ie70b6c91614343ad9f991ae369a0f8e74ec213fe
Reviewed-on: https://gerrit.chromium.org/gerrit/31572
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: Gaurav Shah <gauravsh@chromium.org>
2012-09-04 17:11:23 -07:00
Kees Cook
fe4ad9f992 mount-encrypted: mount with commit=600
Mount with commit=600, just as the unencrypted stateful is mounted.

BUG=chrome-os-partner:13185
TEST=x86-alex build

Change-Id: I0cee85c8bdabccb6545ca2238f6d5a120300e3aa
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31762
Commit-Ready: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
2012-08-31 15:41:45 -07:00
Louis Yung-Chieh Lo
631ae525a6 Revert "Change FMAP search stride from 4-byte to 64-byte."
This reverts commit 92951c813d.

BUG=chromium-os:33963,
TEST=None
BRANCH=None

Change-Id: I186432ab4cdb91495f81a1574863fada28f59603
Reviewed-on: https://gerrit.chromium.org/gerrit/31690
Commit-Ready: Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-by: Yung-Chieh Lo <yjlou@chromium.org>
Tested-by: Yung-Chieh Lo <yjlou@chromium.org>
2012-08-29 02:12:52 -07:00
Bill Richardson
e0c55a3238 Declare VbExProtectFlash() in vboot_api.h so we can implement it.
We have to define the function we need here, so that we can implement it in
U-Boot, then we can come back here and try to use it. Grr.

BUG=chrome-os-partner:11215
BRANCH=link
TEST=none

This just defines the function prototype. No change to test.

Change-Id: I38a19baa54c59c9744d20f743eb53260f2d19852
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31658
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-08-28 18:42:20 -07:00
Bill Richardson
9dc62178c9 Add VB_INIT_FLAG_SW_WP_ENABLED to VbInit() input flags.
We need to know not only whether the HW WP pin is asserted, but whether the
flash chip has configured its software protection registers to actually
protect anything. This flag can be used to indicate that.

BUG=chrome-os-partner:13265
BRANCH=link
TEST=none

This just adds the flag. Nothing actually sets the flag yet, so there's
nothing to test.

Change-Id: Icba9945fb56eb3a4681486c630cbbdc9232485ef
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31642
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-08-28 16:39:33 -07:00
Gaurav Shah
1d053f6e23 vbutil_keyblock: Fix argument to PrivateKeyReadPem()
If the --signprivate_pem option is used to vbutil_keyblock and without
an external signer, we were passing the wrong name to PrivateKeyReadPem()
causing all such invocations to fail. This CL fixes the typo.

(This particular path isn't current being used.)

BUG=none
TEST=manually verified with --signprivatekey_pem but without --external_signer.
BRANCH=none

Change-Id: I56df76a965706f654df1de8ac6e42738c15284c7
Reviewed-on: https://gerrit.chromium.org/gerrit/31556
Commit-Ready: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Gaurav Shah <gauravsh@chromium.org>
2012-08-28 09:58:50 -07:00
Louis Yung-Chieh Lo
92951c813d Change FMAP search stride from 4-byte to 64-byte.
The FMAP requires to be aligned at 64-byte. Searchin at 4-byte could
lead bug if a designated FMAP is located at 4-byte address.

BUG=chrome-os-partner:13143,
TEST=Tested in CL https://gerrit.chromium.org/gerrit/#/c/31436/
BRANCH=link,snow
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>

Change-Id: Ib7f36dc89d7d2763b1a72b641433d45bec6c2bef
Reviewed-on: https://gerrit.chromium.org/gerrit/31442
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Commit-Ready: Yung-Chieh Lo <yjlou@chromium.org>
Tested-by: Yung-Chieh Lo <yjlou@chromium.org>
2012-08-27 18:40:01 -07:00
Bill Richardson
da77e6953c cgpt: Fix error in modifying size of an existing partition
Modifying the size of an existing partition without modifying the start as
well assumed the start was at block 0. Sometimes it was caught, often it
wasn't.

Fix the error, add a test to catch the problem.

BUG=chrome-os-partner:13090
BRANCH=all
TEST=manual

make && make runtests

Change-Id: I4f5a5031a90a3e78d886ed3573f61305316a3f1f
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31418
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-08-24 20:43:28 -07:00
Bill Richardson
263ffdfdd7 Rename $GPT as $CGPT, just for clarity.
I'm about to add a new test to fix some borkage with cgpt. First step is to
clean up the script a little bit.

BUG=none (yet)
BRANCH=all
TEST=manual

make && make runtests

Change-Id: I2311b5eb20aff80c4a0435cf1d10331c679af3c0
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31379
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-08-24 20:43:27 -07:00
Bill Richardson
2e70c1226a Fix broken bitmap tests
When we changed the bmpblk version from 1.2 to 2.0, the tests weren't
updated.

BUG=chrome-os-partner:11078
BRANCH=all
TEST=manual

make && make runtests

Change-Id: I244a9aeeb34be912fe6058687394c37d0e474890
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31377
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-08-24 20:43:27 -07:00
Mike Frysinger
16de2c7bae signer scripts: break kernel parameters on spaces rather than word boundaries
The current kernel parameter parsing logic uses word boundaries (\b) to
keep from replacing parameters inside of other parameters (like "level=1"
mangling "loglevel=1" into "log"), but this fails when the last character
isn't a "word" character.  e.g. "\bconsole=\b" doesn't match "console=".

Change the \b to a space.  Since we're already using spaces as our split
marker, this shouldn't be a problem.

BRANCH=None
BUG=chrome-os-partner:12780
BUG=chromium-os:33868
TEST=ran `ensure_secure_kernelparams.sh` on an image with 'console=' and saw it work

Change-Id: Id69250179ea76aabfed9cd21c1c59483d78a215d
Reviewed-on: https://gerrit.chromium.org/gerrit/31356
Reviewed-by: David McMahon <djmm@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-08-24 13:26:03 -07:00
Mike Frysinger
513be212d9 signer scripts: include debug output when we fail
When checking kernel params fail, it's useful to know all the variables
as to what it's doing.  So dump some state when an error occurs.

BRANCH=None
BUG=None
TEST=ran `ensure_secure_kernelparams.sh` on a bad image and saw useful output
TEST=ran `ensure_secure_kernelparams.sh` on a good image and saw no output

Change-Id: I0e499f87a6d8feed80da72aba75e1e6c1b4076c9
Reviewed-on: https://gerrit.chromium.org/gerrit/31355
Reviewed-by: David McMahon <djmm@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-08-24 12:50:56 -07:00
Taylor Hutt
f7257d5628 Short-circuit looping for audio in Sandbox U-Boot builds
Sandbox U-Boot has no sound, so there is no point in looping while it
doesn't really play.

BRANCH=none
BUG=chromium-os:32603
TEST=Sandbox U-Boot has no sound, no need to loop
Signed-off-by: Taylor Hutt <thutt@chromium.org>

Change-Id: I5ff987d9d80c2d24ae6502c36cf399e582dff524
Reviewed-on: https://gerrit.chromium.org/gerrit/31015
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Taylor Hutt <thutt@chromium.org>
Reviewed-by: Taylor Hutt <thutt@chromium.org>
Tested-by: Taylor Hutt <thutt@chromium.org>
2012-08-24 12:15:45 -07:00
Hung-Te Lin
ea1b7dd9d9 newbitmaps: Add "native 1366x768 USB" profile.
BRANCH=none # we always build images in ToT.
BUG=chrome-os-partner:13048
TEST=make # got n1366usb bmpblk.bin

Change-Id: I5af3c4f599c6789c208013095db86f0836241ced
Reviewed-on: https://gerrit.chromium.org/gerrit/31324
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2012-08-24 11:40:11 -07:00
Randall Spangler
89286bc73a Fix reporting TPM kernel version and firmware version on ZGB
These fields are part of the version 1 struct, but were mistakenly
labeled as version 2 fields.  Since ZGB firmware produces a version 1
struct, crossystem was treating the fields as unavailable.

BUG=chromium-os:33685
TEST=crossystem tpm_fwver tpm_kernver
BRANCH=none (OS utility change, not firmware, and affects only Alex/ZGB)

Change-Id: Ic857ee2da9a7ae7f0d42317b711bf102d068de64
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/30904
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
2012-08-23 16:52:10 -07:00
Hung-Te Lin
2ac65ecccf newbitmaps: Reduce spacing between for_help and URL text.
Both for_help_* and Url bitmaps have margin, so it looks too large as a
"margin*2 + 5(x_pad)" gap on screen.

BRANCH=none
BUG=chrome-os-partner:12893
TEST=make # All bitmaps generated.

Change-Id: Ic8d3e9180e52b7476b07367a027793cea0ed3109
Reviewed-on: https://gerrit.chromium.org/gerrit/30988
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Dave Parker <dparker@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-08-22 18:34:44 -07:00
Kees Cook
9b98929ec1 mount-encrypted: explicitly use uint64_t for sizes
On very large HDDs, the sector count was wrapping around. Switch most
calculations to bytes using uint64_t, and use BLKGETSIZE64 for checking
the loopback device size.

BUG=chrome-os-partner:12705
TEST=parrot build, manual testing
STATUS=Fixed

Change-Id: I1f7aea81151ed5cc130b1f6a05fda83f7a85150f
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31073
Reviewed-by: Elly Jones <ellyjones@chromium.org>
2012-08-22 08:43:11 -07:00
Hung-Te Lin
1d9c217085 newbitmaps: Improve insert_sd_usb2 message.
"insert_sd_usb2" message didn't include the "ChromeOS is missing or damaged"
text, also is too long for certain locales.

We should revise message and check if the locale fits screen width.

BRANCH=none
BUG=none
TEST=cd strings; make  # all pass

Change-Id: Ie9cb5e4ecd6d143772ffa8e7de29c202e9bde130
Reviewed-on: https://gerrit.chromium.org/gerrit/30824
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Dave Parker <dparker@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-08-20 10:13:01 -07:00
Hung-Te Lin
1550b14604 newbitmaps: Support more profiles.
Added "n1366usb2" profile and remove SD icon in *usb profile.

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

Change-Id: If280cebb847cdc7a599f510f279df03e1cc9b4d5
Reviewed-on: https://gerrit.chromium.org/gerrit/30810
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Dave Parker <dparker@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-08-20 10:13:00 -07:00
Hung-Te Lin
7ce91cd2f9 newbitmaps: Change build targets from x86/arm to "profiles".
The difference of firmware bitmaps won't rely on platform (x86/arm) in future;
instead, things will differ by rescaling & message contents.

To support that, we need to change build target from "platform" to "profiles".

To build all platforms, run "make" in top leve (or "make all" in images).
To debug (en locale without rescaling), run "make" in images folder.
To debug a specific profile, run "make $PROFILE" in images folder.

BRANCH=none
BUG=chrome-os-partner:11078, chrome-os-partner:12790
TEST=make # all profiles generated in images/out_*/*.bin

Change-Id: Iaabf160b1b2bc844d230188eb593daa8a597d378
Reviewed-on: https://gerrit.chromium.org/gerrit/30683
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2012-08-17 20:02:15 -07:00
Hung-Te Lin
5f5f086e38 newbitmaps: Replace image source BMP files by PNG format.
PNG files are better for editing and checking than BMP files.
Also smaller file size.

BRANCH=none
BUG=none
TEST=make # x86 & arm bitmap blocks generated.

Change-Id: I828779aafa4938cb21356a8c42dee27b1b3ad8ae
Reviewed-on: https://gerrit.chromium.org/gerrit/30682
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2012-08-17 20:02:14 -07:00
Hung-Te Lin
4d31d0b045 newbitmaps: Revise fonts, color, layout & messages.
Inspired by https://gerrit.chromium.org/gerrit/#/c/30631/

 - Increase gray colored text contrast
 - Enlarge font size to 17pt
 - Change standard font to Verdata (which is wider than usually fonts,
   to provide better quality when stretched in horizontal)
 - Decomposed tonorm_confirmation & devmode so we can have better control
   to verif_* prompt, and look more similar to original mock.

BUG=chrome-os-partner:11078
TEST=make # All platforms generated
BRANCH=none

Change-Id: If019b5767f13556df0e4da77f6457e092fa06016
Reviewed-on: https://gerrit.chromium.org/gerrit/30679
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2012-08-17 20:02:14 -07:00
Hung-Te Lin
194d7d8867 newbitmaps: Add "insert SD / USB2" text resource.
We need the text for "SD or USB2" (i.e., not USB3).

BRANCH=none
BUG=chrome-os-partner:12790
TEST=none, only adding text translation resource.

Change-Id: Id70a2565bb1fb0b6a4ed92d3fceddbc72e60d77a
Reviewed-on: https://gerrit.chromium.org/gerrit/30663
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2012-08-17 20:02:14 -07:00
Bill Richardson
ae98bf0572 Improved pretty-print for dump_fmap, with gap detection
BUG=none
BRANCH=none
TEST=manual

Use it to dump the FMAP from a firmware image:

  dump_fmap -h /build/link/firmware/image-link.bin

Change-Id: I94fb9396ea886b072845fadef6ef1e1e2ff85a59
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/30784
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-08-17 17:30:06 -07:00
Dave Parker
0868f8f3b7 Fix vertical placement of bmp images on firmware screens.
BUG=chromium-os:33608
TEST=Run 'make' in newbitmaps directory to generate new bmpblock.
Run on DUT. Observe spacing in the footer section is closer
together.

Change-Id: I96987e827fd395f13244dbc58db600de5dc30958
Reviewed-on: https://gerrit.chromium.org/gerrit/30610
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Dave Parker <dparker@chromium.org>
Tested-by: Dave Parker <dparker@chromium.org>
2012-08-16 18:45:21 -07:00
Randall Spangler
5eb7cdba0e Fix handling of enter and space in developer screens.
At DEV screen:
- Space triggers TONORM
- Enter is ignored unless new GBB flag is set

At TONORM screen:
- Enter always means YES
- Space is ignored

So, if you hold the space key at the dev screen, you'll go to tonorm
and stay there until you press Enter or Esc.  If you hold the Enter
key at the dev screen, nothing will happen.

Add a GBB flag to allow Enter to trigger the TONORM screen; this will
be used by FAFT testing.

BRANCH=all
BUG=chrome-os-partner:12699
TEST=manual

1. press enter at dev screen.  nothing happens.
2. press space at dev screen.  tonorm.
3. press space at tonorm.  nothing happens.
4. press enter at tonorm.  turns off dev mode.

Change-Id: I9f3128d5114e1486911cc4d76d0ccd5649de1680
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/30456
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
2012-08-16 17:40:51 -07:00
Kees Cook
7c118da2d6 mount-encrypted: calculate inode ratio based on final size
mkfs.ext4 does not use the resize= hint for calculating inode ratios.
This means very tiny initial filesystems will not get enough inodes
once it has been resized. This calculates the desired inode ratio based
on the expected final size of the filesystem.

BUG=chrome-os-partner:12678
TEST=lumpy build, manual testing
STATUS=Fixed

Change-Id: I216aaaa6e0ef50e82265ee46ecac5a65bb077387
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/30579
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
2012-08-16 17:40:48 -07:00
Gabe Black
3afe5566cc Make crossystem look for the write protect switch in the chromeos_arm device
The value of the ChromeOS write protect switch is now provided through the new
chromeos_arm platform device which avoids the mismatch between U-Boot and
kernel GPIO numbering.

BUG=chrome-os-partner:11297
TEST=gmerge-ed onto a snow and verified that crossystem got the right value of
the write protect switch.
BRANCH=snow

Change-Id: I466370e4f6bf2d14c067518a9d620e9e60142a0b
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/30534
Reviewed-by: Simon Glass <sjg@chromium.org>
Commit-Ready: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-08-16 09:48:45 -07:00
Dave Parker
12ef75d84d Fix alignment of HWID on firmware screens and bitmap viewer.
BUG=chrome-os-partner:12701
TEST=Disable the 'clean' step in the Makefile and
run 'make' in newbitmaps directory. Use the bitmap_viewer to
verify the HWID is correctly aligned when compared with the "Model"
text.

Change-Id: Icd3977f50461492a0999059ccd4982d16a373dce
Reviewed-on: https://gerrit.chromium.org/gerrit/30453
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Dave Parker <dparker@chromium.org>
Tested-by: Dave Parker <dparker@chromium.org>
2012-08-15 22:49:09 -07:00
Dave Parker
06e8e90018 Prevent color dithering of firmware bitmaps
BUG=None
TEST=Run 'make' in newbitmaps dir with "clean" removed from the default
step in the Makefile. Use bitmap_viewer to check that the images do not
show grainy color dithering.

Change-Id: I6dff41338a7e54d090bb2f6dedb982fdaa31e657
Reviewed-on: https://gerrit.chromium.org/gerrit/30308
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Dave Parker <dparker@chromium.org>
Tested-by: Dave Parker <dparker@chromium.org>
2012-08-15 19:28:15 -07:00
Hung-Te Lin
6cda3966ec newbitmaps: Refine text layout & font settings.
BRANCH=none
BUG=chrome-os-partner:11078
TEST=make  # x86 and arm bitmaps both works.

Change-Id: I21382c4f4a829703d9249929579f5007a7db1a9e
Reviewed-on: https://gerrit.chromium.org/gerrit/30369
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-08-15 18:36:35 -07:00
Randall Spangler
29e8807ea0 Add clear TPM owner request
This adds two new flags to crossystem:
   clear_tpm_owner_request
   clear_tpm_owner_done

The first one requests that the firmware clear the TPM owner on the
next boot.  When the firmware does this, it will set
clear_tpm_owner_request=0, and set clear_tpm_owner_done=1.  The OS can
use the done-flag as a hint that trusted things guarded by the TPM are
no longer trustable.

BUG=chromium-os:31974
TEST=manual

crossystem
  // both flags initially 0
crossystem clear_tpm_owner_request=1
crossystem clear_tpm_owner_done=1
  // request=1, done=0; done can be cleared but not set by crossystem
reboot
tpmc getownership
  // owned=no
crossystem
  // request=0, done=1
crossystem clear_tpm_owner_done=0
crossystem
  // both flags 0 again

Signed-off-by: Randall Spangler <rspangler@chromium.org>
Change-Id: I49f83f3c39c3efc3945116c51a241d255c2e42cd
Reviewed-on: https://gerrit.chromium.org/gerrit/25646
2012-08-15 14:31:53 -07:00
Taylor Hutt
59576e11e5 twostop: Skip kernel verification when built for U-Boot sandbox
It's not yet possible to verify the kernel in an Chromium OS image
with the Sandbox Version of U-Boot due to the lack of keys.  For now,
stub out the verification process and behave as if everything is ok:
Sandbox U-Boot is only interested in the selected kernel and boot mode
at this point.

BUG=chromium-os:32603
TEST=With this change, it's possible to get valid answers from
  vboot_twostop command with Sanbox U-Boot.

Change-Id: I3b1142889657315675eacd3a1d1448aeee7ccb62
Signed-off-by: Taylor Hutt <thutt@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/30256
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-08-15 11:10:37 -07:00
Vadim Bendebury
b321dbb6bc Get kernel size/load address from vboot headers
Presently kernel load address and buffer size are programmed in the
u-boot device tree. There is no reason for this: the address and size
are part of the vboot encapsulation headers. Duplicating this
information hardcoded in the device tree does not bring any benefit
and is in fact harmful, as it is easy to get out of sync.

A better way of doing things is to derive kernel load address and size
from the appropriate vboot header. ARM people object to this, as they
want the very same kernel blob operate on devices with DRAM mapped to
different address ranges.

The suggested solution is to exclude the kernel memory section from
the device tree on the platforms where the load address could be
safely taken from the vboot header. In this case u-boot will pass
address of zero to vboot, which will know to derive the address/size
from the appropriate header. vboot then rewrites fields of the u-boot
supplied structure with actual address and size of the kernel blob.

There is no sanity check yet, as it is presumed that there is enough
memory to load any kernel and u-boot does not use the space above
0x100000 for at least 16 megabytes (the kernel partition size). On x86
platform the check could be verify that the top of the kernel space is
well below the stack.

BUG=chrome-os-partner:11994
TEST=manual
  . with the appropriate u-boot change run a Link target through a
    FAFT cycle, observe it succeed.

Change-Id: I3c2c2cefb1e31d16ac497a01894bf32638479ed7
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/29038
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Commit-Ready: Bill Richardson <wfrichar@chromium.org>
2012-08-14 14:04:20 -07:00
Taylor Hutt
3e894ba453 mocked_tpm: Provide definition of kBootStateSHA1Digests
Add a definition of kBootStateSHA1Digests[].  Without this, it is not
possible to build the Sanbox version of U-Boot.

BUG=chromium-os:32603
TEST=Allows vboot to link when using mocked TPM with U-Boot Sandbox
Change-Id: Ie84f4ba3f1c266ed8063fbf6aea0093dd21f638b
Signed-off-by: Taylor Hutt <thutt@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/30200
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
2012-08-14 10:17:32 -07:00
Dave Parker
9a6e6e7785 Scale bmp files correctly for x86 when generating bmpblocks.
BUG=None
TEST=Run 'make' in newbitmaps directory but remove the "clean"
step in the Makefile. Use the bmp_viewer utility to verify
all graphic elements are scaled.

Change-Id: Ifd62c2ba3a6c354c4de7d9fd052d76de36842fb6
Reviewed-on: https://gerrit.chromium.org/gerrit/30126
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Dave Parker <dparker@chromium.org>
Tested-by: Dave Parker <dparker@chromium.org>
2012-08-13 20:37:27 -07:00
Hung-Te Lin
b57b8c3dea newbitmaps: Add ToNorm confirm screen resource.
According to new flow, we need "confirm" screens for TONORM.
Also simplified default_source folder, with better hints and using PNG image
source.  image/assets/* are files from issue page.

BUG=chrome-os-partner:11078
TEST=make  # x86 and arm bitmaps both works.

Change-Id: I3701d6ed5a944305e12a01c1841a197d3e18a8cd
Reviewed-on: https://gerrit.chromium.org/gerrit/29983
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2012-08-13 17:25:13 -07:00
Hung-Te Lin
9ea8e0d390 firmware: Add TONORM_CONFIRM screen.
We need to alert user his change has been accepted for 5 seconds.

BUG=chrome-os-partner:11078
TEST=emerge-daisy vboot_reference-firmware vboot_reference chromeos-u-boot chromeos-boogimage

Change-Id: I6a3b13e7543479fbd6543d759093ecf501fb1d04
Reviewed-on: https://gerrit.chromium.org/gerrit/29982
Reviewed-by: Bill Richardson <wfrichar@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-08-13 17:25:13 -07:00
Bernie Thompson
8057d1bf48 Add in Kiev FW keys to vbutil_what_keys
BUG=chrome-os-partner:12544
TEST=Manual, verify vbutil_what_keys detects properly on Kiev.

Change-Id: I4115b80e56784bbd5177e142a936ce52132fcf7f
Reviewed-on: https://gerrit.chromium.org/gerrit/29944
Reviewed-by: Dave Parker <dparker@chromium.org>
Commit-Ready: Bernie Thompson <bhthompson@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
2012-08-10 19:45:27 -07:00
Hung-Te Lin
c951eb8257 newbitmaps: Refine font and text generation.
The bmpblk build scripts used to rely on lots of pre-generated resources, and
the HWID font data was fixed to x86 special size & scaling parameters.

Since the screens now rely on more platform dependent parameters, this CL
refined whole flow so fonts are now generated and processed (ex, re-scale) in
the same way as other text messages.

BUG=chrome-os-partner:11078
TEST=make # x86 and arm bitmaps both works.

Change-Id: I59a4fb31718ef052c6b54cd4642f4fc487893f2b
Reviewed-on: https://gerrit.chromium.org/gerrit/29873
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-08-10 11:18:52 -07:00
Hung-Te Lin
6974266829 newbitmaps: Always generate bitmaps in 8bpp mode.
ImageMagick may produce 1bpp mode for background if the image is modified (ex,
x86 output). We need to ensure the output to be 8bpp mode for firmware to
render images correctly.

BUG=chrome-os-partner:11078
TEST=make x86 # all images are in 8bpp mode.

Change-Id: Ia6e4fbc5e7580ebbb51e1067bcf554ee06f1fbc5
Reviewed-on: https://gerrit.chromium.org/gerrit/29868
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-08-10 11:18:52 -07:00
Dave Parker
1eb883dce6 Translated text for "v2" firmware recovery screens.
BUG=chrome-os-partner:11078
TEST=run make in newbitmaps directory to build a new bmpblock.

Change-Id: I97683c95c7c0881ce17617ccab4eb674a06704de
Reviewed-on: https://gerrit.chromium.org/gerrit/29866
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Dave Parker <dparker@chromium.org>
Tested-by: Dave Parker <dparker@chromium.org>
2012-08-09 23:59:29 -07:00
Hung-Te Lin
1dc00165e5 newbitmaps: Add TODEV, TONORM, and UPDATE(WAIT) screens.
An initial draft of missing screens, with only English messages (*.txt in
localized folders are now all English - will update them once translation is
ready).

BUG=chrome-os-partner:11078
TEST=make; bitmap_viewer DEFAULT.yaml # see basic screen.

Change-Id: I3209e18bf604030cf8e92d264781add33aab84fe
Reviewed-on: https://gerrit.chromium.org/gerrit/29765
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-08-09 19:44:49 -07:00
Hung-Te Lin
64a2aff962 bmplk_utility: Libraries should be in end of build command.
Libraries (-llzma, -lyaml) should be in end of dependency list, otherwise
linking in static mode (-static) would fail.

BUG=none
TEST=emerge vboot_reference

Change-Id: Idd072443d042edfb214f5a958abd064bc18573ed
Reviewed-on: https://gerrit.chromium.org/gerrit/29738
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-08-09 19:18:21 -07:00