Commit Graph

7 Commits

Author SHA1 Message Date
Don Garrett
0fc9594634 Bundle up the utilities methods used in dump_kernel_config and
export them as a library to be used by post installer programs.

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

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

Change-Id: Icb23838a8cd804e0c66718c6d4d60f639ee6b72f
Reviewed-on: https://gerrit.chromium.org/gerrit/14770
Commit-Ready: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
2012-01-26 15:22:39 -08:00
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
Che-Liang Chiou
2c0711bf54 Revert "Revert "Add --kloadaddr option to utilities""
This reverts commit bc7a84d9a1.

It was a false alarm that --kloadaddr causes chromeos-install on a
x86 targets to fail. The error of chromeos-install cannot be
reproduced, and judging by the reported error message, the error
should not be attributed to --kloadaddr, which has no effect in x86
targets. So --kloadaddr is restored.

Verification process are below:

(Verify that --kloadaddr option is restored)
$ dump_kernel_config -h
Expected argument after options
dump_kernel_config - Prints the kernel command line

Usage:  dump_kernel_config [--kloadaddr <ADDRESS>] <image/blockdevice>

(Setup a x86 target with kernel-next profile)
$ rm -rf /build/${X86_TARGET}
$ ./setup_board --board=${X86_TARGET} --profile=kernel-next
$ ./build_packages --board=${X86_TARGET}
$ ./build_image --board=${X86_TARGET}

(Run chromeos-install on target machine successfully)
$ /usr/sbin/chromeos-install

(Change directory to where image sits)
$ cd ~/trunk/src/build/images/${X86_TARGET}/latest

(Unpack Chromium OS image)
$ ./unpack_partitions.sh chromiumos_image.bin

(Verify that dump_kernel_config runs successfully)
$ dump_kernel_config part_2
console=tty2 init=/sbin/init add_efi_memmap boot=local noresume noswap
i915.modeset=1 cros_secure kern_guid=%U tpm_tis.force=1
tpm_tis.interrupts=0 nmi_watchdog=panic,lapic i8042.nomux=1
root=/dev/dm-0 quiet loglevel=1 rootwait ro dm_verity.error_behavior=3
dm_verity.max_bios=-1 dm_verity.dev_wait=1 dm="vroot none ro,0 1740800
verity %U+1 %U+1 1740800 1 sha1
c357e07395150770ce25ebc0e3c6d15941675c58"

(Run load_kernel_test)
$ load_kernel_test -b 2 chromiumos_image.bin
/usr/share/vboot/devkeys/recovery_key.vbpubk
Read 2088 bytes of key from /usr/share/vboot/devkeys/recovery_key.vbpubk
bootflags = 6
Reading from image: chromiumos_image.bin
Ending LBA: 3989538
Read(1, 1)
Read(2, 32)
Read(3989506, 32)
Read(3989538, 1)
Read(4096, 128)
Read(4224, 6472)
LoadKernel() returned 0
Partition number:   2
Bootloader address: 4345856
Bootloader size:    16384
Partition guid:     b2a453b0-a64a-5c4d-a957-1388cea384a5

R=marcheu@chromium.org,sjg@chromium.org
BUG=none
TEST=see verification process above

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

Change-Id: I932753197550b853495f2c03e8880ad71df765a7
2011-03-22 13:15:19 +08:00
Stéphane Marchesin
bc7a84d9a1 Revert "Add --kloadaddr option to utilities"
This reverts commit 1a0975f5f4.
This fixes chromeos-install on x86-mario with a kernel-next profile.

BUG=None
TEST=Build an x86-mario image with kernel-next, check that /usr/sbin/chromeos-install works.

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

Change-Id: I67fc5c0f70a05a4d662952105542edf454da8022
2011-03-15 10:13:31 -07:00
Che-Liang Chiou
1a0975f5f4 Add --kloadaddr option to utilities
Kernel body load address was hard-coded to CROS_32BIT_ENTRY_ADDR, which
could be an invalid/unavailable memory location on other platforms.

This CL adds an option for setting the load address, and it is default to
CROS_32BIT_ENTRY_ADDR to maintain backward-compatibility.

BUG=chromium-os:1304
TEST=emerge vboot_reference successfully

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

Change-Id: I158cfce10ac59bd019bca41cb061039d0085d5cc
2011-03-11 15:02:17 +08:00
Bill Richardson
abf0550458 Switch to using .vbprivk for signing everything now.
This makes it much simpler to keep track of what we're doing.

vbutil_key can now wrap both .keyb and .pem keys. It figures out which is
which by trying both and just using the one that works.

vbutil_keyblock and vbutil_kernel now use .vbprivk files for signing.

replace debug() with VBDEBUG(()) in host-side sources, too.

rename PrivateKeyRead to PrivateKeyReadPem

Add real PrivateKeyRead and PrivateKeyWrite for .vbprivk files.

Review URL: http://codereview.chromium.org/2871033
2010-07-01 10:22:06 -07:00
Will Drewry
46186faf46 utility: add a simple tool for dumping the kernel config
Adds dump_kernel_config.c which takes in a file, reads it
all in to memory, then walks the blob until it can determine
the location of the kernel command line.

This is needed to allow the kernel config to inform legacy bootloader
configuration during autoupdates without packaging up dm-verity specific
options in some additional update metadata.

TEST=manual run over build_kernel_image.sh output
BUG=chromium-os:327

Review URL: http://codereview.chromium.org/2811029
2010-06-25 13:40:43 -05:00