| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On MTD devices, don't always enable MTD mode - the installer needs to
be able to access both the GPT disk and the MTD disk, so only
enable it if we install to /dev/fts
BRANCH=none
BUG=chromium:221745
TEST=make runtests
Change-Id: I7688e6bc758ef47cfb9d468c1224ef43b2043d02
Reviewed-on: https://gerrit.chromium.org/gerrit/62662
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=chromium:252331
TEST='make runtests' still passes
BRANCH=none
Change-Id: I1deb70766b811b070f0f412cb5cfa583250dd687
Reviewed-on: https://gerrit.chromium.org/gerrit/61328
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As per the discussion on issue 221745 we will be using 64-bit byte offsets
for the MTD partition table and converting to/from sectors internally in cgpt.
Existing interfaces do not change, eg sizes are still reported in sectors, only
the on-disk representation is affected.
BRANCH=none
BUG=chromium:221745
TEST=unit tests pass
Change-Id: Id312d42783acfdabe6eb8aea11dcbd298e00a100
Reviewed-on: https://gerrit.chromium.org/gerrit/60919
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Additionally renames the new functions in add to be CamelCase style
BUG=chromium:221745
TEST=MTD version of run_cgpt_tests.sh passes
BRANCH=none
Original-Change-Id: Ic173f99d7ca4af025403ab11f37061c33c9d59ea
Reviewed-on: https://gerrit.chromium.org/gerrit/47173
Tested-by: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
(cherry picked from commit c3aad2fd06a21097cffd10ec5b168e728616b868)
Change-Id: Ib3bb947ffcd5c0f40398a27a721e392b895c9da0
Reviewed-on: https://gerrit.chromium.org/gerrit/49795
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=chromium:221745
TEST=MTD version of run_cgpt_tests.sh passes
BRANCH=none
Change-Id: I8a5c1afab238eb10f38d865405ea2828715685d8
Original-Change-Id: I3d72fecbb3ef95252aa35d56885288340537b1c5
Reviewed-on: https://gerrit.chromium.org/gerrit/47175
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49794
Reviewed-by: Albert Chaulk <achaulk@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix some bugs in the cgpt implementation of the flash I/O functions & load
logic, it was validating too much at load time.
Implement the create command for MTD
BUG=chromium:221745
TEST=MTD version of run_cgpt_tests.sh passes
BRANCH=none
Original-Change-Id: I2f52637d82962f4d805aa827c5c37685f10e76ea
Reviewed-on: https://gerrit.chromium.org/gerrit/47172
Tested-by: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
(cherry picked from commit 931544744ba410dad267064b87d504b0b4c24772)
Change-Id: If9364155fb2c030645adc6ee6f3fbe5373bcc153
Reviewed-on: https://gerrit.chromium.org/gerrit/49793
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a partition isn't "defined", then don't declare its size as 1.
BUG=chromium:236941
TEST=`cbuildbot {x86,amd64,arm}-generic-full` pass
TEST=`cgpt show -i 100 -s chromiumos_image.bin` shows 0
BRANCH=none
Change-Id: I538546b6b37a9137958d6f926a58753cf52c946a
Reviewed-on: https://gerrit.chromium.org/gerrit/50074
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enables MTD mode with a command line option of
-N=<write page bytes>,<write pages per erase block>,
<erase block offset to fts partition>,<erase block size of fts partition>
The problem is that we need to know exactly where the fts store partition is
and what the layout of the flash chip is in order to be able to use it
properly. This will vary per-device however, so for flexibility and testing
purposes, this command line option allows specification of arbitrary layouts.
BUG=chromium:221745
BRANCH=none
TEST=verified during development via prints
Original-Change-Id: I88640e777d5ccd4ffd3b39e1f131dc1d362c6b2c
Reviewed-on: https://gerrit.chromium.org/gerrit/46920
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
(cherry picked from commit 2b768f99d246823f3711bbe4cf50ea9ab4588a06)
Change-Id: I35591d4fbec13c3887beef11fdefc84fc90b8e05
Reviewed-on: https://gerrit.chromium.org/gerrit/49792
Reviewed-by: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Provide an MTD implementation of several common functions in cgpt_common.c
BUG=chromium:221745
BRANCH=none
TEST=none
Original-Change-Id: Ib3248c283ca31e33a91b9ea0c14b2f72ea7c5850
Reviewed-on: https://gerrit.chromium.org/gerrit/47029
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
(cherry picked from commit b0bd7e4cf8dd15cc3c371dac157093c7e7c7a874)
Change-Id: I243c2bf98a88d0019c332b274868459b5f1b8ea1
Reviewed-on: https://gerrit.chromium.org/gerrit/49791
Reviewed-by: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Provide implementations for "boot" and "legacy" that error out in MTD mode and
"repair" that is a no-op. Eventually if/when we add redundancy, repair will do
something, but boot/legacy never will.
BUG=chromium:221745
BRANCH=none
TEST=none
Original-Change-Id: Ie537f20d8dff9d14fb83d0431bd48453bff0217d
Reviewed-on: https://gerrit.chromium.org/gerrit/46883
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
(cherry picked from commit 00c4bc52e35c7c77ebe73322693a457b3dd072f9)
Change-Id: I90e6118114554a05245fb8cfcec9567c4705ea96
Reviewed-on: https://gerrit.chromium.org/gerrit/49790
Reviewed-by: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Integrates the FTS driver into cgpt. This driver is binary-format compatible
with the linux driver for interoperabiilty. The cgpt changes load & store a
hex-encoded mtd partition table in the FTS; we need some sort of encoding
because FTS only stores NUL-terminated strings.
Currently, the mtd code paths aren't executed in cgpt, only in the tests. It's
also not hooked up to the vboot code yet, we will need to do that eventually.
BUG=chromium:221745
TEST=new unit test added
BRANCH=none
Change-Id: I94eb0389d29aca0beb9d9a644465c7d86161b3c2
Original-Change-Id: I9fe2fa91b666572563426adb8fa9d426f9b60bbf
Reviewed-on: https://gerrit.chromium.org/gerrit/46796
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49789
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Refactor cgpt_prioitize.c to completely remove gpt-specific code.
- Refactor cgpt_add.c to isolate gpt-dependence to one helper function
and the backup/restore logic
- Change several common apis to take a struct drive* rather than a GptData*,
this provides a path to cleanly implement mtd versions
BUG=chromium:221745
TEST=no functional changes, existing tests cover this
BRANCH=none
Change-Id: I27ed166aae390aa5dc83062f62939e45122edc76
Original-Change-Id: I1b0a73509efbf22411c4ae5cf044feede0a49a33
Reviewed-on: https://gerrit.chromium.org/gerrit/46548
Tested-by: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49788
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reduces the number of exported header files to the minimum needed by
the existing userspace utilities and firmware implementations.
BUG=chromium:221544
BRANCH=none
TEST=manual, trybots
CQ-DEPEND=CL:47019,CL:47022,CL:47023
sudo FEATURES=test emerge vboot_reference
FEATURES=test emerge-$BOARD \
vboot_reference \
chromeos-cryptohome \
chromeos-installer \
chromeos-u-boot \
peach-u-boot \
depthcharge
Change-Id: I2946cc2dbaf5459a6c5eca92ca57d546498e6d85
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47021
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The chromeos-installer uses several functions from the vboot_reference
userspace library, but the names of those functions are inconsistent:
IsZero
MapFile
VbGetSystemPropertyString
cgpt_add
cgpt_boot
cgpt_create
cgpt_get_boot_partition_number
cgpt_get_num_non_empty_partitions
cgpt_get_partition_details
cgpt_prioritize
cgpt_set_attributes
find_kernel_config
The Google C++ style guide says types and functions should use CamelCase,
while variables use lower_case_with_underscores.
Kernel style (which vboot_reference tries to be more-or-less compatible
with) uses lower_case_with_underscores for everything, but that really only
has to apply to firmware stuff. For userspace, we can use the Google style.
BUG=chromium:221544
BRANCH=none
TEST=buildbot
CQ-DEPEND=CL:46045
Renaming/cleanup only; no functional changes.
Change-Id: I9c82c9ff8909be88586194c8ffdb435fc771195f
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46044
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Strncat() looks almost like strncat(), but it's completely different. Change
the name to reduce confusion.
Also fix a place where strncat() was misused anyway.
BUG=none
BRANCH=all
TEST=manual
sudo FEATURES=test emerge vboot_reference
FEATURES=test emerge-$BOARD vboot_reference
Change-Id: I39c30d391aa6566ec67461462e800720ade66a91
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44572
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The C++ wrapper around various vboot_reference functions doesn't belong in
the vboot repo itself. Put it in the installer repo instead.
BUG=chromium-os:39228
BRANCH=none
TEST=auto
CQ-DEPEND=CL:44441, CL:44443
Refactoring only, no new code. Everything should continue to work as before.
Change-Id: I15ba416987e38905825fedcc87d7b75ebdc4fd1f
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44442
Reviewed-by: Jay Srinivasan <jaysri@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This can trigger the sync mechanism earlier so that the kernel has enough
time to schedule a real disk sync before system reboots.
We sent this in CL 41269, however it is reverted because the sync() and
syncfs() make test cases timeout (tons of disk access). So we only sync
file itself in this CL and leave the whoe system sync outside cgpt.
BUG=chromium-os:35992
TEST=make && make runtests ; and trybot
BRANCH=none
Change-Id: I9c6b602220131f1f011e7865788a122d4c379e73
Reviewed-on: https://gerrit.chromium.org/gerrit/41345
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Yung-Chieh Lo <yjlou@chromium.org>
Tested-by: Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit f3613b60c7374dfcf54c922d46c7da8feeb22000.
That commit attempts to solve a disk-syncing problem by forcing numerous
sync() calls inside cgpt. However, it's too much of a sledgehammer approach.
Some subset of buildbots now run a short test suite when compiling
vboot_reference. On my z620, commit f3613b60c737 increases the time to run
"make runcgpttests" from 1.6 seconds to over eight minutes.
We need a different solution to this problem.
BUG=chromium-os:35992
TEST=manual
BRANCH=none
To test:
cd vboot_reference
make && make runtests
Change-Id: I0489906103dbc93edf201570bd9158621c651d54
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41306
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This can trigger the sync mechanism earlier so that the kernel has enough
time to schedule a real disk sync before system reboots.
BUG=chromium-os:35992
TEST=compile only
BRANCH=none
Change-Id: I505fdf45d95a52c9eca7687ecd6fb9f6be8cc5f1
Reviewed-on: https://gerrit.chromium.org/gerrit/41269
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Yung-Chieh Lo <yjlou@chromium.org>
Commit-Queue: Yung-Chieh Lo <yjlou@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a necessary precursor to getting coverage working.
BUG=chromium-os:26317
BRANCH=none
TEST=manual
sudo emerge vboot_reference
emerge-link vboot_reference chromeos-u-boot
emerge-daisy vboot_reference chromeos-u-boot
Change-Id: Ibed91c64a5ca5fa486169d64fb01a9e868ce27e5
Signed-off-by: Randall Spangler <rspangler@chromium.org>
(cherry picked from commit 13ed1f4812f810ee0a47b946ad990f1fa93f366c)
Reviewed-on: https://gerrit.chromium.org/gerrit/40906
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is to avoid confusion with the canonical common.mk file that is
a CrOS build system.
BUG=chromium-os:33327
TEST=`cros_run_unit_tests --board x86-alex -p vboot_reference` still works
Change-Id: I4b6719d58a4a8ab44b62c23c0e2c45b154374958
Reviewed-on: https://gerrit.chromium.org/gerrit/29578
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change ensures that 'retval' is set for all paths to 'done'.
BUG=none
TEST=Now compiles without warning.
Signed-off-by: Taylor Hutt <thutt@chromium.org>
Change-Id: I4ab368b5c60afbed28a5b6d5417e18bedf986e2d
Reviewed-on: https://gerrit.chromium.org/gerrit/28827
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Taylor Hutt <thutt@chromium.org>
Commit-Ready: Taylor Hutt <thutt@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"cgpt show" output table can be incorrect for large hard drives due to
the number of digits in the start/size parameters. Fix by adding extra
printf padding.
BUG=chromium-os:33082
TEST=emerge, "cgpt show -q /dev/sda" on large HDD platform.
Change-Id: I21008322739f5cd4a34372a4436a71259565c6e7
Reviewed-on: https://gerrit.chromium.org/gerrit/28730
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Shawn Nematbakhsh <shawnn@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Current code only does basic check on parameters, but doesn't validate
if it can pass the CheckEntries(). So a user can accidentally break
the cgpt table by:
cgpt add /dev/sda -i 6 -s 0 # 0 sector is not allowed for a partition.
cgpt show /dev/sda
... INVALID_ENTRIES ...
This CL checks the new entry before we write it to disk. If new entry is
not good, we return fail.
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
BUG=None
TEST=tested on link.
% cgpt add /dev/sda -i 6 -s 0
ERROR: cgpt add: A given parameter is not allowed.
% cgpt show /dev/sda
(no error, and partition 6 is still good)
Change-Id: Iee0ad24f73ca12028c0b8a0a5490b67c815488cf
Reviewed-on: https://gerrit.chromium.org/gerrit/25914
Commit-Ready: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
Reviewed-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
Tested-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The debug mode is used to dump GPT headers and entries no matter the
they are valid or not.
BUG=chromium-os:32142
TEST=tested in chroot with the bad secondary entries.
% cgpt show /dev/sda -d
...
976773135 32 INVALID Sec GPT table
282624 968101888 1 Label: "STATE"
Type: Linux data
...
1 1 INVALID Sec GPT header
Sig: [EFI PART]
Rev: 0x00010000
...
Change-Id: Ie54068353b87c9f15915ffb51b8de688e0367975
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/26091
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
Commit-Ready: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Libraries go into $LDLIBS while linker flags go into $LDFLAGS.
Also make sure the utility subdir respects the env $LDFLAGS so that
we can do things like `make LDFLAGS=-static` and get static binaries.
BUG=None
TEST=`emerge vboot_reference` still works
TEST=`emerge-arm-generic vboot_reference` still works
Change-Id: I989a21bc559bc6d471bc33c057c708bda2eda67e
Reviewed-on: https://gerrit.chromium.org/gerrit/24728
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When I build without this fix, I get errors like this:
armv7a-cros-linux-gnueabi-strip:....libcgpt-cc.a(CgptManager.cc):
Unable to recognise the format of file: File format not recognized
The .a file shouldn't have .cc files in it anyway.
The error appears to have been introduced in:
https://gerrit.chromium.org/gerrit/16433
I'm not sure why it wasn't noticed until now, but perhaps the
new toolchain is just pickier.
BUG=None
TEST=emerge-daisy vboot_reference works
TEST=With future hardfp change, can boot U-Boot compiled with new
toolchain.
Change-Id: I33f15fb38d7e236000845d0a864c1e86469f32c7
Reviewed-on: https://gerrit.chromium.org/gerrit/22476
Tested-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Doug Anderson <dianders@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=none
Change-Id: Ib9781238274285f73d00d8fca4ecda28fc2c6678
Reviewed-on: https://gerrit.chromium.org/gerrit/21748
Commit-Ready: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=chromium-os:12430
TEST=manual
Running "make; make runtests" in src/platform/vboot_refererence will test
this change. Tests for use on a Chromebook are described in the bug report,
but will require a USB or SD card that has a physical write-protect switch.
Change-Id: I16a67bad3b59bec0981f4064f51fb1a29da65a90
Reviewed-on: https://gerrit.chromium.org/gerrit/21474
Tested-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The existing library had a bunch of dependencies which are too many to
build for the 32-bit platform. So this checkin prunes the dependency
list by building only things that are absolutely required for the
functionality used in 32-bit Post-Installer.
Made the use of libuuid restricted only to cgpt and unit tests so that
libcgpt-cc.a doesn't depend on it.
BUG=chromium-os:25374
TEST=Built 32-bit and 64-bit. Tested 32-bit post-install.
Change-Id: Idd0826fdf507a95728fee8adac9520e26f05d469
Reviewed-on: https://gerrit.chromium.org/gerrit/16433
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Commit-Ready: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CgptManager exposes the cgpt commands via a C++ library so that
the post-installer for 32- to 64-bit upgrade can link directly
against a library and thus avoid any shell dependency.
The default make target will not build libcgpt-cc.a since it
requires some dependencies that are available only in chroot.
A separate follow-up checkin to the vboot_reference
ebuild will enable emerging the libcgpt-cc.a by default.
BUG=chromium-os:25374
TEST=Tested with the new unit tests for CgptManager,
ran existing cgpt unit tests, as well as running the
cgpt commands manually. Built on both amd64 and x86.
Tested that vboot_reference is also buildable outside of chroot.
Tested that vboot_reference-firmware and vboot_reference-tests
also build fine with these changes.
CQ-DEPEND=I99f6c321e09c2425eaa8171d78685d2d731954c8
Change-Id: I59a896255b8ea2fc8b1b2150ae7c4ff9d0769699
Reviewed-on: https://gerrit.chromium.org/gerrit/15730
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Ready: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This check-in splits the cgpt into two layers. The top layer (cmd_* files) does
the command-line parsing and the bottom layer (cgpt_* files) does the actual
cgpt work.
This is done so that the bottom layer can be reused for the monolithic
C++ post-installer code that will be done in subsequent checkins.
BUG=chromium-os:25374
TEST=Tested with existing cgpt unit tests as well as running the cgpt commands manually.
Change-Id: I69a31eb3e867a1430cac9a694581331368aa7bb4
Reviewed-on: https://gerrit.chromium.org/gerrit/14940
Reviewed-by: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
Commit-Ready: Jay Srinivasan <jaysri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This lets us reorder the priority of all the kernel partitions with a single
command, instead of a bunch of complicated and error-prone shell script
logic.
Change-Id: I21d39763ec5a748488d5319a987bcfe7c34ce4d0
BUG=chromium-os:9167
TEST=manual
In the chroot, do this:
cd ~/trunk/src/platform/vboot_reference
make
make runtests
make clean
Everything should pass.
Review URL: http://codereview.chromium.org/5352005
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original CL is http://codereview.chromium.org/5025003/, but it was reverted
because the compiler complains code_point variable is not initialized. This CL
just initializes it.
This CL also adds few lines of code to make code more robust.
Change-Id: Ib1329bcaeb4a1bd9abfe9e766b61bd0e52d2c260
BUG=chromium-os:7542
TEST=RUNTESTS=1 emerge-x86-generic vboot_reference
Manually tested the following commands (intentionally mix Chinese and ASCII):
export C=.../cgpt
export D=/tmp/hda
$C add $D -i 1 -l 批P踢T踢T許C夕C餐
$C find $D -l 批P踢T踢T許C夕C餐
$C show $D
$C add $D -i 1 -l abc012
$C add $D -i 1 -l 是否看過坊間常見的許茹芸淚海慶功宴吃蓋飯第四集
$C add $D -i 1 -l 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ # ok and truncated
$C add $D -i 1 -l `printf "\xf4\x91\x81\x81"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xf4\x8f\xbf\xbf"`
$C add $D -i 1 -l `printf "\xf4\x8f\x44\x44"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xf4\x8f\xbf"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xf0\xbf\xbf\xbf"`
$C add $D -i 1 -l `printf "\xf0\xbf\xbf\x44"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xf0\x80\x80\x80"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xf0\x80\x84\x80"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xf0\x80\x90\x80"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xf0\x88\x80\x80"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xed\x80\x80"`
$C add $D -i 1 -l `printf "\xed\xa0\x80"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xe0\xbf\xbf"`
$C add $D -i 1 -l `printf "\xe0\xbf\x44"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xe0\x80\x80"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xe0\x90\x80"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xe0\xbf"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xd0\x80"`
$C add $D -i 1 -l `printf "\xd0\x11"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xd0"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xc0\xaf"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\x80"` # (EXPECT: failed)
Review URL: http://codereview.chromium.org/5104009
|
|
|
|
|
|
|
|
|
|
| |
UTF16."
This reverts commit 6965cbfed3352754f0ff9a270e3b330223b7154c.
TBR=Change broke tree
Change-Id: I5323799bf0bc2f9a1f2815f0c44fc90ca9a7bd77
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For security quick fix, the original UTF8/UTF16 conversion only supports
ASCII area. This CL extends the library to support multiple code units
conversion between UTF8 and UTF16. The UTF8/UTF16 encoded byte(s) would be
decoded to code point first, then be encoded to UTF16/UTF8 correspondingly.
Bill, please kindly review the UTF8/UTF16 conversion.
Peter, please kindly comment if any security concern.
Thanks.
Change-Id: I99c558ff27556e0b8635ba2b8d9925d042e75cb2
BUG=chromium-os:7542
TEST=RUNTESTS=1 emerge-x86-generic vboot_reference
Manually tested the following commands (intentionally mix Chinese and ASCII):
export C=.../cgpt
export D=/tmp/hda
$C add $D -i 1 -l 批P踢T踢T許C夕C餐
$C find $D -l 批P踢T踢T許C夕C餐
$C show $D
$C add $D -i 1 -l 批P踢T踢T許C夕C餐
$C find $D -l 批P踢T踢T許C夕C餐
$C add $D -i 1 -l abc012
$C add $D -i 1 -l 是否看過坊間常見的許茹芸淚海慶功宴吃蓋飯第四集
$C add $D -i 1 -l 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ # ok and truncated
$C add $D -i 1 -l `printf "\xf4\x91\x81\x81"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xf4\x8f\xbf\xbf"`
$C add $D -i 1 -l `printf "\xf4\x8f\x44\x44"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xf4\x8f\xbf"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xf0\xbf\xbf\xbf"`
$C add $D -i 1 -l `printf "\xf0\xbf\xbf\x44"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xf0\x80\x80\x80"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xf0\x80\x84\x80"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xf0\x80\x90\x80"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xf0\x88\x80\x80"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xed\x80\x80"`
$C add $D -i 1 -l `printf "\xed\xa0\x80"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xe0\xbf\xbf"`
$C add $D -i 1 -l `printf "\xe0\xbf\x44"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xe0\x80\x80"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xe0\x90\x80"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xe0\xbf"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xd0\x80"`
$C add $D -i 1 -l `printf "\xd0\x11"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xd0"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\xc0\xaf"` # (EXPECT: failed)
$C add $D -i 1 -l `printf "\x80"` # (EXPECT: failed)
Review URL: http://codereview.chromium.org/5025003
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
http://code.google.com/p/chromium-os/issues/detail?id=9279
This issue disclosed a bug of cgpt. The bug comes from the 'show' command always
reads the primary entry table when '-i partition' is specified. I added an
ANY_VALID constant for GetEntry to automatically select valid entry table.
Also fixed the bugs in cmd_boot.c and cmd_find.c. In cmd_add.c, stop user to
continue if any header/entry table is invalid.
Also fixed the bug that untrusted header size could cause segmentation failure.
Hungte, this is FYI. But welcome to do review.
BUG=chromium-os:9279
TEST=RUNTESTS=1 emerge-x86-generic vboot_reference
Manually tested:
cgpt show /tmp/test -i 1 -b
cgpt show /tmp/test
cgpt add /tmp/test -i 1 -l TEST
cgpt find /tmp/test -l STATE
cgpt boot /tmp/test -i 1
Change-Id: Iaba9c635754096a82b3ec74634af184362d4e264
Change-Id: I6f3e87e3998457676e3388d2a6ed36c0564796d8
Review URL: http://codereview.chromium.org/5115002
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=chromium-os:8621
TEST=See below
1. Build and run tests of vboot (including linktest)
$ make && make runtests
2. Check if *_stub.o are not in vboot_fw.a
$ nm /build/<board>/usr/lib/vboot_fw.a | grep _stub.o
3. Build and boot x86-generic image
$ ./build_packages --board=x86-generic && ./build_image --board=x86-generic
(Then successfully boot the image you just built)
See CL=4372001 for u-boot side changes
Review URL: http://codereview.chromium.org/4266002
Change-Id: Icc2bcc551c998f370e4b737fbe442ebf029cd81c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. Check for potential integer overflow in sector_bytes * sector_count.
2. Added O_NOFOLLOW to open() call - Is this enough?
3. Passing buffer length to GuidToStr(), PMBRToStr().
4. Use unsigned int in GetEntry() to determine stride.
5. Address conversion between UTF16 and UTF8.
Note: The UTF conversion is complex and troublesome, and needs careful
consideration to get right. For now, I've just forced the interpretation of
the partition name to 7-bit ASCII. That's sufficient for the needs of Chrome
OS, and I can file a new issue to handle UTF correctly.
BUG=chrome-os-partner:705
TEST=manual
Running "make runtests" invokes the tests/run_cgpt_tests.sh script, which checks the behavior and output of the cgpt tool.
Review URL: http://codereview.chromium.org/3594010
Change-Id: I5fd29796d8c929527e0cfbc6d5ccbcdc77502c6b
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is part of the proposed developer-mode installation process, where we
want to detect that whoever is fiddling with the hard drive has already
fiddled with it before. Otherwise, we'll make them wait a bit to prevent
drive-by updates.
BUG=chromium-os:5306
Change-Id: Ifd6dce69180fa818fe14dbc3b1ac3485fb15d1c9
Review URL: http://codereview.chromium.org/3122023
|
|
|
|
| |
Review URL: http://codereview.chromium.org/3094003
|
|
|
|
| |
Review URL: http://codereview.chromium.org/2849040
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It turned out that shared verified boot library fails to
work properly when compiled by msc in BIOS environment.
The culprit was identified as failing 64 bit logical
operations by preprocessor. It is probably possible to
come up with a certain compile flag set to fix the
operations, but it is not easy to modify and control the BIOS
compilation environment.
The alternative solution is to limit the size of the field
in question to 16 bits (especially since this is the only
part of the attributes field which is supposed to be
altered by firmware.
A union is being introduced in firmware/lib/cgptlib/include/gpt.h:GptEntry to allow
accessing the field both as a 64 bit entity and a top
16 bit field. All places where this field is used are
being modified appropriately.
tests/Makefile is being fixed to allow controlling test run
from the top level directory.
Tested by building everything and running tests.
All tests pass.
Review URL: http://codereview.chromium.org/2799019
|
|
|
|
|
|
|
|
| |
This makes it much easier to port vboot_firmware to platforms (such as
UEFI) which don't have the standard include files; only sysincludes.h
needs to be altered.
Review URL: http://codereview.chromium.org/2833012
|