chromiumos/platform/factory_test_tools.git
23 months agoMark deprecated. This repo has been replaced by 'chromeos-factory'. factory-2338.B factory-2368.B factory-2394.B factory-2460.B firmware-link-2348.B master release-R21-2465.B
Tammo Spalink [Fri, 11 May 2012 06:18:22 +0000 (14:18 +0800)]
Mark deprecated.  This repo has been replaced by 'chromeos-factory'.

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

Change-Id: I5f154d4bf56eda6f3c00cccc583db49deaddb097
Reviewed-on: https://gerrit.chromium.org/gerrit/22448
Commit-Ready: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Tested-by: Tammo Spalink <tammo@chromium.org>
23 months agokeyboard variant value should be resolved factory-2268.16.B release-R20-2268.B
Jay Kim [Tue, 8 May 2012 01:52:18 +0000 (18:52 -0700)]
keyboard variant value should be resolved

BUG=chrome-os-partner:9385
TEST=Check if the keyboard variant value is resolved.

Change-Id: Ibc23896718e84b99056b902a4d7ead58ed94288a
Reviewed-on: https://gerrit.chromium.org/gerrit/22072
Commit-Ready: Jay Kim <yongjaek@chromium.org>
Tested-by: Jay Kim <yongjaek@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
23 months agoRefactor gooftool, eliminating boilerplate. stabilize2
Tammo Spalink [Tue, 3 Apr 2012 03:10:41 +0000 (11:10 +0800)]
Refactor gooftool, eliminating boilerplate.

Eliminate gft_common, switch to use the python 2.7 argparse
with subcommands (like hwid_tool), and also use logging instead
of the home-made xxxMsg commands.  Also switch to using the
RunShellCmd (renamed Shell) from common instead of the
myriad versions in gft_common.

BUG=chrome-os-partner:9149
TEST=run all of the gooftool subcommands on a DUT

Change-Id: I50ad8a9e2e7cb760317e2b8c2e94531dcfd5c451
Reviewed-on: https://gerrit.chromium.org/gerrit/20052
Tested-by: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Tammo Spalink <tammo@chromium.org>

2 years agoCreate indpendent FW hash generation function.
Tammo Spalink [Wed, 28 Mar 2012 01:57:40 +0000 (09:57 +0800)]
Create indpendent FW hash generation function.

Pull out the hash generation code from probe() and allow
it to be called independently.  This new function can be
run on arbitrary firmware blobs and it will try to determine
the type of fw (main vs ec) and produce the correct corresponding
hashes.

BUG=chrome-os-partner:8616
TEST=import the probe module and run probe() with arguments ;
     alternatively, wait for the follow-on CL which includes
     the necessary arguments in the gooftool probe command.

Change-Id: Idc43da9a709aa5274bd19377a144a668a5cdada8
Reviewed-on: https://gerrit.chromium.org/gerrit/19212
Commit-Ready: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Tested-by: Tammo Spalink <tammo@chromium.org>
2 years agoCleanup based on running pylint.
Tammo Spalink [Thu, 19 Apr 2012 06:08:17 +0000 (14:08 +0800)]
Cleanup based on running pylint.

BUG=none
TEST=none

Change-Id: Ideb171a8ad41ab8ac836c236cdfbef18289c803a
Reviewed-on: https://gerrit.chromium.org/gerrit/20548
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Tammo Spalink <tammo@chromium.org>
Commit-Ready: Tammo Spalink <tammo@chromium.org>

2 years ago[factory_test_tools] add OWNERS
Hung-Te Lin [Mon, 9 Apr 2012 04:28:38 +0000 (12:28 +0800)]
[factory_test_tools] add OWNERS

TEST=none
BUG=chromium-os:22007

Change-Id: I68555c0f3b570ef12f8aacc17eb4bf4867999766
Reviewed-on: https://gerrit.chromium.org/gerrit/19806
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>

2 years agoMove probe() from hwid_tool into gooftool. release-R19-2046.B
Tammo Spalink [Fri, 23 Mar 2012 09:20:17 +0000 (17:20 +0800)]
Move probe() from hwid_tool into gooftool.

Since probe only makes sense on a DUT, and since probing requires
modules only available on DUTs, the probe command does not belong
in hwid_tool.

As part of the move, clean up the code a bit.

The output of probe should be tolerably human-readable, but
primarily machine parseable.  This CL cleans things up to only
use yaml-encoded output.

Probe result cooking is cleaned up as well.

BUG=chrome-os-partner:8616
TEST=run gooftool --probe and --verify-hwid

Change-Id: I1fe9382cbb25dd94b2d8a31f66158ed03f773255
Reviewed-on: https://gerrit.chromium.org/gerrit/18950
Commit-Ready: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Tested-by: Tammo Spalink <tammo@chromium.org>
2 years agohwid_tool: Add comp_rename command.
Tammo Spalink [Fri, 23 Mar 2012 02:12:51 +0000 (10:12 +0800)]
hwid_tool: Add comp_rename command.

Automatically generated component names are not very human
readable, so this command allows replacement once better names
have been selected.

BUG=chrome-os-partner:8644
TEST=run hwid_tool comp_rename

Change-Id: I11eeec3d40f6309dadf03cc6fb7f7e7f3984cd9f
Reviewed-on: https://gerrit.chromium.org/gerrit/19061
Reviewed-by: Rong Chang <rongchang@chromium.org>
Commit-Ready: Tammo Spalink <tammo@chromium.org>
Tested-by: Tammo Spalink <tammo@chromium.org>
2 years agoRemove cardreader probe, and thereby the comp_db probe argument.
Tammo Spalink [Fri, 23 Mar 2012 06:36:10 +0000 (14:36 +0800)]
Remove cardreader probe, and thereby the comp_db probe argument.

This was never really a probe, just a potentially flakey scan
through log files based on a probe result whitelist.

Instead, this will be addressed by chrome-os-partner:8614

BUG=chrome-os-partner:8616
TEST=no externally visible behavior change

Change-Id: I442fd6d78aabe6a78c65a9d57e1674dfe4c77959
Reviewed-on: https://gerrit.chromium.org/gerrit/18937
Tested-by: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Tammo Spalink <tammo@chromium.org>

2 years agohwid_tool: Fix config_factory_initial entry prefixes.
Tammo Spalink [Thu, 22 Mar 2012 07:03:06 +0000 (15:03 +0800)]
hwid_tool: Fix config_factory_initial entry prefixes.

BUG=chrome-os-partner:8598
TEST=run hwid_tool legacy_export; inspect resulting files

Change-Id: I39a4f6c745f6d09a34f93ecafe17cd7ca5d62308
Reviewed-on: https://gerrit.chromium.org/gerrit/18818
Commit-Ready: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Tested-by: Tammo Spalink <tammo@chromium.org>
2 years agoSupport volatile, initial config, and bom creation from data import.
Tammo Spalink [Tue, 20 Mar 2012 06:46:50 +0000 (14:46 +0800)]
Support volatile, initial config, and bom creation from data import.

Modulo a few TODOs, this CL allows full import of the data generated
by the probing code into the new HWID database.

BUG=chrome-os-partner:6007
TEST=run 'hwid_tool assimilate_probe_data'

Change-Id: I335ff3cd38417b893788a524ad3613f215b81997
Reviewed-on: https://gerrit.chromium.org/gerrit/18518
Tested-by: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Tammo Spalink <tammo@chromium.org>

2 years agoAdd hwid_tool command to generate legacy hwid data files.
Tammo Spalink [Tue, 20 Mar 2012 10:14:05 +0000 (18:14 +0800)]
Add hwid_tool command to generate legacy hwid data files.

This is useful to allow maintaining data in the new format with
the tool, but allowing that data to be consumed by code from
older factory branches.

BUG=chrome-os-partner:7974
TEST=run 'hwid_tool legacy_export'

Change-Id: I13a4993ca7cc82b0c65c4f39df8bd052691225bb
Reviewed-on: https://gerrit.chromium.org/gerrit/18527
Commit-Ready: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Tested-by: Tammo Spalink <tammo@chromium.org>
2 years agoClean up status data repr, remove crufty fields, and /s/hash/volatile.
Tammo Spalink [Mon, 19 Mar 2012 06:04:07 +0000 (14:04 +0800)]
Clean up status data repr, remove crufty fields, and /s/hash/volatile.

Status is easier to deal with (and extend) if consolidated into
a single dict for hwids and one for components, respectively.

The bitmap path and release string fields are removed.  Bitmaps
are obsolete.  For release, we can represent the same data within
either initial_config or volatile.

Volatile is not restricted to just containing hash values.  Change
the name to reflect that (which also makes fields sort better).

BUG=chrome-os-partner:6003
TEST=run hwid_tool usng data files that contain fields matching
     the changes in this CL (eg, CompDb with 'registry' and
     'status_map' as opposed to the more numerous previous fields.
     successfully running any hwid_tool command is sufficient
     to test, since it will validate data on any read.

Change-Id: I7b349781093358cce49089feff147705bdd17206
Reviewed-on: https://gerrit.chromium.org/gerrit/18446
Commit-Ready: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Tested-by: Tammo Spalink <tammo@chromium.org>
2 years agogooftool: Probe embedded controller by mosys.
Hung-Te Lin [Tue, 20 Mar 2012 06:47:40 +0000 (14:47 +0800)]
gooftool: Probe embedded controller by mosys.

Probing embedded controller by superiotool is now deprecated.
mosys will provide same functionality.

BUG=chrome-os-partner:8551
TEST=Manually verified on ZGB, getting "nuvXXX npceXXX" output.
     On platforms without "ec info" command, see NONE result.

Change-Id: I775170b20ff487a43418720308ece063d9ab302a
Reviewed-on: https://gerrit.chromium.org/gerrit/18519
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agogooftool: change postinst param for new cros_installer. factory-1987.B
Hung-Te Lin [Mon, 12 Mar 2012 12:56:29 +0000 (20:56 +0800)]
gooftool: change postinst param for new cros_installer.

--noupdate_firmware is not available and IS_FACTORY_INSTALL=1 is the better way
to stop firmware updating.

BUG=chrome-os-partner:8396
TEST=./gft_verify_rootfs.sh # pass, not seeing firmware updates.

Change-Id: I6d4a73850c41404cdc1a54fb8d36fa361a6273c0
Reviewed-on: https://gerrit.chromium.org/gerrit/17826
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agoFix miscellaneous small cosmetic and flow issues.
Tammo Spalink [Fri, 9 Mar 2012 05:39:09 +0000 (13:39 +0800)]
Fix miscellaneous small cosmetic and flow issues.

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

Change-Id: I88fb4cd62084c5d9c1c37e6b35dc37debce80141
Reviewed-on: https://gerrit.chromium.org/gerrit/17675
Commit-Ready: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Tested-by: Tammo Spalink <tammo@chromium.org>
2 years agoAdd filter hwid_tool command, to filter data for just one board.
Tammo Spalink [Tue, 6 Mar 2012 08:36:22 +0000 (16:36 +0800)]
Add filter hwid_tool command, to filter data for just one board.

This is for use in producing bundles/releases.  The filter
command will produce data files containing only the necessary
data for a given kind of build (filtering by component and bom
supportedness status), and will remove all of the unrelated
component probe names and data from the component_db.

BUG=chrome-os-partner:6003
TEST=run hwid_tool filter_database

Change-Id: Ie5292fbedebe2e150ee6e2f86de1741c1935f84f
Reviewed-on: https://gerrit.chromium.org/gerrit/17579
Commit-Ready: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Tested-by: Tammo Spalink <tammo@chromium.org>
2 years agogooftool: Add new "developer_finalize" command allows re-testing factory flow.
Hung-Te Lin [Fri, 9 Mar 2012 04:02:15 +0000 (12:02 +0800)]
gooftool: Add new "developer_finalize" command allows re-testing factory flow.

For devices in early proto/dvt stage, we don't want to enforce commands that
would prevent DUT to be re-tested or re-initialized again (ex, write protection
or developer mode).

BUG=chrome-os-partner:8396
TEST=gooftool --developer_finalize # pass

Change-Id: I8fb8248ec78c71c09512c3d332c93c9cf26c77db
Reviewed-on: https://gerrit.chromium.org/gerrit/17670
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>

2 years agoAllow generation and input of machine-readable component data.
Tammo Spalink [Mon, 5 Mar 2012 08:38:07 +0000 (16:38 +0800)]
Allow generation and input of machine-readable component data.

Add hwid_tool command options to produce probe data
in vanilla yaml format, which can then be fed back into
another command which will add that to the component
database.  The hwid_tool behavior is modified to always
update the database files with data changes.  This is
as opposed to creating a series of copies with incremental
changes (which is not very useful, since we have git history).

BUG=chrome-os-partner:6003
TEST=hwid_tool w/ assimilate_probe_data, probe_device, or
     board_create

Change-Id: I2bc4f4e20d8f2277dcb0fad57f3aef81daa1f75c
Reviewed-on: https://gerrit.chromium.org/gerrit/17392
Commit-Ready: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Tested-by: Tammo Spalink <tammo@chromium.org>
2 years agogooftool: fix --clear_gbb_flags
Hung-Te Lin [Thu, 8 Mar 2012 10:49:33 +0000 (18:49 +0800)]
gooftool: fix --clear_gbb_flags

Sometimes flashrom default target bus will be changed to LPC and then calling
flashrom without bus param will be incorrect value.

To fix that, we should always assign bus when calling flashrom.

BUG=chrome-os-partner:8396
TEST=./gooftool --clear_gbb_flags

Change-Id: I4d1f4cde3f04400e42c0cedef31544e7037b3798
Reviewed-on: https://gerrit.chromium.org/gerrit/17581
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agogooftool: Fix --verify_rootfs and --prepare_wipe.
Hung-Te Lin [Thu, 8 Mar 2012 10:48:02 +0000 (18:48 +0800)]
gooftool: Fix --verify_rootfs and --prepare_wipe.

The "postinst" command has been changed from simple script to native code
"cros_installer", and it does not support --noupdate_firmware anymore.

Let's temporary disable the parameter until it's fixed (or provided in other
name).

BUG=chrome-os-partner:8396
TEST=./gooftool --verify_rootfs --prepare_wipe

Change-Id: Ie4a041f66eef8b94da0f5a8e850ffcc83c8ae610
Reviewed-on: https://gerrit.chromium.org/gerrit/17580
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agogooftool: Fix execution failure.
Hung-Te Lin [Thu, 8 Mar 2012 10:43:51 +0000 (18:43 +0800)]
gooftool: Fix execution failure.

The gft_fwhash was already removed, and syntax of root fs / kernel detection
function return value is changed to full path.

BUG=chrome-os-partner:8396
TEST=./gooftool --verify_rootfs

Change-Id: I14324843db69ff009e70c7b9dd4150d9065fa7f8
Reviewed-on: https://gerrit.chromium.org/gerrit/17578
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agofactory_test_tools: Refine firmware utilities.
Hung-Te Lin [Fri, 2 Mar 2012 08:12:34 +0000 (16:12 +0800)]
factory_test_tools: Refine firmware utilities.

flashrom_util is deprecated by new "crosfw" module, which provides more
convenient and better API for accessing firmware.

Firmware hash calculateion is also changed to use ChromeOS standard key tool
"vbutil_key", so we can share the hash with other programs (ex,
vbutil_what_keys).

This CL also cleans up unused files (inherit-review-settings-ok) file from
factory_test_tools repo.

BUG=chrome-os-partner:6003
TEST=./gooftool --write_hwid --hwid HWID # pass
     ./gooftool --verifed_hwid --create_report # pass
     ./gft_wpfw.py main # success

Change-Id: I82905351e116eda7e4a2cfc574d77e2bfb8124d7
Reviewed-on: https://gerrit.chromium.org/gerrit/17218
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agoFix accidental comment of probe import.
Tammo Spalink [Tue, 6 Mar 2012 08:47:26 +0000 (16:47 +0800)]
Fix accidental comment of probe import.

Revert mistakenly commented import to allow the hwid_tool
to perform probing.  The current location of this import
prevents hwid_tool from being used outside of the
factory test image, but another outstanding CL is addressing
that.

BUG=chrome-os-partner:6003
TEST=run hwid_tool probe_device on a device

Change-Id: Ib66b8a620aa435f7b0532289f09a749316f77567
Reviewed-on: https://gerrit.chromium.org/gerrit/17395
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Tammo Spalink <tammo@chromium.org>
Tested-by: Tammo Spalink <tammo@chromium.org>
2 years agoSet hwid_tool default data search path to match factory test image.
Tammo Spalink [Tue, 6 Mar 2012 08:38:43 +0000 (16:38 +0800)]
Set hwid_tool default data search path to match factory test image.

When using the hwid_tool outside of the factory test image, the
path needs to be specified by command line option.

BUG=chrome-os-partner:6003
TEST=run hwid_tool inside a factory test image, do not specifiy
     -p option

Change-Id: Ife3adec4635662fc4182d0841c865cc4d020b74a
Reviewed-on: https://gerrit.chromium.org/gerrit/17394
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Tammo Spalink <tammo@chromium.org>
Tested-by: Tammo Spalink <tammo@chromium.org>
2 years agoAdd error reporting to data parsing and verification.
Tammo Spalink [Fri, 2 Mar 2012 07:52:11 +0000 (15:52 +0800)]
Add error reporting to data parsing and verification.

Addressed two TODOs.  This allows for more human-friendly
modification of data schemas and data, because now it will
tell you where and what kind of errors are present in the
data.

Also fix up the order of schema elements to match the
order in yaml data.

BUG=chrome-os-partner:6003
TEST=run hwid_tool overview or data verification

Change-Id: I838831d61c7777d1eaa74d4457ddb0908276469f
Reviewed-on: https://gerrit.chromium.org/gerrit/17308
Commit-Ready: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Tested-by: Tammo Spalink <tammo@chromium.org>
2 years agoFix structured printing routine, and use of common.
Tammo Spalink [Mon, 5 Mar 2012 04:38:35 +0000 (12:38 +0800)]
Fix structured printing routine, and use of common.

Formatting was not quite right for some use cases.

Clean up redundant defs that can be included from common.

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

Change-Id: I6db86382a9b85203805deb0c0c2d7255c3724c07
Reviewed-on: https://gerrit.chromium.org/gerrit/17303
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Tammo Spalink <tammo@chromium.org>
Tested-by: Tammo Spalink <tammo@chromium.org>
2 years agoRemove the build_name HWID element.
Tammo Spalink [Fri, 24 Feb 2012 07:33:41 +0000 (15:33 +0800)]
Remove the build_name HWID element.

This field is not actually adding any value, and implementing
it correctly would be complicated (and make everything else
more complicated too).  Basically, we want all bom names to be
unique, regardless of being part of an early build, and
regardless of status (supported, deprecated, eol, etc).

BUG=chrome-os-partner:6998
TEST=not practical, there is no data yet, this
     is preparing for data

Change-Id: Ia5392c08cbee045423b95a7075f98c27bd1af093
Reviewed-on: https://gerrit.chromium.org/gerrit/16615
Tested-by: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Tammo Spalink <tammo@chromium.org>

2 years agoRefactor probing code to be more modular, and link to hwid_tool.
Tammo Spalink [Wed, 30 Nov 2011 09:05:44 +0000 (17:05 +0800)]
Refactor probing code to be more modular, and link to hwid_tool.

Add hwid_tool 'probe device' command which calls out to probe
module.  The new probe module returns raw probing results which
are then matched with the component and device databases.

Also adds support for python logging, which is in turn used by the
probing library.  Logging can be controlled via cmdline args.

BUG=chrome-os-partner:6003
TEST=manual(on a DUT, run 'hwid_tool -p data -v 4 probe_device'
            where data is a subdirectory containing a component_db
            file, or run 'gooftool --db_path=data -d -v
            --verify_hwid' which additionally requires a file
            with board-specific HWID data in the data directory ;
            please contact me directly for sample data)

Change-Id: Ie903454dc0e4fe9a22a0356ffa16ff9fd13ee41d
Reviewed-on: https://gerrit.chromium.org/gerrit/12259
Tested-by: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Commit-Ready: Tammo Spalink <tammo@chromium.org>

2 years agogft_upload: Add shopfloor://url#SN upload method
Hung-Te Lin [Wed, 22 Feb 2012 04:50:18 +0000 (12:50 +0800)]
gft_upload: Add shopfloor://url#SN upload method

Support the new XMLRPC based shop floor server protocol in gooftool upload
methods.

BUG=chrome-os-partner:6911
TEST=Manually: start shop floor server with sample module/data, then
     ./gft_upload report.gz http://localhost:8082/#CR001001  # success
     ./gft_upload report.gz http://localhost:8082/#CR002001  # failure with unknown SN

Change-Id: If6d8f203644fe3423bba1d65c00a1ff3efcd5540
Reviewed-on: https://gerrit.chromium.org/gerrit/16343
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agoMove hwid_tool (and its modules) into the gooftool repo.
Tammo Spalink [Tue, 21 Feb 2012 02:13:40 +0000 (10:13 +0800)]
Move hwid_tool (and its modules) into the gooftool repo.

Gooftool and the hwid_tool mutually depend on one another's
modules, and hence things are simplest if they live together.

BUG=chromium-os:26622
TEST=manual(run the hwid_tool from within the new directory)

Change-Id: I800a2ce7c88ed7599ccb1192e8cfa285fac05bd4
Reviewed-on: https://gerrit.chromium.org/gerrit/16241
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Tammo Spalink <tammo@chromium.org>
Commit-Ready: Tammo Spalink <tammo@chromium.org>

2 years agogooftool: improve flashrom writing speed. release-R18-1660.B
Hung-Te Lin [Thu, 19 Jan 2012 07:20:42 +0000 (15:20 +0800)]
gooftool: improve flashrom writing speed.

Latest flashrom supports "--fast-verify" option which can improve writing speed.
Factory scripts should use it to optimize processing time.

BUG=none
TEST=time ./gft_clear_gbb_flags.sh
     # changed from 16s to 10s

Change-Id: I2db034ef63e2d60e7669a9c1ea45c94b9d8ef85f
Reviewed-on: https://gerrit.chromium.org/gerrit/14458
Reviewed-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agogft_hwcomp: Fix vendor string error when ME override switch is asserted
Hung-Te Lin [Thu, 19 Jan 2012 01:30:26 +0000 (09:30 +0800)]
gft_hwcomp: Fix vendor string error when ME override switch is asserted

Currently flashrom outputs extra message when ME override switch is asserted,
causing the regular expression to fail parsing vendor string.

The solution is to add restriction so that new lines won't be matched.

BUG=chrome-os-partner:7613, chrome-os-partner:7325
TEST=./gft_hwcomp # see id_flash_chip as 'XYZ ABCD' even if ME is asserted

Change-Id: Iea8b68b8d3c68b6189568d294df70559cf74b276
Reviewed-on: https://gerrit.chromium.org/gerrit/14432
Tested-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Jay Kim <yongjaek@chromium.org>
2 years agofactory_test_tools: fix regular expression error when reading firmware
Hung-Te Lin [Fri, 13 Jan 2012 03:03:16 +0000 (11:03 +0800)]
factory_test_tools: fix regular expression error when reading firmware

Seems like the prefix space (' ') was unexpected removed from last CL.

BUG=chrome-os-partner:2457
TEST=./gft_hwcomp # see part_id_flash_chip correctly.

Change-Id: Ia5d7110eb33926ea164bf421b7f7e2631e6aa648
Reviewed-on: https://gerrit.chromium.org/gerrit/14128
Reviewed-by: Jay Kim <yongjaek@chromium.org>
Tested-by: Jay Kim <yongjaek@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agogft_hwcomp: Support new --flash-name (better flash chipset probing)
Hung-Te Lin [Wed, 21 Dec 2011 08:32:36 +0000 (16:32 +0800)]
gft_hwcomp: Support new --flash-name (better flash chipset probing)

The new --flash-name in flashrom has a better machine/script friendly output
format.

BUG=chrome-os-partner:2457
TEST=./gft_hwcomp # see part_id_flash_chip correctly.

Change-Id: Ia865951e6ec566153b2afda3d02f97dc947c46d5
Reviewed-on: https://gerrit.chromium.org/gerrit/13330
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Jay Kim <yongjaek@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agogft_fwhash: allow omitting data_bitmap_fv in HWID component spec file.
Hung-Te Lin [Wed, 21 Dec 2011 10:18:39 +0000 (18:18 +0800)]
gft_fwhash: allow omitting data_bitmap_fv in HWID component spec file.

New firmware supports "universal bitmaps" and may be already shipped with
official bitmaps.  This CL allows removing data_bitmap_fv from HWID spec file.

BUG=chrome-os-partner:7328
TEST=gooftool --write_gbb=TEST_FILE # TEST_FILE does not contain data_bitmap_fv

Change-Id: Ia6b2f3393d1aecde700a2ec8e55b3f580f483cb4
Reviewed-on: https://gerrit.chromium.org/gerrit/13332
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Jay Kim <yongjaek@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>

2 years agogooftool: support configuration without EC for wpfw and report commands. release-R17-1412.B
Hung-Te Lin [Thu, 24 Nov 2011 02:54:32 +0000 (10:54 +0800)]
gooftool: support configuration without EC for wpfw and report commands.

Devices without EC still need to pass finalization command (including wpfw and
report).  We support that by checking hwcomp.has_ec_flash() and always include
results in report.

BUG=chrome-os-partner:6949
TEST=./gooftool --finalize # pass on system without EC

Change-Id: I61be27f681fed0e10017208dca17099ff6a69929
Reviewed-on: https://gerrit.chromium.org/gerrit/12100
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Jay Kim <yongjaek@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>

2 years agoIngore compiled python files (pyc) in repository.
Dave Parker [Mon, 21 Nov 2011 20:03:18 +0000 (12:03 -0800)]
Ingore compiled python files (pyc) in repository.

BUG=None
TEST=git status

Change-Id: I34871e049ef38f0f24c7679813f561b2f54a7931
Reviewed-on: https://gerrit.chromium.org/gerrit/11991
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Dave Parker <dparker@chromium.org>
2 years agogooftool: probe existence of EC flash chipset by "flashrom" command.
Hung-Te Lin [Wed, 16 Nov 2011 11:40:59 +0000 (19:40 +0800)]
gooftool: probe existence of EC flash chipset by "flashrom" command.

Since both x86/arm platform may include EC flash chip or not (depends on
desktop/laptop instead of platform), we should trust the result from "flashrom"
instead of hard-coding by platform architecture.

BUG=chrome-os-partner:6875
TEST=./gft_hwcomp # on system without EC, see empty fields
                  # on system with EC, still seeing EC data.

Change-Id: I4acaf91010343f51be3d3ff0c12b10008394f8ff
Reviewed-on: https://gerrit.chromium.org/gerrit/11758
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2 years agogooftool: support curl options for FTP protocol firmware-kiev-2.112.B firmware-uboot_v2-1299.B
Hung-Te Lin [Tue, 8 Nov 2011 07:59:30 +0000 (15:59 +0800)]
gooftool: support curl options for FTP protocol

Add "curl:ftp[s]://userid@host" protocol.

The default FTP is still using Python ftplib (for backward compatible and better
connection status checking), but partners can now select curl-based FTP for
special params like --ftp-create-dirs.

BUG=chrome-os-partner:6236
TEST=./gft_upload some_file curl:ftp://localhost # pass, seeing curl commands.

Change-Id: I4c993cf973a1e2a23631ae43f912d10215dad764
Reviewed-on: https://gerrit.chromium.org/gerrit/11310
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>

2 years agogooftool: add 'tag' in reports to specify report type.
Hung-Te Lin [Thu, 3 Nov 2011 13:03:35 +0000 (21:03 +0800)]
gooftool: add 'tag' in reports to specify report type.

We need some meta data to describe the type of data in report.
The tag field allows arbitrary string to store such information.

BUG=chromium-os:22460,chrome-os-partner:6710
TEST=./gooftool --create_report # seeing tag='' in report
     ./gooftool --create_report --report_tag 'rma' # seeing tag='rma' in report

Change-Id: Ia6cfc29be454a33cb5c3f252a943a1e0b4b9f9d1
Reviewed-on: https://gerrit.chromium.org/gerrit/11124
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>

2 years agogooftool: standarize default report file name
Hung-Te Lin [Mon, 31 Oct 2011 11:37:25 +0000 (19:37 +0800)]
gooftool: standarize default report file name

To support CPFE and simplify report analyzing in future, we should make the
report file names unified.

BUG=chrome-os-partner:6651
TEST=./gooftool --upload_report --report_path blah --upload_method ftp://localhost/
     # see report uploaded in correct form: $platform_$sn_$time.rpt[$filters]

Change-Id: I7531557c8a68edec7a23cd7896300cc868400796
Reviewed-on: https://gerrit.chromium.org/gerrit/10894
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>

2 years agogooftool: support curl for uploading reports.
Hung-Te Lin [Thu, 27 Oct 2011 12:30:38 +0000 (20:30 +0800)]
gooftool: support curl for uploading reports.

To allow more uploading protocols, curl should be supported.
This CL enables ftps://, cpfe://URL, and curl:CURL_COMMAND upload methods.

BUG=chrome-os-partner:6651
TEST=./gft_upload.py some_file ftp://anonymous@localhost/ # success
     ./gft_upload.py some_file ftps://anonymous@localhost/ # success
     ./gft_upload.py some_file cpfe:http://localhost/ # run a local HTTP server and success

Change-Id: I4fd0feb41db55bca3a9e1f8a483aeeb2c0040112
Reviewed-on: https://gerrit.chromium.org/gerrit/10777
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>

2 years agogooftool: allow not_present in part_id_cardreader
Hung-Te Lin [Thu, 3 Nov 2011 13:10:19 +0000 (21:10 +0800)]
gooftool: allow not_present in part_id_cardreader

Fix previous CL: _not_present needs object.

BUG=chromium-os:22336
TEST=./gft_hwcomp component_file_with_empty_cardreader  # success

Change-Id: I6c127ee9a4cb0b4a359623cf24bc9fbe9c791e63
Reviewed-on: https://gerrit.chromium.org/gerrit/11125
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Jay Kim <yongjaek@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>

2 years agoProbing total size of memory and DIMM timing info
Jay Kim [Sat, 29 Oct 2011 04:42:30 +0000 (04:42 +0000)]
Probing total size of memory and DIMM timing info

part_id_dram should be able to probe the total size of memory on x86
platform. part_id_dimm is added to detect the DIMM timing info.

e.g., 1024(DIMM 0) + 1024(DIMM 1)
part_id_dram: ['2048']
part_id_dimm: ['0|1024|DDR3-800,DDR3-1066,DDR3-1333
1|1024|DDR3-800,DDR3-1066,DDR3-1333']

BUG=chrome-os-partner:6215
TEST=HWID validation test should detect the total size of dram and dimm
timing info

Change-Id: I701345fb75a5078767afadac35c93b49ff76b53c
Reviewed-on: https://gerrit.chromium.org/gerrit/10885
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Jay Kim <yongjaek@chromium.org>
2 years agogooftool: allow not_present in part_id_cardreader
Hung-Te Lin [Tue, 1 Nov 2011 07:39:59 +0000 (15:39 +0800)]
gooftool: allow not_present in part_id_cardreader

Since "probing" card reader can only verify if a given ID exist or not, when the
ID itself is "non exist" we can only return "True".

BUG=chromium-os:22336
TEST=./gft_hwcomp component_file_with_empty_cardreader  # success

Change-Id: Ibc05c870649055f410bfac3fec87d755809b2f62
Reviewed-on: https://gerrit.chromium.org/gerrit/10953
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Jay Kim <yongjaek@chromium.org>
Tested-by: Jay Kim <yongjaek@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>

2 years agoDIMM memory module size for Newton
Jay Kim [Mon, 24 Oct 2011 21:52:52 +0000 (21:52 +0000)]
DIMM memory module size for Newton

The device should have a correct memory module size per dimm during
manufacturing. It should be verified on factory_ProbeHWID.

Updated according to Hungte's advice to reuse the part_id_dram and
handling multiple memory slot information such as "1024 1024".

BUG=chrome-os-partner:6215
TEST=factory_ProbeHWID should be able to report memory info in separate
dimm slots.

Change-Id: I6c5710079c21f6669fdc957ac10c8313dff5045c
Reviewed-on: http://gerrit.chromium.org/gerrit/10593
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Tested-by: Jay Kim <yongjaek@chromium.org>
2 years agoAdd component probing for batteries. release-R16-1193.B
Dave Parker [Wed, 5 Oct 2011 01:09:15 +0000 (18:09 -0700)]
Add component probing for batteries.

This produces values like:

'SAMSUNG Electronics Li-ion 5520000'
'ASUS X101 Li-ion 2600000'

TEST=Run gft_hwcomp.py and observe value for part_id_battery.
BUG=chrome-os-partner:6225

Change-Id: Ie8ceda73cf42bb8ef904590a8a3258b9a065ba3e
Reviewed-on: http://gerrit.chromium.org/gerrit/8781
Reviewed-by: Jay Kim <yongjaek@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Dave Parker <dparker@chromium.org>
Tested-by: Dave Parker <dparker@chromium.org>
2 years agogooftool: add version info in reports
Hung-Te Lin [Fri, 23 Sep 2011 02:59:07 +0000 (10:59 +0800)]
gooftool: add version info in reports

A 'version' entry is now included in report data.

BUG=chrome-os-partner:6082
TEST=./gft_report.py --db_path "/usr/local/share/chromeos-hwid/components*"

Change-Id: I1c84eff13ab2b0cbf0af0e5a23107e1f46ebe532
Reviewed-on: http://gerrit.chromium.org/gerrit/8183
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Dave Parker <dparker@chromium.org>
2 years agogooftool: using sync in proper way
Hung-Te Lin [Fri, 23 Sep 2011 00:48:59 +0000 (08:48 +0800)]
gooftool: using sync in proper way

"sync; sync; sync" does not really work - sync only schedules a request and
need to wait for few seconds (may vary per systems, but 3 is a good number).

Since time is critical for factory setup, we only this this for in
prepaare_wipe.

BUG=chrome-os-partner:6010
TEST=./gft_prepare_wipe /dev/sda5

Change-Id: Id03bfe2df6af58f83e3a4217efae66cb8790b90e
Reviewed-on: http://gerrit.chromium.org/gerrit/8178
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Micah Catlin <micahc@chromium.org>
2 years agogooftool: force syncing disk after wipe preparation
Hung-Te Lin [Wed, 21 Sep 2011 01:16:13 +0000 (09:16 +0800)]
gooftool: force syncing disk after wipe preparation

We should sync disk earlier whenever finalization or wipe preparation has made
changes.

BUG=chrome-os-partner:6010
TEST=./gft_prepare_wipe /dev/sda5

Change-Id: I75b10e41e6c9cbca96fe1f92501a10b3f8548dff
Reviewed-on: http://gerrit.chromium.org/gerrit/8021
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
2 years agoVerify system time. factory-1020.B release-1011.B
Chinyue Chen [Wed, 7 Sep 2011 09:25:24 +0000 (17:25 +0800)]
Verify system time.

Verify that system time is later than release filesystem creation time.

BUG=chrome-os-partner:1784
TEST=make_factory_package.sh to USB, boot from USB, and then run to
     finalize step.

Change-Id: Ic90d69b4fde412b8e82a8283f0e69769f993a37a
Reviewed-on: http://gerrit.chromium.org/gerrit/7324
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Chinyue Chen <chinyue@chromium.org>
2 years agogooftool: add --clear_gbb_flags command test-982.B
Hung-Te Lin [Fri, 26 Aug 2011 11:20:14 +0000 (19:20 +0800)]
gooftool: add --clear_gbb_flags command

Shipping devices should have all flags in GBB header cleared.

The clear_gbb_flags needs to read GBB section from flashrom, causing 2 seconds
of execution time in each --finalize or --clear_gbb_flags call (and more if we
need to update GBB header).

Although the hash check in verify_hwid should ensure GBB data is properly
written, since this is a high risk security item, we currently enforce always
testing GBB hedader in each --finalize call. This may be improved in future.

BUG=chrome-os-partner:2317
TEST=# setup a BIOS with non-zero flags
     flashrom -r bios.bin
     gbb_utility -s --flags=3 bios.bin
     flashrom -i GBB -w bios.bin
     # check bios flags
     flashrom -r bios.bin
     gbb_utility --flags bios.bin # see 3
     # execute gooftool
     gooftool --clear_gbb_flags
     # check bios flags
     flashrom -r bios.bin
     gbb_utility --flags bios.bin # see 0

Change-Id: I3bdaa2ba52ed7dbc7cd21e6f5a34732740bec782
Reviewed-on: http://gerrit.chromium.org/gerrit/6730
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
2 years agofactory_test_tools: fix gft_fwhash.py GBB hash generation
Hung-Te Lin [Tue, 16 Aug 2011 07:01:46 +0000 (15:01 +0800)]
factory_test_tools: fix gft_fwhash.py GBB hash generation

The GBB hash should be generated from modified image, just like main hash.

BUG=none, found on release event
TEST=./gft_fwhash.py --type=gbb --image=bios.bin --gbb=hwid_file
     # update hash to component list file
     ./gooftool --verify_hwid # pass

Change-Id: Id63e9ad41a1f07deb5d8a80ee4cb1a8742f49f9f
Reviewed-on: http://gerrit.chromium.org/gerrit/6059
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
2 years agogooftool: fix chrontel detection code
Hung-Te Lin [Sat, 13 Aug 2011 13:33:49 +0000 (21:33 +0800)]
gooftool: fix chrontel detection code

The i2c device of chrontel was moved by kernel change. To make it robust, we
should follow the same procedure that /etc/init/chrontel.conf uses to probe the
device.

BUG=chrome-os-partner:5402
TEST=./gft_hwcomp.py # success on ZGB, seeing ch7036

Change-Id: Ic767bafb36a70bab3d04c0db17f1faeb702c019f
Reviewed-on: http://gerrit.chromium.org/gerrit/5956
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agogooftool: support 'config_factory_initial' and --ignore_factory_initial
Hung-Te Lin [Fri, 12 Aug 2011 12:23:05 +0000 (20:23 +0800)]
gooftool: support 'config_factory_initial' and --ignore_factory_initial

We need a new parameter to control non-hardware components (which is update-able
but still needs to be checked for each factory production).

BUG=chromium-os:18851
TEST=(set config_factory_initial=['version_cellular_firmware'])
     ./gooftool --probe # seeing version_cellular_firmware ignored in /var/factory.log
     ./gooftool --verify_hwid # not being ignored
     ./gooftool --verify_hwid --ignore_factory_initial # being ignored

Change-Id: I21cc2b7968c686b6fd7069cc63c9544cb44924f5
Reviewed-on: http://gerrit.chromium.org/gerrit/5879
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
2 years agoCheck serial_number is present in VPD
Nick Sanders [Tue, 9 Aug 2011 05:25:11 +0000 (22:25 -0700)]
Check serial_number is present in VPD

BUG=chromium-os:17608
TEST=./gooftool --verify_vpd w, w/o serial_number

Change-Id: I28926cb20ce775832e9d831e00dc320c3fa210b7
Reviewed-on: http://gerrit.chromium.org/gerrit/5534
Tested-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2 years agoDo not run lspci on arm devices when probing hardware components. firmware-881-u-boot-v1 firmware-u-boot-v1
Dave Parker [Thu, 11 Aug 2011 01:48:49 +0000 (18:48 -0700)]
Do not run lspci on arm devices when probing hardware components.

BUG=None
TEST=Run on arm device that includes a USB VID:PID in an expected value.

Change-Id: Ie636e7b69ec338fcd7d01e0db5a74cd8258516ab
Reviewed-on: http://gerrit.chromium.org/gerrit/5705
Tested-by: Dave Parker <dparker@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2 years agogooftool: add data_release_board as the board name of shipping image
Hung-Te Lin [Wed, 10 Aug 2011 11:45:48 +0000 (19:45 +0800)]
gooftool: add data_release_board as the board name of shipping image

"release board" is something we may want to check in HWID validation process.

BUG=chrome-os-partner:5325,chrome-os-partner:5206
TEST=./gft_hwcompo.py # seeing x86-zgb-signed-mp-v2keys

Change-Id: Iaba6a0ddee42c602ab055f7e8e237ecd65c26157
Reviewed-on: http://gerrit.chromium.org/gerrit/5646
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Jay Kim <yongjaek@chromium.org>
2 years agogooftool: force mounting partitions with ext2+ro to prevent accidentally writes
Hung-Te Lin [Mon, 8 Aug 2011 03:27:08 +0000 (11:27 +0800)]
gooftool: force mounting partitions with ext2+ro to prevent accidentally writes

It is safer to always mount file system with known stable driver (ext2).
This prevents modern (or experimental) fs like ext3/ext4 to write data even in
RO mode.

BUG=chrome-os-partner:3940
TEST=./gft_verify_rootfs.sh /dev/sda5 # for 500 times, not seeing issue

Change-Id: I961efd02949583204b9313e375005f2bae5ba9a8
Reviewed-on: http://gerrit.chromium.org/gerrit/5453
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agogooftool: Use "modem status" to improve report and probing
Hung-Te Lin [Mon, 8 Aug 2011 12:05:06 +0000 (20:05 +0800)]
gooftool: Use "modem status" to improve report and probing

Modem status is one of the important feature that we want to trace in factory
log, especially MEID or Carrier.

This CL adds "modem status" into report and as a fallback for cellular component
info probing.

BUG=chrome-os-partner:4939
TEST=./gooftool --create_report  # seeing modem_status entry
     ./gft_hwcomp.py  # seeing version_cellular_firmware: ['0x0y000z'],

Change-Id: Ic92354a48ae25e8da90c862505593fbb3d13635a
Reviewed-on: http://gerrit.chromium.org/gerrit/5459
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agogft_hwcomp: provide chipset name for SOC systems
Hung-Te Lin [Sat, 6 Aug 2011 03:09:40 +0000 (11:09 +0800)]
gft_hwcomp: provide chipset name for SOC systems

Chipset on SOC system should be the SOC itself, which cannot be probed.
For systems using device-tree (fdt), the top level compatible file provides a
descriptive name for the SOC system.

BUG=chrome-os-partner:4939
TEST=not verified yet (will test before push)

Change-Id: I4f8902fb35c6d7a731acf4169e43b43103a5fbe8
Reviewed-on: http://gerrit.chromium.org/gerrit/5439
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agogft_hwcomp: refine property names
Hung-Te Lin [Fri, 5 Aug 2011 13:57:32 +0000 (21:57 +0800)]
gft_hwcomp: refine property names

- '3g' is not appropriate; it should be "cellular".
- 'webcam' should be replaced by 'camera'.
- 'chrontel' should be 'display_converter'.
- 'vendor_id_touchpad' is now removed (already have part_id_touchpad)

The HWID component list will be also updated to match the new property names

BUG=none,clean up
TEST=./gft_hwcomp.py # seeing every property appears correctly

Change-Id: Iee9f8d1f540585516a5ec40ec6a663cd091557b1
Reviewed-on: http://gerrit.chromium.org/gerrit/5388
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agogft_hwcomp: improve camera detection by using v4l2 interface
Hung-Te Lin [Fri, 5 Aug 2011 13:43:37 +0000 (21:43 +0800)]
gft_hwcomp: improve camera detection by using v4l2 interface

The video4linux has a better identifier code and we should provide that in
hardware components.

BUG=chrome-os-partner:4939
TEST=./gft_hwcomp.py, check part_id_camera
     # on ZGB: '04XX:b1XX VENDOR PRODUCT WEBCAM 5575'
     # on ARM: 'tegra-camera mxxxxxx V4L2:yyyy 0002'

Change-Id: I29d568fba2beca2d570438e430acccf2380389bf
Reviewed-on: http://gerrit.chromium.org/gerrit/5387
Reviewed-by: Rong Chang <rongchang@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agogft_hwcomp: support finding ARM memory size by kernel command line
Hung-Te Lin [Fri, 5 Aug 2011 08:03:51 +0000 (16:03 +0800)]
gft_hwcomp: support finding ARM memory size by kernel command line

Memory on ARM cannot be probed and kernel only trusts the assigned parameters.
We should do the same thing in userland.

BUG=chrome-os-partner:4939
TEST=./gft_hwcomp.py # on tegra2 platform
    # see: id_dram = 1024 (as expected)

Change-Id: Ib1d9e5e48d6fc986b0239558b4dae97025b8933b
Reviewed-on: http://gerrit.chromium.org/gerrit/5372
Reviewed-by: Rong Chang <rongchang@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agogft_hwcomp: separate vendor_id_touchpad into id and firmware
Hung-Te Lin [Thu, 4 Aug 2011 04:32:03 +0000 (12:32 +0800)]
gft_hwcomp: separate vendor_id_touchpad into id and firmware

To support better management in the future, the "touchpad firmware version"
is now a isolated property.

For devices that will always update touchpad firmware, please write this in
HWID component list:
 'vendor_id_touchpad': '*',
 'version_touchpad_firmware': '*',
 'part_id_touchpad': 'YOUR_TOUCHPAD_HARDWARE_REV_HERE',

For devices that never updates touchpad firmware, write the explicit version to
check.  ( vendor_id_touchpad is still temporary available for backward
compatible, but writing the new properties is recommended):
 'vendor_id_touchpad': '*',
 'version_touchpad_firmware': 'YOUR_TOUCHPAD_FIRMWARE_REV',
 'part_id_touchpad': 'YOUR_TOUCHPAD_HARDWARE_REV_HERE',

BUG=chrome-os-partner:5298
TEST=(zgb) ./gft_hwcomp.py # seeing following output:
     'part_id_touchpad': ['Synaptics TouchPad V8.0'],
     'vendor_id_touchpad': ['Synaptics TouchPad V8.0 #869489'],
     'version_touchpad_firmware': ['869489']}
     (arm) ./gft_hwcomp.py # seeing following output:
    'vendor_id_touchpad': ['CCCCC-00Y00Y-00 1.0 #1.0'],
    'part_id_touchpad': ['CCCCC-00Y00Y-00 1.0'],
    'version_touchpad_firmware': ['1.0'],

Change-Id: I24b1244f9bd53d72e30ae78a62bb7e1ebca87486
Reviewed-on: http://gerrit.chromium.org/gerrit/5294
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agogft_hwcomp: improve probing for ARM platform
Hung-Te Lin [Wed, 3 Aug 2011 12:37:16 +0000 (20:37 +0800)]
gft_hwcomp: improve probing for ARM platform

Improve audio codec, webcam, display panel, and touchpad probing.
Fix version_rw_firmware on two-stop firmware.

BUG=chrome-os-partner:4939,chrome-os-partner:5034
TEST=./gft_hwcomp.py # on ZGB, nothing get broken
     ./gft_hwcomp.py # on ARM, get following new items:
     'part_id_audio_codec': ['WXXXXX'],
     'part_id_webcam': ['tegra-camera mXXXXX'],
     'vendor_id_touchpad': ['XXXXX-YYYYYY-ZZ 1.0'],
     'version_rw_firmware': ['1'],
     'part_id_display_panel': ['AAA:1111'],

Change-Id: I97b45e3c49e7d95d6f4bafec5e5c5f1cf8bf74fe
Reviewed-on: http://gerrit.chromium.org/gerrit/5212
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
2 years agogooftool: improve match results failure
Hung-Te Lin [Thu, 14 Jul 2011 07:18:43 +0000 (15:18 +0800)]
gooftool: improve match results failure

In future matching HWID would get more chance to fail, especially for RMA
process. This CL improves the output of gooftool --verify_hwid so RMA program
can capture the output to understand what failed HWID matching.

BUG=chrome-os-partner:4108
TEST=./gooftool --verify_hwid --db_path PATH_TO_COMPONENTS

Change-Id: I03e44b80e38baaf7792dfe295cfba67636622049
Reviewed-on: http://gerrit.chromium.org/gerrit/4994
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
2 years agogooftool: add bcdDevice and storage size into component list 0.14.811.B 780.B
Hung-Te Lin [Thu, 14 Jul 2011 08:00:41 +0000 (16:00 +0800)]
gooftool: add bcdDevice and storage size into component list

The bcdDevice for USB is very helpful to diagnose hardware (firmware) revision.
We also need the more accurate storage info (size of block numbers).

BUG=chrome-os-partner:4804,chrome-os-partner:1075
TEST=./gft_hwcomp.py # on ZGB
     # seeing: part_id_storage changed from 'ATA SanDisk SSD P4 1' to
     #         'ATA SanDiskSSD P4 1 #31277232'.
     # seeing: part_id_webcam has new version info (ex, 5575) at end.

Change-Id: I0f5444ccbdd8e6371444d5007acfaacbb4959862
Reviewed-on: http://gerrit.chromium.org/gerrit/4085
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agofactory_test_tools: fix vblock test code
Hung-Te Lin [Wed, 13 Jul 2011 01:35:06 +0000 (09:35 +0800)]
factory_test_tools: fix vblock test code

The example test code is currently simply for reference and not used by anyone.
However, to prevent confusion, here's the fix.

BUG=none
TEST=dump_fmap -x bios.bin
     python vblock.py VBLOCK_A
     # seeing correct info dumps

Change-Id: I87b91e266015f957ac7f79cc5a43a7b43257cacd
Reviewed-on: http://gerrit.chromium.org/gerrit/3995
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agofactory_test_tools: fix component list relative path
Hung-Te Lin [Wed, 29 Jun 2011 11:44:47 +0000 (19:44 +0800)]
factory_test_tools: fix component list relative path

The component list files now use its base folder for making relative path,
instead of the parent folder.

BUG=chrome-os-partner:4276
TEST=./gooftool --verify_hwid --verbose # pass

Change-Id: I06037980bff18e8f984236783afa604ac2a4ebd2
Reviewed-on: http://gerrit.chromium.org/gerrit/3374
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agofactory_test_tools: support new chromeos-hwid default location (/usr/*/share/chromeos...
Hung-Te Lin [Sun, 19 Jun 2011 02:55:22 +0000 (10:55 +0800)]
factory_test_tools: support new chromeos-hwid default location (/usr/*/share/chromeos-hwid)

gooftool now has internal logic to detect HWID components database location.
 (1) if --db_path is assigned, use only the specified path.
 (2) for other cases, try following folders in order:
     /usr/local/share/chromeos-hwid (installed by make_factory_package --hwid)
     /usr/share/chromeos-hwid (default package by build system)

BUG=chrome-os-partner:4276
TEST=./gooftool --probe --verbose # loaded from /usr/share/chromeos-hwid

Change-Id: I6aa5a39cc2aedd33aff72de9b633724cdb4d3a45
Reviewed-on: http://gerrit.chromium.org/gerrit/2866
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agofactory_test_tools: fix recoverykey / gbb retrieval error
Hung-Te Lin [Mon, 27 Jun 2011 11:46:44 +0000 (19:46 +0800)]
factory_test_tools: fix recoverykey / gbb retrieval error

Fix the function prototype error in hash_gbb and hash_key_recovery

BUG=chrome-os-partner:4231
TEST=./gooftool --probe # seeing value in hash_gbb/hash_key_recovery

Change-Id: I44d0a8f4c48555c2618e7521de68a23616b556cf
Reviewed-on: http://gerrit.chromium.org/gerrit/3237
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agofactory_test_tools: add 'hash.db' for hash value virtualization
Hung-Te Lin [Mon, 27 Jun 2011 10:37:01 +0000 (18:37 +0800)]
factory_test_tools: add 'hash.db' for hash value virtualization

'hash.db' is the file to contain hash values so that HWID component list
files are still human readable.

BUG=chromium-os:16989
TEST=1. write hash.db for { 'A'='B' }
     2. edit a component list for 'hash_root_key' = ['A']
     3. ./gft_hwcomp [component list], seeing the result for rootkey as 'B'.

Change-Id: I8259e0690a706459c5364a9d782031e53255ee1b
Reviewed-on: http://gerrit.chromium.org/gerrit/3236
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agofactory_test_tools: introducing new firmware hash algorithm
Hung-Te Lin [Sat, 18 Jun 2011 07:05:12 +0000 (15:05 +0800)]
factory_test_tools: introducing new firmware hash algorithm

To support using firmware more easily in HWID component list,
there are several improvements to "firmware hash":

 - Main(BIOS)/EC hash now use "alg#value" format in hash value
   for checking compatiblity in future
 - EC hash does not include RW part anymore, and enforce FMAP
 - Main hash does not have GBB by default - it's now in hash_gbb.
 - Add firmware hash for keys in GBB, to replace the file compare in component
   list because we can't change keys when updating GBB.
 - gft_fwhash.py --alg=1 generates legacy firmware hash.

BUG=chrome-os-partner:4231,chrome-os-partner:4276
TEST=./gft_fwhash.py --target=main --image SOME_BIOS.bin # see output like "mv2#12345..."
     ./gft_fwhash.py --target=main --image OTHER_BIOS.bin # see different output
     ./gft_fwhash.py --target=ec --image SOME_EC.bin # see output like "ev2#12345..."
     ./gft_fwhash.py --target=ec --image OTHER_EC.bin # see different output
     ./gft_fwhash.py --target=gbb_keys --image SOME_DEV_BIOS.bin
     # seeing Root Key: kv2#76583d...6bf933, Recovery Key: kv2#e0dfbe...6e6c66
     # to verify if these values are correct, run sha256 on devkeys:
     sha256sum /usr/share/vboot/devkeys/root_key.vbpubk # see 76583d...6bf933
     sha256sum /usr/share/vboot/devkeys/recovery_key.vbpubk # see e0dfbe...6e6c66

Change-Id: I0545d8b229e76ad8dd4a408ecd2e85c359f70821
Reviewed-on: http://gerrit.chromium.org/gerrit/2858
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agogooftool/write_gbb: never change keys in GBB
Hung-Te Lin [Fri, 3 Jun 2011 07:51:48 +0000 (15:51 +0800)]
gooftool/write_gbb: never change keys in GBB

Since the key is used to sign RW firmware, system won't boot (even in developer
mode) if we change the key in write_gbb stage.

To prevent that, we should never change keys in write_gbb / fwhash calculation.

BUG=none # minor issue discovered by partner's using command incorrectly
TEST=./gooftool --write_gbb=PATH_TO_COMPONENT
     # gbb bitmap and hardware ID is corretly written

Change-Id: Ifd1cbdf6e9a4b3d1d1504a7df2276c38ce60e7db
Reviewed-on: http://gerrit.chromium.org/gerrit/2030
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agofactory_test_tools: set firmware bitmap locale index according to bmpblk locale string 0.13.587.B
Hung-Te Lin [Tue, 24 May 2011 11:28:33 +0000 (19:28 +0800)]
factory_test_tools: set firmware bitmap locale index according to bmpblk locale string

This CL extracts firmare bitmap locale string, compare with VPD initial_locale,
and assign corresponding loc_idx if it's available.

BUG=chrome-os-partner:3868
TEST=1.crossystem loc_idx=0
     2. (set locale to nl) ./gooftool --verify_vpd
     3. crossystem loc_idx # seeing nl index
     4. (set locale to zh_TW, which is valid but not in bitmap)
        ./gooftool --verify_vpd
     4. crossystem loc_idx # seeing reset to 0

Change-Id: I80e995ddceb0f731557e8e080b362b6a3e85c26a
Reviewed-on: http://gerrit.chromium.org/gerrit/1453
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agofactory_test_tools: add VPD value checking test
Hung-Te Lin [Thu, 19 May 2011 11:06:00 +0000 (19:06 +0800)]
factory_test_tools: add VPD value checking test

gooftool now supports --verify_vpd to check if all required VPD data
are configured with valid values.

BUG=chrome-os-partner:3701
TEST=(set correct values) gooftool --verify_vpd; echo $? # see 0, correct
     vpd -i RO_VPD -s initial_locale="invalid"
     gooftool --verify_vpd; echo $? # seeing error messages for initial_locale

Change-Id: I9beb52868ae0149a26b869c13467890fdfe7146d
Reviewed-on: http://gerrit.chromium.org/gerrit/1451
Reviewed-by: Nikita Kostylev <nkostylev@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
2 years agofactory_test_tools: add display_geometry for ARM platforms 0.13.558.B
Hung-Te Lin [Tue, 10 May 2011 12:44:16 +0000 (20:44 +0800)]
factory_test_tools: add display_geometry for ARM platforms

There is no EDID driver on ARM, and usually the screen size is already hard
coded in ARM board configuartion; so in hardware component probing, we trust the
frame buffer geometry data.

BUG=chromium-os:15119
TEST=./gft_hwcomp.py; # seeing 1YYYxZZZ on some ARM platforms.

Change-Id: Ie7bbac2cfe02e146e9be1a03d2608a1b1e6a341d
Reviewed-on: http://gerrit.chromium.org/gerrit/595
Reviewed-by: Rong Chang <rongchang@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agofactory_test_tools: make sure partitions are in good priority before wipe
Hung-Te Lin [Sat, 7 May 2011 11:09:40 +0000 (19:09 +0800)]
factory_test_tools: make sure partitions are in good priority before wipe

cgpt has a "priority" command which should maintain priority in a more robust
way than our current script; gft_prepare_wipe.sh should use it.

BUG=none
TEST=./gft_prepare_wipe.sh /dev/sda5; cgpt show /dev/sda
     ./gft_prepare_wipe.sh /dev/sda3; cgpt show /dev/sda

Change-Id: Ia35168844c2353b0d87d6e9464bbd95c720dfe76
Reviewed-on: http://gerrit.chromium.org/gerrit/499
Reviewed-by: Yung-Chieh Lo <yjlou@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2 years agofactory_test_tools: code refine for command processing 70/170/2
Hung-Te Lin [Tue, 3 May 2011 12:28:46 +0000 (20:28 +0800)]
factory_test_tools: code refine for command processing

The factory test tools is composed by lots of commands (and some even with
dependencies).  Manually tracking the dependency, execution order, and usage
help is a painful process and easily making bugs.

This CL converts most commands into automatically populated and managed so that
usage help generation and execution order checking are no longer duplicated in
source.

BUG=chrome-os-partner:2460
TEST=./gooftool --verify # works fine
     ./gooftool --help # seeing proper usage help for --verify

Change-Id: Ib4eba08509be48a7bd58affb96dca08568591619

2 years agofactory_test_tools: improve prepare_wipe stage 69/169/2
Hung-Te Lin [Tue, 3 May 2011 09:50:10 +0000 (17:50 +0800)]
factory_test_tools: improve prepare_wipe stage

To support speedy switching boot record in finalization (wiping), this CL
simplified gft_prepare_wipe.sh to only change boot records when using H2C.

Rootfs image verification (using chromeos-postinst -> chromeos-setimage in
original gft_prepare_wipe.sh) is now in gft_verify_rootfs.sh.

BUG=chromium-os:14139
TEST=./gft_prepare_wipe.sh; reboot # boots with release image

Change-Id: I5de05080df848f984dc448667a61ff9c068d750b

2 years agofactory_test_tools: fix ARM partition naming 68/168/1
Hung-Te Lin [Tue, 3 May 2011 08:44:27 +0000 (16:44 +0800)]
factory_test_tools: fix ARM partition naming

device naming on ARM is using a different naming scheme.
To solve that, we need "partition number" supported in device name generation
function itself.

BUG=chromium-os:14616
TEST=./gooftool --verify_keys --verify_rootfs # success

Change-Id: Ie462ab9d25f7e97c4f9ae18d42b0becaeadae88b

2 years agofactory_test_tools: add rootfs hash verification script
Hung-Te Lin [Sat, 30 Apr 2011 05:42:41 +0000 (13:42 +0800)]
factory_test_tools: add rootfs hash verification script

In factory process, we need an isolated procedure to verify the disk hash
without invoking postinst (or chromeos-setimage).

gft_verify_rootfs.sh verifies if the rootfs hash recorded in kernel partition is
matching current rootfs partition.

BUG=chromium-os:14139
TEST=./gft_verify_rootfs.sh /dev/sda4 /dev/sda5; echo $? # success
     ./gft_verify_rootfs.sh /dev/sda2 /dev/sda5; echo $? # fail
     ./gooftool --verify_rootfs # success

Change-Id: Ic1ba4c24e5dd30a22c424e19e3904826683daf06

R=wad@chromium.org

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

2 years agofactory_test_tools: support ARM device for wiping preparation.
Hung-Te Lin [Fri, 29 Apr 2011 10:56:50 +0000 (18:56 +0800)]
factory_test_tools: support ARM device for wiping preparation.

x86 uses /dev/sda\d while ARM is /dev/mmcblk0p\d, so the old method of stripping
partition number does not work well.

This CL checks and allows only sda/mmcblk0 style device names for wiping.

BUG=chromium-os:14616
TEST=./gft_prepare_wipe.sh  # success

Change-Id: If295ea85c584a7297c2c6e5e0c1c13b20c5e22a0

R=waihong@chromium.org

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

2 years agofactory_test_tools: support hardware components probing for ARM platforms
Hung-Te Lin [Fri, 29 Apr 2011 06:05:56 +0000 (14:05 +0800)]
factory_test_tools: support hardware components probing for ARM platforms

The following components are now probable on ARM:
  firmware, usbhost, cpu, storage, usbhosts, vga, webcam, touchpad

NOTE: All display related components need edid and is not supported yet.
      DRAM size relies on mosys, which is also not supported yet.
      EC related properties will be always empty for ARM.

Sample output on ARM:
{'data_display_geometry': [''],
 'hash_ec_firmware': [''],
 'hash_ro_firmware': ['XXX'],
 'part_id_3g': ['0XXX:XXXX SOME VENDOR'],
 'part_id_audio_codec': [''],
 'part_id_bluetooth': [''],
 'part_id_chipset': [''],
 'part_id_chrontel': [''],
 'part_id_cpu': ['ARM XXX (#2)'],
 'part_id_display_panel': [''],
 'part_id_dram': [''],
 'part_id_ec_flash_chip': [''],
 'part_id_embedded_controller': [''],
 'part_id_ethernet': ['0XXX:XXXX SOME VENDOR'],
 'part_id_flash_chip': ['SOME PRODUCT'],
 'part_id_hwqual': ['ARM TEST HWID'],
 'part_id_keyboard': [''],
 'part_id_storage': ['MMC SOMENAME 0x0 0x0 0x0100 0x000045'],
 'part_id_tpm': ['49465800:1.2.19.18'],
 'part_id_usb_hosts': ['1XXX:0002 1XXX:0002 1XXX:0002'],
 'part_id_vga': ['xxxxx_fb'],
 'part_id_webcam': ['xxxxx-camera'],
 'part_id_wireless': ['0XXX:YYYY'],
 'vendor_id_touchpad': ['XXXXX_i2c_trackpad'],
 'version_3g_firmware': ['XXXXXX YYYYYYYY 0ZZZZZZZ'],
 'version_rw_firmware': ['1']}

BUG=chromium-os:14616
TEST=./gft_hwcomp.py  # success

Change-Id: I557ce0c753b23a28f567a3d3e0fd7ee66deedd76

R=waihong@chromium.org

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

2 years agofactory_test_tools: workaround Synaptics touchpad detection when X is active
Hung-Te Lin [Thu, 28 Apr 2011 03:41:40 +0000 (11:41 +0800)]
factory_test_tools: workaround Synaptics touchpad detection when X is active

Factory tests may often start with X in foreground but without DISPLAY
configured (ex, remote ssh into device). Touchpad detection used to fail in the
case.

This CL detects is X is capturing the touchpad, and try to workaround the issue
with warning message.

BUG=chrome-os-partner:3195
TEST=(make X in foreground, remote ssh into device) gft_hwcomp.py # see touchpad info and warning msg
     (switch to VT2, remote ssh into device) gft_hwcomp.py # see touchpad info

Change-Id: I45d915e19a8bf80fb0364c3640e2bd339eda9371

R=josephsin@chromium.org

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

2 years agofactory_test_tools: probe primary device name by platform arch
Hung-Te Lin [Thu, 28 Apr 2011 03:40:29 +0000 (11:40 +0800)]
factory_test_tools: probe primary device name by platform arch

The device names should be platform dependent, instead of hard-coding 'sda'.

BUG=chromium-os:13211
TEST=(on x86) ./gft_hwcomp.py # seeing valid storage
     ./gooftool --verify_keys # seeing /dev/sda4 checked

Change-Id: I61c85f046139f0290229d6b4be92fc9b50f31fe9

R=waihong@chromium.org

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

2 years agofactory_test_tools: reduce postinst running time (23->13 seconds)
Hung-Te Lin [Wed, 27 Apr 2011 08:09:13 +0000 (16:09 +0800)]
factory_test_tools: reduce postinst running time (23->13 seconds)

The "postinst" in wiping preparation should be a "install" mode instead of
"update" (default) mode.

BUG=chromium-os:14139
TEST=time ./gft_prepare_wipe.sh # 13 seconds
          reboot # success

Change-Id: I05b9c6fdccca42fa1e18d357e2e1daebe5e3536d

R=waihong@chromium.org

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

3 years agofactory_test_tools: provide more helpful debug messages 0.12.433.B 0.12.433.B109 0.12.433.B62
Hung-Te Lin [Tue, 19 Apr 2011 06:56:31 +0000 (14:56 +0800)]
factory_test_tools: provide more helpful debug messages

We often see key verification error in factory process,
but lack of detail information for what's heppening.

This CL attempts to add more messages when the verifiaction failed, especially
for dev-signed / recovery-signed issue.

BUG=chrome-os-partner:3374
TEST=./gft_verify_keys.sh /dev/sda2 bios.bin # seeing DEV-SIGNED IMAGE warning
     ./gft_verify_keys.sh /dev/sda4 devbios.bin # seeing DEV ROOTKEY warning
     ./gft_verify_keys.sh /dev/sda2 devbios.bin # seeing DEV-SINED, RECOVERY, DEV-ROOTKEY warnings

Change-Id: Ic7e09e15c4a0ad7a908e4d1c114990160e85704d

R=waihong@chromium.org

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

3 years agofactory_test_tools: fix results for HWQual tests
Hung-Te Lin [Tue, 19 Apr 2011 06:04:42 +0000 (14:04 +0800)]
factory_test_tools: fix results for HWQual tests

- HWQual needs to allow legacy search when there's still possible case of  ''
  (not present), which were not allowed by gft_hwcomp. This CL removes 'not
  present' before checking legacy search

- HWQual needs to also get better error output messages, especially when above
  change is applied.

BUG=chrome-os-partner:3195
TEST=/gft_hwcomp.py approved_components
    # on system with / without approved 3G, seeing success
    # on incompatible system, seeing  message like:
    {'part_id_cardreader': ['Actual: Not Present', 'Expected: XXXX:0138'],
     'part_id_ethernet': ['Actual: 0b95:7720 ASIX Elec. Corp. AX88x72A',
                           'Expected: XXXX:1063 | Not Present']}

Change-Id: Ie20111d33a4ca8e1d7743ea5bbb98cb6a8b047d4

R=waihong@chromium.org

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

3 years agofactory_test_tool: detect touchpad in order.
Hung-Te Lin [Tue, 19 Apr 2011 04:01:17 +0000 (12:01 +0800)]
factory_test_tool: detect touchpad in order.

To support detecting touchpad in order, we have to know te exit value of
invocation to "syndetect" and other programs.

The utility system didn't allow receiving exit code and stdout at the same time,
so we need to refine whole base APIs to support returning all execution results.

BUG=chrome-os-partner:3195
TEST=./gft_hwcomp.py # seeing touchpad ID and firmware hashes
     ./gft_wpfw.py bios # seeing BIOS protected successfully

Change-Id: I3c296a1e3a58a1bfa4314efeafae06928e191a47

R=waihong@chromium.org

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

3 years agofactory_test_tools: use flimflam to get connection info directly.
Hung-Te Lin [Sat, 16 Apr 2011 01:38:11 +0000 (09:38 +0800)]
factory_test_tools: use flimflam to get connection info directly.

To  preven using "modem status" command, this CL tries to load flimflam
tests directly.

BUG=chromium-os:13967,chrome-os-partner:2952
TEST=./gft_hwcomp # seeing:
  'part_id_3g': ['0XXX:XXXX Some Manufaturuer Some Product'],
  'version_3g_firmware': ['Some Vendor 09010012'],

Change-Id: I648a1afcfe8a319f4bc3f5c981c12048d0648235

R=yongjaek@chromium.org,jglasgow@chromium.org

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

3 years agofactory_test_tools: improve gft_hwcomp (hardware_Components) performance
Hung-Te Lin [Wed, 13 Apr 2011 01:57:27 +0000 (09:57 +0800)]
factory_test_tools: improve gft_hwcomp (hardware_Components) performance

To improve HWID probing speed, we can fire multi-threads to collect information
asynchronously. This gives 5 seconds improvements on Z* platform.

BUG=chrome-os-partner:2505
TEST=time gft_hwcomp.py --sync # 18.483s
     time gft_hwcomp.py --async # 13.176s
     Gets 5.3 second improvements

Change-Id: I017e93002a56ebd4e04ea7edbfde57fdc2ef2245
R=waihong@chromium.org

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

3 years agofactory_test_tools: support legacy probing mode
Hung-Te Lin [Wed, 13 Apr 2011 01:52:10 +0000 (09:52 +0800)]
factory_test_tools: support legacy probing mode

The new heuristic probing for USB/PCI devices is good, but it is possible to
have some device that cannot be probed by the sysfs rules.

To solve this issue, a new "legacy mode" is introduced: if an approved
component list is simply full of traditional USB/PCI device info, we should
ignore our heuristic search results and simply compare if the one of the
component in list can be found on system.

ex: id_wireless: ['1a1b:2b3c' '0030:1234],
    and the system has 0030:1234 installed but not as 'wlan0'.

Before this fix, probing will result in id_wireless: [''] and give failure,
after this fix probing will give ['0030:1234'] and success.

BUG=chromium-os:13967
TEST=gft_hwcomp.py MODIFIED_COMPONENT # to have legacy fields only

Change-Id: Ib3fb8d5a01bfb24fd84c10d611d9ff6f8637ef23

R=waihong@chromium.org

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

3 years agofactory_test_tools: make component list file hierarchy
Hung-Te Lin [Tue, 12 Apr 2011 01:06:37 +0000 (09:06 +0800)]
factory_test_tools: make component list file hierarchy

Two special properties were added into component list file:

inherit: allow inheritance for components.

Macros: Only available to certain fields, to automatically generate values based
        on variables like hwid.
        The first supported fields are: '<BMP_V1>' for 'data_bitmap_fv'

SAMPLE:
 - file components_VENDOR_BOARD_DEVICE contains generic component list
 - file components_VENDOR_BOARD_DEVICE-UK_XXXX can be:
   {
     'inherit': 'components_VENDOR_BOARD_DEVICE',
     'data_bitmap_fv': ['<BMP_V1>'],
     'part_id_hwqual': ['VENDOR BOARD DEVICE-UK XXXX'],
     # any other different fields here
   }
 - file bmp_VENDOR_BOARD_DEVICE-UK_XXXX.bmp must exist.

BUG=chrome-os-partner:3237
TEST=gooftool --write_gbb=components_VENDOR_BOARD_DEVICE-UK_XXXX # GBB updated successfully
     gooftool --probe --db_path=...<PATH>../components_* # can probe the different models correctly

Change-Id: Id5f00a9e7f5a3862f213ecdb9d916723234cf793

R=waihong@chormium.org,yongjaek@chromium.org

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

3 years agofactory_test_tools: merge new properties from R11 factory hardware_Components 0.12.392.B
Hung-Te Lin [Mon, 11 Apr 2011 09:38:04 +0000 (17:38 +0800)]
factory_test_tools: merge new properties from R11 factory hardware_Components

Some properties were only in R11 factory branch (old hardware_Components),
and we need to merge into R12 gooftool.

BUG=chrome-os-partner:2952,chrome-os-partner:2591
TEST=./gft_hwcomp allstar # seeing VPD data
     # and captured 3G firmware version by emulating data from
     # http://www.chromium.org/chromium-os/how-tos-and-troubleshooting/get-a-3g-modem-running

Change-Id: Ida0d0df94a8427af48eca3d3234d399c5a2674e2

R=yjlou@chromium.org,yongjaek@chromium.org

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

3 years agofactor_test_tools: make PCI/USB component probing more robust
Hung-Te Lin [Mon, 11 Apr 2011 07:33:25 +0000 (15:33 +0800)]
factor_test_tools: make PCI/USB component probing more robust

We should never rely on "known device number matching" for PCI and USB devices.

BUG=chromium-os:13967
TEST=gft_hwcomp.py *DEV* # *DEV* contains all '*'
     # seeing PCI fields not '*'.

A sample output on Alex, with approved_componenets=all '*':
{'data_display_geometry': ['1280x800'],
 'hash_ec_firmware': ['6148...'],
 'hash_ro_firmware': ['6219...'],
 'key_recovery': ['*'],
 'key_root': ['*'],
 'part_id_3g': ['05c6:9244 Qualcomm Incorporated Qualcomm Gobi 2000'],
 'part_id_audio_codec': ['Realtek ALC272'],
 'part_id_bluetooth': ['0cf3:3002'],
 'part_id_cardreader': ['*'],
 'part_id_chipset': ['8086:a010'],
 'part_id_chrontel': ['*'],
 'part_id_cpu': ['Intel(R) Atom(TM) CPU N550   @ 1.50GHz'],
 'part_id_display_panel': ['SEC:4231'],
 'part_id_dram': ['2048'],
 'part_id_ec_flash_chip': ['Macronix MX25L1005'],
 'part_id_embedded_controller': ['SMSC FDC37M81x (id=0x4d, rev=0x01)'],
 'part_id_ethernet': ['0b95:7720 ASIX Elec. Corp. AX88x72A'],
 'part_id_flash_chip': ['Macronix MX25L3205'],
 'part_id_hwqual': ['SAMSUNG ALEX DEV 6916'],
 'part_id_storage': ['ATA SanDisk SSD P4 1'],
 'part_id_tpm': ['49465800:1.2.3.18'],
 'part_id_usb_hosts': ['8086:27cc 8086:27cb 8086:27ca 8086:27c9 8086:27c8'],
 'part_id_vga': ['8086:a011'],
 'part_id_webcam': ['2232:1013 Namuga WebCam SC-13HDO10B39N'],
 'part_id_wireless': ['168c:0030'],
 'vendor_id_touchpad': ['SynPS/2 Synaptics TouchPad'],
 'version_rw_firmware': ['1']}

Change-Id: I713fca8945938c24ecfb5000fd32ef5603008409

R=waihong@chromium.org

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

3 years agofactory_test_tools: improve gft_hwcomp (hardware_Components) performance
Hung-Te Lin [Mon, 11 Apr 2011 06:42:57 +0000 (14:42 +0800)]
factory_test_tools: improve gft_hwcomp (hardware_Components) performance

To improve HWID matching speed, we should cache as much data as possible.

BUG=chrome-os-partner:2505
TEST=time gft_hwcomp.py component_SOMEHWID # single HWID
     real 0m20.422s, user 0m11.234s
     # prepare 20 HWIDs:
     time gft_hwcomp.py components*
     (before) real 0m23.203s, user 0m13.082s
     (after) real 0m20.784s, user 0m11.751s

Change-Id: I29c6f090e4e0523e11899737eaa27e084d5b91cc

R=waihong@chromium.org

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

3 years agogooftool: add --wipe_method to support secure/fast wiping methods
Hung-Te Lin [Thu, 7 Apr 2011 11:49:26 +0000 (19:49 +0800)]
gooftool: add --wipe_method to support secure/fast wiping methods

'Fast' or 'Secure wiping methods should be accessible by gooftool.

BUG=chrome-os-partner:2594
TEST=gooftool --wipe_method fast --prepare_wipe # seeing "fast" in wipe param
     gooftool --prepare_wipe # seeing "" in wipe param, as 'secure'
     gooftool --wipe_method blah --prepare_wipe # seeing failure

Change-Id: I5318804253dbb0549d9acabc9444c214266622bd

R=waihong@chromium.org

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