Commit Graph

30411 Commits

Author SHA1 Message Date
David Zeuthen 2ce63edab7 Update for new Android Verified Boot (AVB).
This updates the build system for the new Android Verified Boot
codebase. As this is based on Brillo Verified Boot, this change replaces
the existing BVB support.

Android Verified Boot is enabled by the BOARD_AVB_ENABLE variable

 BOARD_AVB_ENABLE := true

This will make the build system create vbmeta.img which will contain a
hash descriptor for boot.img, a hashtree descriptor for system.img, a
kernel-cmdline descriptor for setting up dm-verity for system.img and
append a hash-tree to system.img.

Additionally, the descriptors are left in boot.img and system.img so a
third party can create their own vbmeta.img file linking - using the
option --chain_partition - to these images. If this is not needed
footers can be erased using the 'avbtool erase_footer' command. It's
also harmless to just leave them in the images.

By default, the algorithm SHA256_RSA4096 is used with a test key from
the AVB source directory. This can be overriden by the
BOARD_AVB_ALGORITHM and BOARD_AVB_KEY_PATH variables to use e.g. a
4096-bit RSA key and SHA-512:

 BOARD_AVB_ALGORITHM := SHA512_RSA4096
 BOARD_AVB_KEY_PATH := /path/to/rsa_key_4096bits.pem

To prevent rollback attacks, the rollback index should be increased on a
regular basis. The rollback index can be set with the
BOARD_AVB_ROLLBACK_INDEX variable:

 BOARD_AVB_ROLLBACK_INDEX := 5

If this is not set, the rollback index defaults to 0.

The variable BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS can be used to specify
additional options passed to 'avbtool make_vbmeta_image'. Typical
options to be used here include '--prop', '--prop_from_file', and
'--chain_partition'.

The variable BOARD_AVBTOOL_BOOT_ADD_HASH_FOOTER_ARGS can be used to
specify additional options passed to 'avbtool add_hash_footer' for
boot.img. Typical options to be used here include '--hash_algorithm' and
'--salt'.

The variable BOARD_AVBTOOL_SYSTEM_ADD_HASHTREE_FOOTER_ARGS can be used
to specify additional options passed to 'avbtool add_hashtree_footer'
for systems.img. Typical options to be used here include
'--hash_algorithm', '--salt', and '--block_size'.

BUG=31264226
TEST=Manually tested on edison-eng by inspecting {boot, system,
  vbmeta}.img in out/ directory as well as their counterparts in
  the IMAGES/ directory of edision-target_files-eng.zeuthen.zip

Merged-In: Ic9a61cfc65c148b12996e57f04da5432eef6b982

Change-Id: I97042655bca15e7eac899f12c5bada2f6184d307
2016-09-29 11:19:36 -04:00
Meike Baumgärtner ce4e16d835 Merge "Only run warn.py's main function if it is the main program."
am: 312c310f7c

Change-Id: I4b2c7dce195e62172a81154e261ced167d997ab5
2016-09-29 04:06:29 +00:00
Treehugger Robot 312c310f7c Merge "Only run warn.py's main function if it is the main program." 2016-09-29 03:58:07 +00:00
Stephen Hines 523543b17c Merge "Switch to using clang-3289846."
am: 7ec2a39c3f

Change-Id: I67851b34b3c901d8bab93c9ba6f5456eca2aba91
2016-09-29 03:03:56 +00:00
Stephen Hines 7ec2a39c3f Merge "Switch to using clang-3289846." 2016-09-29 02:56:50 +00:00
Meike Baumgärtner ac9d5df349 Only run warn.py's main function if it is the main program.
Test: run warn.py --byproject build.log
Change-Id: I155cce8c952d6d8a02c8e1809bf61a46c847c26e
2016-09-28 17:59:08 -07:00
Chih-Hung Hsieh ac2df1c205 Merge "Fix pylint warning and refactor project_list."
am: 6784a3fcdd

Change-Id: I6ddc536af0c9ebf735ed14032d98880ed4f2175b
2016-09-28 17:54:47 +00:00
Treehugger Robot 6784a3fcdd Merge "Fix pylint warning and refactor project_list." 2016-09-28 17:47:41 +00:00
Tao Bao 0493339a1f Merge "Analyze unchanged blocks in odex files."
am: 6e12b72966

Change-Id: Ic99c7293f6887ee8a4e3ad4e66ca9140e7dbeba9
2016-09-28 17:13:14 +00:00
Tao Bao 6e12b72966 Merge "Analyze unchanged blocks in odex files." 2016-09-28 17:08:10 +00:00
Stephen Hines 183b142ac9 Switch to using clang-3289846.
Bug: http://b/30252254
Test: Built/boot platform using latest prebuilts.
Change-Id: I7c9357a99afec323fd766e93b5d5e941e9e06244
2016-09-28 08:51:55 -07:00
Chih-hung Hsieh 2d06a27ae6 Merge "Fix Google pylint warnings."
am: aa5f2ccde2

Change-Id: Ide1a5bffa1745737142ffde982268addd8c253bb
2016-09-28 04:17:25 +00:00
Chih-Hung Hsieh 9f766239f0 Fix pylint warning and refactor project_list.
Bug: 31377083
Test: run warn.py --byproject build.log
Change-Id: Id442cf6608bf5c14784063c05f5ff0b731f17486
2016-09-27 21:13:52 -07:00
Chih-hung Hsieh aa5f2ccde2 Merge "Fix Google pylint warnings." 2016-09-28 04:10:26 +00:00
Dan Willemsen d640e062e8 Merge "Remove WITH_SYNTAX_CHECK"
am: c114bd9dbf

Change-Id: I9e6c2a9c6aa48e27efe9b32d496ca21f47d4a447
2016-09-28 01:52:16 +00:00
Treehugger Robot c114bd9dbf Merge "Remove WITH_SYNTAX_CHECK" 2016-09-28 01:44:24 +00:00
Chih-Hung Hsieh b426c54e8a Fix Google pylint warnings.
* Rename 'severity' to 'Severity'.
* Fix bad line indentations and space.

Test: run warn.py --byproject build.log
Change-Id: I33d701cca408b5ca4715be8d44c890942b7d132a
2016-09-27 18:15:40 -07:00
Chih-Hung Hsieh 9dee2ac43c Merge "Add buttons to group warning by project or severity."
am: 9796175d0f

Change-Id: I4d016ce0450870351a0454314f43d0cf75487993
2016-09-27 21:20:12 +00:00
Treehugger Robot 9796175d0f Merge "Add buttons to group warning by project or severity." 2016-09-27 21:10:40 +00:00
Evgenii Stepanov 04b11c5acd Merge "Enable LOCAL_SANITIZE:=cfi and add LOCAL_SANITIZE_DIAG."
am: 2358c55d70

Change-Id: Ib36748ff1fe5f8bad82b37d27f9d1a94d5a8e0ee
2016-09-27 20:58:56 +00:00
Evgenii Stepanov 2358c55d70 Merge "Enable LOCAL_SANITIZE:=cfi and add LOCAL_SANITIZE_DIAG." 2016-09-27 20:51:41 +00:00
Dan Willemsen 785d69a849 Merge "Remove spaces from DEFAULT_TIDY_HEADER_DIRS"
am: f69e48b30b

Change-Id: I63e8c0dc06332c620b16fdb27b396b39ad2d44cf
2016-09-27 01:22:11 +00:00
Treehugger Robot f69e48b30b Merge "Remove spaces from DEFAULT_TIDY_HEADER_DIRS" 2016-09-27 01:10:30 +00:00
Dan Willemsen e68100e8bb Remove WITH_SYNTAX_CHECK
It's no longer used. The majority of the platform is on clang anyways.

Test: m -j
Change-Id: I4fb4375eaad2469e169d34c47ae3fe2a0540aeec
2016-09-26 17:37:19 -07:00
Iliyan Malchev 3f044f007f Merge "build: add hwservicemanager to the core packages"
am: 69bd0bf22a

Change-Id: Icd688e7e59c95ae91787c9f35e5c3d814062b1ce
2016-09-27 00:08:15 +00:00
Treehugger Robot 69bd0bf22a Merge "build: add hwservicemanager to the core packages" 2016-09-26 23:54:54 +00:00
Dan Willemsen 69811f89d6 Remove spaces from DEFAULT_TIDY_HEADER_DIRS
I'm preparing to move this to Soong, and it's simpler to compare if the
spaces are removed here (to match the other lists in this file).

Test: WITH_TIDY=true; compare build.ninja before and after change
Change-Id: Ib27a19a36ebb1132300a8c1eeace1202685dfc4c
2016-09-26 16:02:15 -07:00
Chih-Hung Hsieh 2a38c37d57 Add buttons to group warning by project or severity.
* Add more project patterns.
* Add more top level comments for global variables and functions.
* Resequence severity numbers to match the dump order.
* Emit warning messages and tables to static HTML JavaScript arrays.
* Replace old static HTML table dumper functions with
  new dynamic HTML JavaScript to generate sections of warnings.
* Warning messages are grouped into sections by severity or projects.
* Better descriptions for SKIP warning patterns.
* Replace output function with print.

Bug: 31377083
Test: run warn.py --byproject build.log
Change-Id: I7b44ef6223d5b2f1aa31655a5a47d854f9a1dedc
2016-09-26 16:02:12 -07:00
Chih-Hung Hsieh 64af14a4d2 Merge "Fix Google pylint warnings."
am: bcd229277a

Change-Id: Ia7948dfee4dbb48957c4e0ab4b5517e4d9cff71e
2016-09-26 21:22:56 +00:00
Iliyan Malchev bd710ed45a build: add hwservicemanager to the core packages
b/31458381
b/31240290

Test: passing build and runtime tests

Change-Id: I294c70d93d23ada94ff1175f2d3babd5b836eeee
Signed-off-by: Iliyan Malchev <malchev@google.com>
2016-09-26 14:21:10 -07:00
Treehugger Robot bcd229277a Merge "Fix Google pylint warnings." 2016-09-26 21:18:08 +00:00
Chih-Hung Hsieh 6c0fdbb84d Fix Google pylint warnings.
* Rename variables and functions to follow Google coding style.
* Fix line indentations to follow Google coding style.
* Add module and function docstrings.
* Change shebang line to avoid pylint warning.
* Suppress some pylint warnings to avoid too many changes at once.
* Fix typos.

Test: run warn.py --byproject build.log
Change-Id: I569961981b562e35cb5609a96cd5ebb40a80829c
2016-09-26 12:24:54 -07:00
Alex Deymo a1c977735b fat16copy: Fix allocation logic when extending directories.
When extending a directory, empty directory entries were left behind
signaling the end of a directory.

Bug: 31570546
Test: make dist; mdir shows all the files.

(cherry picked from commit d4516300b010c8155861e310dac871e8c10d3382)

Change-Id: Ie3d82cfaad51be73911293a54d18746e8adf62a2
2016-09-23 14:21:43 -07:00
Alex Deymo 567c5d0f95 fat16copy: Sort new directory entries.
Sort the entries returned by os.listdir to give a consistent ordering
across build.

Bug: None
Test: `make dist`

(cherry picked from commit ef34e5dca216e61fd81020e818f247f6ce47d26e)

Change-Id: I2f80889684f108208f07e13d725acaa7bc0ab099
2016-09-23 14:21:38 -07:00
Casey Dahlin df71efe378 Make fat16copy.py add . and .. entries to directories
Test: fsck no longer complains
Bug: None

(cherry picked from commit 7d38ec37432c307d729b9a8fdb78dbf820427538)

Change-Id: I587f400df2f57b987df8b92d551c99f2f42a9af6
2016-09-23 14:21:31 -07:00
Tao Bao 08c8583aea Analyze unchanged blocks in odex files.
In BBOTA, we generate patches based on _all_ the blocks of a pair of
input files (src and tgt). For security incremental OTAs, one common
pattern is that only a few blocks are changed in odex files (e.g.
headers). We don't really need to stash/patch the unchanged blocks.

This CL analyzes the unchanged blocks in odex files and computes the
diff for the changed blocks only. It reduces the OTA install time by
about 25% to 40% in our experiments, by paying an increase of 5% to 30%
OTA generation time cost.

Bug: 31570716
Test: Generate an incremental and apply on device.

Change-Id: If842c1afeff6894a3d27eb60b7e8f65a179b7977
2016-09-23 12:15:23 -07:00
Chih-Hung Hsieh d95f164112 Merge "Recognize new warning messages."
am: b0553ca65b

Change-Id: Ic2f262f62121e19e1daba9a0a3c95fd6ebcc2b1a
2016-09-23 04:37:12 +00:00
Dan Willemsen 6d720a64c7 Merge "link_type check: Support modules installed into /data"
am: 8870658397

Change-Id: I73b1dcc5296c2ed3b3dec9d5be0adb3645fd5ded
2016-09-23 04:35:14 +00:00
Dan Willemsen 16448d0b27 link_type check: Support modules installed into /data
am: 3594cee467

Change-Id: I3735c05d317aa5c125471c7e91124cd45ebe4a98
2016-09-23 04:35:13 +00:00
Treehugger Robot b0553ca65b Merge "Recognize new warning messages." 2016-09-23 04:33:11 +00:00
Treehugger Robot 8870658397 Merge "link_type check: Support modules installed into /data" 2016-09-23 04:30:02 +00:00
Chih-Hung Hsieh 0a19207f7b Recognize new warning messages.
* -Wunnamed-type-template-args and -W#pragma-messages

Test: run warn.py with build.log.
Change-Id: I36277e001081604f92a4d9c92f9a0b5d3f0ee5e5
2016-09-22 17:44:38 -07:00
Dan Willemsen 7ebc69e881 Merge "Pass userdebug/eng variant to Soong"
am: 19f24492db

Change-Id: Ic13d60a9bf2c036f3d1babcecda6c5b50c5e9a69
2016-09-23 00:21:40 +00:00
Treehugger Robot 19f24492db Merge "Pass userdebug/eng variant to Soong" 2016-09-23 00:16:52 +00:00
Chih-Hung Hsieh d7f5496a7c Merge "Simplify warn.py and output of warning count table and tablerow."
am: eac773047f

Change-Id: I25da893dc7add3c92fda9fe003a2cd23f9971e36
2016-09-23 00:11:13 +00:00
Treehugger Robot eac773047f Merge "Simplify warn.py and output of warning count table and tablerow." 2016-09-23 00:06:26 +00:00
Dan Willemsen f2649570c5 Pass userdebug/eng variant to Soong
Test: Run build with eng/userdebug/user and check the soong.variables
Change-Id: I7cd71a94e92526b6cc61303b13b7bc593cbbfc3a
2016-09-22 15:22:48 -07:00
Chih-Hung Hsieh 99459fc0d0 Simplify warn.py and output of warning count table and tablerow.
* Use a loop to initialize empty 'members' and 'option' of warnpatterns.
* Create severity.{color,columnheader,header} from an attributes list.
* Compute totalbyproject and totalbyseverity from a constructor.
* Skip all-zero rows and columns in the warning count table.
* Remove redundant spaces and newlines in tablerow output.

Test: run through build.log files
Change-Id: I4d3fa4ecd92e1afab91d85b7535d03f8696e83d8
2016-09-22 15:15:43 -07:00
Dan Willemsen 3594cee467 link_type check: Support modules installed into /data
Test: compare build.ninja before/after, look at warnings.html
Change-Id: I1b78748dd80b73d2601b2adf0aaac8a6b2b350d5
2016-09-22 13:05:02 -07:00
Benoit Lamarche 95cea98863 Merge changes from topic 'jack-d-b3-as-stable'
am: 52eafee87a

Change-Id: I7e4fb947fe8f2c5ea8d1091583c468f8c9ca3d35
2016-09-22 09:43:29 +00:00