Commit graph

5577 commits

Author SHA1 Message Date
Elliott Hughes
20742517b4 Merge "Explain why BuildImage failed." am: 9a33b96103
am: 76eb8e10ee

Change-Id: I4d9e5dc5050d3826c02a033f856c34b0d397b6b0
2017-12-07 22:18:13 +00:00
Treehugger Robot
9a33b96103 Merge "Explain why BuildImage failed." 2017-12-07 21:45:59 +00:00
Colin Cross
f2b5f371ff Merge "Add java modules to soong_to_convert.txt" am: fedcf41cc3
am: 2ea0ecdbfe

Change-Id: I0f5fd1e4fad03118989341b7b4de80c7ea4288c6
2017-12-07 08:27:52 +00:00
David Zeuthen
6fc59b3328 Merge "AVB: If building recovery.img, add AVB hash footer." am: 7b2129f101 am: 0c1c47f700
am: 3f41c5ff1f

Change-Id: If58ddd497c7b6e8a661cbc312bd519796fbfd5b3
2017-12-07 03:37:04 +00:00
David Zeuthen
3f41c5ff1f Merge "AVB: If building recovery.img, add AVB hash footer." am: 7b2129f101
am: 0c1c47f700

Change-Id: I5adecf2f45d308312c545509fd80658f00755883
2017-12-07 02:17:17 +00:00
Colin Cross
fdea893833 Replace build/tools with build/make/tools
Test: m checkbuild
Change-Id: I8db6c27a6d2372f142d10568fe92d6f2e9a59252
2017-12-06 16:12:40 -08:00
David Zeuthen
0c1c47f700 Merge "AVB: If building recovery.img, add AVB hash footer."
am: 7b2129f101

Change-Id: I6b95aeb50a99a41831af4aa6374df3a6e8309ca4
2017-12-06 23:59:52 +00:00
Tao Bao
337633f2b9 releasetools: Remove '-w' from ota_from_target_files options.
'-w' is a short option for '--wipe_user_data', which happens to be the
same as the whole-file signing flag for signapk.

This CL removes the short version to make it less error-prone. Users
should use '--wipe_user_data' to generate packages with enforced data
wipe.

Bug: 70259309
Test: ota_from_target_files.py generates packages with and without
      '--wipe_user_data'.
Test: Not seeing active users that uses 'ota_from_target_files -w'.
Change-Id: Ib8c138663a87aafc6a0b5b6f7c286fb74ef6134b
2017-12-06 15:47:03 -08:00
Colin Cross
3277ba34ae Add java modules to soong_to_convert.txt
Test: examine soong_to_convert.txt
Change-Id: Ibb6db664238a4e98f5d8885dfb3ddc0f35d11ff6
2017-12-06 15:38:52 -08:00
Xin Li
5f03da0404 Merge "DO NOT MERGE: Merge Oreo MR1 into master" 2017-12-06 23:18:30 +00:00
Treehugger Robot
7b2129f101 Merge "AVB: If building recovery.img, add AVB hash footer." 2017-12-06 22:12:25 +00:00
Elliott Hughes
73ff57f48a Explain why BuildImage failed.
BuildImage can return false for lots of reasons. Log two of the more
plausible ones. You'll still need to edit this file and pass True to
RunCommand to work out *what* went wrong, but at least this logging will
tell you *where* things went wrong.

Bug: http://b/63142920
Test: debugged my actual problem
Change-Id: If84427058108dcac0a1b5e2216b8bb11eef522ca
2017-12-06 12:16:39 -08:00
Tao Bao
84b94b2ac7 Merge "releasetools: Address pylint warnings in add_img_to_target_files.py." am: 32c6c4a11e am: 9ad68d6e69
am: 8c689d845c

Change-Id: Iaf5da848706bdc9c72a651464cd72caae0e43a1a
2017-12-05 22:13:52 +00:00
Tao Bao
8c689d845c Merge "releasetools: Address pylint warnings in add_img_to_target_files.py." am: 32c6c4a11e
am: 9ad68d6e69

Change-Id: I796b8ee82aa2bda2f2633f434808dd519cc676f5
2017-12-05 22:07:49 +00:00
Tao Bao
9ad68d6e69 Merge "releasetools: Address pylint warnings in add_img_to_target_files.py."
am: 32c6c4a11e

Change-Id: I4e1d8ad1c6982f969b759f26cf1cb59862bd236f
2017-12-05 22:02:40 +00:00
Jaegeuk Kim
2ea1eba98c core, release: add sload.f2fs for otatools.zip
This also updates mkf2fsuserimg.sh to call sload.f2fs.

Change-Id: I245f6b3dfcd966fbc6783329d781375879fcd065
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2017-12-05 10:59:50 -08:00
Tao Bao
aeec69ced4 Merge "releasetools: Remove deprecated pylint options." am: 3694e104b7 am: ead6281575
am: 97b4ef1583

Change-Id: I0d21d16c451cf221f1c97a83a78d520c694e5b07
2017-12-05 18:57:11 +00:00
Tao Bao
97b4ef1583 Merge "releasetools: Remove deprecated pylint options." am: 3694e104b7
am: ead6281575

Change-Id: Ic49bd5d63cdd738f22dbad1dbbf3d9ab2837db49
2017-12-05 18:52:12 +00:00
Tao Bao
ead6281575 Merge "releasetools: Remove deprecated pylint options."
am: 3694e104b7

Change-Id: I87a9d6b07dc281bacc99e2935f0835958c3d67b5
2017-12-05 18:45:56 +00:00
Tao Bao
6b9fef5243 releasetools: Address pylint warnings in add_img_to_target_files.py.
C:661, 0: Wrong hanging indentation (add 2 spaces).
        OPTIONS.input_tmp, "VENDOR_IMAGES")
        ^ | (bad-continuation)
C:673, 0: Wrong continued indentation (add 14 spaces).
                os.path.join("IMAGES", img_name))
                ^             | (bad-continuation)
C: 54, 0: Import "import datetime" should be placed at the top of the module (wrong-import-position)
C: 55, 0: Import "import hashlib" should be placed at the top of the module (wrong-import-position)
C: 56, 0: Import "import os" should be placed at the top of the module (wrong-import-position)
C: 57, 0: Import "import shlex" should be placed at the top of the module (wrong-import-position)
C: 58, 0: Import "import shutil" should be placed at the top of the module (wrong-import-position)
C: 59, 0: Import "import subprocess" should be placed at the top of the module (wrong-import-position)
C: 60, 0: Import "import tempfile" should be placed at the top of the module (wrong-import-position)
C: 61, 0: Import "import uuid" should be placed at the top of the module (wrong-import-position)
C: 62, 0: Import "import zipfile" should be placed at the top of the module (wrong-import-position)
C: 64, 0: Import "import build_image" should be placed at the top of the module (wrong-import-position)
C: 65, 0: Import "import common" should be placed at the top of the module (wrong-import-position)
C: 66, 0: Import "import rangelib" should be placed at the top of the module (wrong-import-position)
C: 67, 0: Import "import sparse_img" should be placed at the top of the module (wrong-import-position)
W:391,12: Redefining built-in 'dir' (redefined-builtin)

After this CL, it still gives the warning below, which is to be
addressed with follow-ups.

R:635, 2: Too many nested blocks (6/5) (too-many-nested-blocks)

Test: `m dist`
Test: pylint --rcfile=pylintrc add_img_to_target_files.py
Change-Id: I64da184b6b69e93449dbfc989a5d7f46d5223f42
2017-12-04 12:15:35 -08:00
Tao Bao
dac0c88d9d releasetools: Remove deprecated pylint options.
This option u'required-attributes' will be removed in Pylint 2.0
This option u'ignore-iface-methods' will be removed in Pylint 2.0

Test: pylint (1.6.5) no longer gives above warnings.
Change-Id: Ib07cd5aef87407260140c1fca0b11c439cbdf390
2017-12-04 12:15:23 -08:00
David Zeuthen
8fecb289ee AVB: If building recovery.img, add AVB hash footer.
In some non-A/B setups, recovery.img is still being used. If AVB is
enabled, we currently don't add a hash footer to recovery.img nor do
we include the hash digest in vbmeta.img. This CL fixes that.

This was tested on a build with the following settings

 TARGET_NO_RECOVERY := false
 BOARD_USES_RECOVERY_AS_BOOT := false
 BOARD_BUILD_SYSTEM_ROOT_IMAGE := false
 BOARD_RECOVERYIMAGE_PARTITION_SIZE := 33554432
 BOARD_AVB_RECOVERY_ADD_HASH_FOOTER_ARGS := --prop foo:bar

and then it was verified using 'avbtool info_image' that recovery.img
has a hash footer and a 'foo' property with the value 'bar'. This was
also checked successfully for vbmeta.img.

Test: See above.
Bug: None
Change-Id: I98124d5661ea768411416fa8d2a2ae6cc664fdc8
2017-12-04 13:54:38 -05:00
Dan Willemsen
f4505a095a Fix / suppress warnings for clang+mingw am: 25c73e9156 am: 9be8a79255
am: 215b6bddbe

Change-Id: I6822c72da477cb691b387009e6c3da40af21d12e
2017-11-30 08:19:36 +00:00
Dan Willemsen
215b6bddbe Fix / suppress warnings for clang+mingw am: 25c73e9156
am: 9be8a79255

Change-Id: I5a625aa5dcaebd9255cd9b8808ec859a9c672531
2017-11-30 08:15:30 +00:00
Dan Willemsen
9be8a79255 Fix / suppress warnings for clang+mingw
am: 25c73e9156

Change-Id: I7f60ee6efc214605c397f91656f7aaf0a76a038d
2017-11-30 08:11:57 +00:00
Dan Willemsen
30f514cc51 Merge changes from topic "clang_supported"
* changes:
  Prepare for clang+mingw windows builds
  Fix / suppress warnings for clang+mingw
2017-11-30 08:05:58 +00:00
Dan Willemsen
25c73e9156 Fix / suppress warnings for clang+mingw
Switch attribute error to attribute unavailable, which apparently works
since it then broke the build :-/

Suppress unused parameter warnings. They aren't that useful for windows
functions that are just #ifndef WIN32. This is marked as a global cflag,
but something is overriding that with the clang+mingw changes, and it's
not actually that hard to suppress or fix where necessary.

Bug: 69933068
Test: mmma build/tools/libhost
Change-Id: I09adda4544bc9b56452b4fe182dba3d0b701dcbb
2017-11-29 20:54:33 -08:00
Tianjie Xu
17867754ef Merge "Improve the comment in AddSplitTransfers" am: cca4a4c993 am: 4b57c28908
am: 65bee4ee78

Change-Id: Id74b344092f70d1da29ac3a5c33e3bba75742c5f
2017-11-29 22:07:06 +00:00
Tianjie Xu
65bee4ee78 Merge "Improve the comment in AddSplitTransfers" am: cca4a4c993
am: 4b57c28908

Change-Id: I7108dd09f0f3f48c84135827cf9a6e190d63d034
2017-11-29 22:01:58 +00:00
Tianjie Xu
4b57c28908 Merge "Improve the comment in AddSplitTransfers"
am: cca4a4c993

Change-Id: I853cd62997a964b91324d079e6940926c889ba6d
2017-11-29 21:57:52 +00:00
Tianjie Xu
41390d4e1e Improve the comment in AddSplitTransfers
Bug: 69624507
Test: build an incremental package
Change-Id: I54dac0a2ddcc19b722e352fb19d53ff20444fa42
2017-11-22 11:35:18 -08:00
Tianjie Xu
d4e59044a1 Merge "Fall back to normal split if imgdiff fails when splitting large apks" am: 520c9f0f5f am: ff9efd3290
am: a40db9c53b

Change-Id: I151967860c3d4ddd4c6bcb902f57f3786f8d78bf
2017-11-22 19:09:44 +00:00
Tianjie Xu
a40db9c53b Merge "Fall back to normal split if imgdiff fails when splitting large apks" am: 520c9f0f5f
am: ff9efd3290

Change-Id: Ib5215b6cf42973d62023cc1f10750729ad2f52e8
2017-11-22 18:55:40 +00:00
Tianjie Xu
ff9efd3290 Merge "Fall back to normal split if imgdiff fails when splitting large apks"
am: 520c9f0f5f

Change-Id: I0db7558c996cc515a79a99ce1d27525728a041dc
2017-11-22 18:46:04 +00:00
Tianjie Xu
520c9f0f5f Merge "Fall back to normal split if imgdiff fails when splitting large apks" 2017-11-22 18:28:31 +00:00
Tianjie Xu
f68b50f963 Fall back to normal split if imgdiff fails when splitting large apks
Imgdiff expects the input files to be valid zip archives. During the
split of large apks, imgdiff may fail when there's a hole in the input
file; potentially due to the blocks allocation of mke2fs. This CL solves
the issue by falling back to normal split in case of the imgdiff split
failure. The split transfers will then use bsdiff instead.

Bug: 69624507
Test: generate the incremental package for the failed targets and check the
transfers.
Change-Id: I4882452378123e60ad3434053b57f33e53ac4b82
2017-11-21 23:37:36 -08:00
Tao Bao
9a49d8ef47 Merge "check_ota_package_signature.py: Set up PYTHONPATH." am: 9f686938da am: 51f5d3360e
am: 56671edd93

Change-Id: Ic7ab87ff1f80a1820758662d3ba1de373c2f8072
2017-11-21 21:47:27 +00:00
Tao Bao
56671edd93 Merge "check_ota_package_signature.py: Set up PYTHONPATH." am: 9f686938da
am: 51f5d3360e

Change-Id: Iadb00273671818cb45df56dedc349356ef6a67ce
2017-11-21 21:44:18 +00:00
Tao Bao
51f5d3360e Merge "check_ota_package_signature.py: Set up PYTHONPATH."
am: 9f686938da

Change-Id: Ie84a386dd6acc44fd1fba987e8f0a5703248cd59
2017-11-21 21:40:13 +00:00
Tao Bao
d2ae0b0613 check_ota_package_signature.py: Set up PYTHONPATH.
... to include system/update_engine/scripts if ANDROID_BUILD_TOP is set
(e.g. after lunching a target).

Test: ./build/make/tools/releasetools/check_ota_package_signature.py
      works without manually setting PYTHONPATH.
Change-Id: I0c5101fab2dd69cb6a598b909aa04bc4d5f45284
2017-11-21 11:30:27 -08:00
Tao Bao
c87c6f068d Merge "releasetools: Allow building AVB-enabled recovery.img." am: 37066490a5 am: 4d1764b0be
am: e5e6611c29

Change-Id: If6b829d23e578c168ba5a55d90ca175a0c32f13a
2017-11-21 17:15:09 +00:00
Tao Bao
e5e6611c29 Merge "releasetools: Allow building AVB-enabled recovery.img." am: 37066490a5
am: 4d1764b0be

Change-Id: I6adf6a44fcb7fda2b06c815ff819add0e5645ed1
2017-11-21 17:12:30 +00:00
Tao Bao
4d1764b0be Merge "releasetools: Allow building AVB-enabled recovery.img."
am: 37066490a5

Change-Id: Ie8393a7e81c4f056a12a0be5ed2cd07ed54ef76b
2017-11-21 17:07:57 +00:00
Tao Bao
37066490a5 Merge "releasetools: Allow building AVB-enabled recovery.img." 2017-11-21 17:02:35 +00:00
Colin Cross
93c73f957f Merge "Convert signtos to Android.bp" am: 80ec993a58 am: bb051769c2
am: 0f36226f15

Change-Id: I834542c241e5d9071529f5960f010460fe6d9fdd
2017-11-21 03:38:21 +00:00
Colin Cross
0f36226f15 Merge "Convert signtos to Android.bp" am: 80ec993a58
am: bb051769c2

Change-Id: I3fef8edc7f1c901cf1fc67e16b83e3259a1ab5ad
2017-11-21 03:35:44 +00:00
Colin Cross
bb051769c2 Merge "Convert signtos to Android.bp"
am: 80ec993a58

Change-Id: I5ddb92b0ca0485b01860aaff6ae613d5276eedb8
2017-11-21 03:33:06 +00:00
Colin Cross
3c363ad729 Convert signtos to Android.bp
See build/soong/README.md for more information.

Test: m checkbuild
Change-Id: Ia468cde0492e64858b7a603deba9b22b95e56ff4
2017-11-21 03:26:31 +00:00
Tao Bao
e54c2150ea Merge "releasetools: Always create IMAGES/ directory." am: db7dfacb96 am: a41e00784b
am: 32c91c9c31

Change-Id: I2aeb55b993bbc90ea2945ae6c00128c0edd033ca
2017-11-20 22:57:27 +00:00
Tao Bao
32c91c9c31 Merge "releasetools: Always create IMAGES/ directory." am: db7dfacb96
am: a41e00784b

Change-Id: I91f7bc071f531f10ed8d49e3eab06ca1f1abd9b1
2017-11-20 22:52:50 +00:00
Tao Bao
a41e00784b Merge "releasetools: Always create IMAGES/ directory."
am: db7dfacb96

Change-Id: Iaede3e35fdd64dc748a98f625d390f0f38cd7e4a
2017-11-20 22:50:01 +00:00
Tao Bao
bf70c318b7 releasetools: Allow building AVB-enabled recovery.img.
Bug: 68224784
Test: Enable AVB on aosp_bullhead-userdebug. `m dist`. Note that the
      prebuilt vendor.img needs to be AVB-signed first.
Test: `m dist` with aosp_walleye-userdebug.
Change-Id: I18235e4d0dde6af71a96e46ec434480cc9a22bef
2017-11-20 12:44:18 -08:00
Tao Bao
ae396d9b0c releasetools: Always create IMAGES/ directory.
AddImagesToTargetFiles() takes either a zip file, or a zip root as
input. We used to create IMAGES/ directory only when working with zip
root input. Commit 262bf3f0b5 has changed
to also stage boot / recovery images there when working with a zip file.
This CL makes sure the directory is always available under both modes.

Bug: 63456822
Test: zip -d target_files.zip IMAGES/\*;
      add_img_to_target_files.py target_files.zip
Test: sign_target_files_apks.py target_files.zip signed-target_files.zip
Change-Id: Iea91d0403cdec1b16bb93bb71d3ed06856b8f7c3
2017-11-20 12:44:18 -08:00
Tao Bao
a0e521ed16 Merge "releasetools: Fix the rebuilding of vbmeta.img." am: 2f7fab9ab9 am: 4727930bff
am: 497862c757

Change-Id: I7bb84a65a9ef6e3d4bbe98244f51819b569ecbc9
2017-11-18 00:53:15 +00:00
Tao Bao
497862c757 Merge "releasetools: Fix the rebuilding of vbmeta.img." am: 2f7fab9ab9
am: 4727930bff

Change-Id: If73915a15fa675ca635588c99bc4e6ed56e4be05
2017-11-18 00:44:28 +00:00
Tao Bao
4727930bff Merge "releasetools: Fix the rebuilding of vbmeta.img."
am: 2f7fab9ab9

Change-Id: Ie6c6536be7da1e85167c22de36832b4145255f19
2017-11-18 00:32:23 +00:00
Tao Bao
2f7fab9ab9 Merge "releasetools: Fix the rebuilding of vbmeta.img." 2017-11-18 00:22:14 +00:00
Colin Cross
a80df4238e Merge changes from topics "soong_logtags", "droiddoc_srcjars" am: f1f66974c6 am: 0b1fc880e5
am: 99dc51da38

Change-Id: I711c56f11c785ff7d2ccadbf912d96b6854c94b7
2017-11-17 21:48:22 +00:00
Colin Cross
99dc51da38 Merge changes from topics "soong_logtags", "droiddoc_srcjars" am: f1f66974c6
am: 0b1fc880e5

Change-Id: I7cc4970a5be00762c0127db0502ab03cbdfb13e7
2017-11-17 21:42:51 +00:00
Colin Cross
0b1fc880e5 Merge changes from topics "soong_logtags", "droiddoc_srcjars"
am: f1f66974c6

Change-Id: Ic47da3913b34da288c258d61540892427ddf4506
2017-11-17 21:36:51 +00:00
Colin Cross
f1f66974c6 Merge changes from topics "soong_logtags", "droiddoc_srcjars"
* changes:
  Allow converting logtags to java without merged logtags file
  Add support for srcjars to droiddoc
2017-11-17 21:32:27 +00:00
Chih-hung Hsieh
dfa1a5b3dc Merge "Recognize new clang-tidy android-* warnings." am: 315761ace1 am: dafe61c817
am: c982ae3728

Change-Id: Icbdb34606e0bcebf5733904fe20cbd50e52abecb
2017-11-17 17:19:07 +00:00
Chih-hung Hsieh
c982ae3728 Merge "Recognize new clang-tidy android-* warnings." am: 315761ace1
am: dafe61c817

Change-Id: Iebf015a5351d46ba6331908c7a945fd661d1de6e
2017-11-17 17:16:58 +00:00
Chih-hung Hsieh
dafe61c817 Merge "Recognize new clang-tidy android-* warnings."
am: 315761ace1

Change-Id: I516702a4bad35c6a4ec34f33bf42fa004400a860
2017-11-17 17:13:27 +00:00
Chih-Hung Hsieh
2cd467b36c Recognize new clang-tidy android-* warnings.
Test: warn.py build.log
Change-Id: I9bcd1fffcb567346a3d959f98821e2cf58e87ba2
2017-11-16 15:42:11 -08:00
Colin Cross
0bb782bd4e Allow converting logtags to java without merged logtags file
Most logtags files only have entries with hardcoded numbers.
Allow these files to be converted to java without needing the
merged logtags file.

Test: m checkbuild
Change-Id: I4cd38aa502fc9b8e50af92ff8296d3ad6abfb56e
2017-11-16 14:58:05 -08:00
Tomasz Wasilczyk
ca4224fc7c Merge "Silence superfluous build messages." am: 4dbdb60698 am: a62800487e
am: 463dcf37f8

Change-Id: I69b560b725724152cf8fb87cf27d9c0d5c7c2e45
2017-11-15 22:42:25 +00:00
Tomasz Wasilczyk
463dcf37f8 Merge "Silence superfluous build messages." am: 4dbdb60698
am: a62800487e

Change-Id: I1c2f39812f1be01940887aed70c630f7e9b64a0f
2017-11-15 22:39:21 +00:00
Tomasz Wasilczyk
a62800487e Merge "Silence superfluous build messages."
am: 4dbdb60698

Change-Id: I3574184c22b8fca41fd85e09ceacc2b598643c67
2017-11-15 22:35:48 +00:00
Tomasz Wasilczyk
4dbdb60698 Merge "Silence superfluous build messages." 2017-11-15 22:27:30 +00:00
Tao Bao
7cc46f8f40 Merge "releasetools: Fix the size check for AVB images." am: 905c84cada am: 029b3b6619
am: 29472b1848

Change-Id: I00ae52779aad8ef7ad4fdf874e13548776ec1ec3
2017-11-15 19:05:07 +00:00
Tao Bao
29472b1848 Merge "releasetools: Fix the size check for AVB images." am: 905c84cada
am: 029b3b6619

Change-Id: I60768378bfaa57fa47ad5a89d235a060d06e887c
2017-11-15 18:45:40 +00:00
Tomasz Wasilczyk
29ec06b7ba Silence superfluous build messages.
Bug: 69315492
Test: it builds
Change-Id: Ic02484b80fa27c53786204402930ed5f33ec7fda
2017-11-15 10:34:01 -08:00
Tao Bao
029b3b6619 Merge "releasetools: Fix the size check for AVB images."
am: 905c84cada

Change-Id: I4321bb226c8e77536fd0896980c64ac4ed680e37
2017-11-15 18:32:38 +00:00
Tao Bao
262bf3f0b5 releasetools: Fix the rebuilding of vbmeta.img.
If only vbmeta.img is missing from the target_files.zip,
'add_img_to_target_files.py -a' will fail to re-create vbmeta.img.

++++ vbmeta ++++

Traceback (most recent call last):
  File "./build/make/tools/releasetools/add_img_to_target_files.py", line 693, in <module>
    main(sys.argv[1:])
  File "./build/make/tools/releasetools/add_img_to_target_files.py", line 687, in main
    AddImagesToTargetFiles(args[0])
  File "./build/make/tools/releasetools/add_img_to_target_files.py", line 584, in AddImagesToTargetFiles
    boot_contents = boot_image.WriteToTemp()
AttributeError: 'NoneType' object has no attribute 'WriteToTemp'

Because it has skipped loading the boot.img, which leads to the above error.

Bug: 63456822
Test: As follows:
  $ zip -d target_files.zip vbmeta.img
  $ add_img_to_target_files.py -a target_files.zip
Test: `m dist` on aosp_arm64-userdebug
Change-Id: Ieba5f0b6848c3ec5d8bcfd24d48cc5af8b39f06c
2017-11-14 17:05:57 -08:00
Tao Bao
9dd909e6db releasetools: Fix the size check for AVB images.
When generating full OTAs for AVB-enabled targets, it fails the size
assertion for boot.img.

  ERROR: boot size (31457280) is 100.00% of limit (31457280)

The size assumption is no longer true for AVB-signed images, because
the actual image size should be always identical to the limit.

Bug: 67841177
Test: Enable AVB on bullhead. `m dist`.
Change-Id: I9bd432ccd88094628eb71308554839549eccb6d9
2017-11-14 15:43:36 -08:00
Tianjie Xu
15b728b8ed Merge "Add multithread support to call imgdiff with block-limit" am: 5d60cd2d3e am: 13680814dc
am: fd0011a9bb

Change-Id: Id3356c0511b8296181925598258655cedefd080a
2017-11-14 20:02:37 +00:00
Xin Li
44dd4881de Merge commit '66b8b530187b129934a685bf0c4349eef00e4b0c' from
oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master.

Change-Id: I7594bb72dd7e847292eb502edd918e41318aac29
Merged-In: Ide82473d358719f7e01cd2a4a85db954f3722f14
2017-11-14 11:36:22 -08:00
Tianjie Xu
fd0011a9bb Merge "Add multithread support to call imgdiff with block-limit" am: 5d60cd2d3e
am: 13680814dc

Change-Id: I772ccc6540bdf2fe41e70ae8e959094918717c29
2017-11-14 18:59:06 +00:00
Tianjie Xu
5d60cd2d3e Merge "Add multithread support to call imgdiff with block-limit" 2017-11-14 18:54:08 +00:00
Alex Deymo
b22db671d0 Merge "Update binary name to "brotli"." am: cbb4ec6cf0 am: ea26c8104e
am: a1c5d47708

Change-Id: I57092f1bcb427db14b7b6e0a21ff16e56ef7781b
2017-11-13 23:03:30 +00:00
Alex Deymo
a1c5d47708 Merge "Update binary name to "brotli"." am: cbb4ec6cf0
am: ea26c8104e

Change-Id: I330a67434c9d69c3c9d9aadae495e92d9788928c
2017-11-13 22:58:16 +00:00
Tianjie Xu
2536607d90 Add multithread support to call imgdiff with block-limit
With the new implementation of handling large apks, we need to call
imgdiff with block-limit to split the apk and generate the patch at
the same time. The call to imgdiff would significantly increase the
time consumption of the "FindTransfers" function which we used to
execute sequentially. This cl addresses this issue and speeds up the
process by making the imgdiff call parallel.

Bug: 34220646
Test: Create and sideload an incremental package for angler
Change-Id: Id62e348418fc1d22e32ea6c8ac16d9ab3ec92d7b
2017-11-13 14:58:05 -08:00
Alex Deymo
cbb4ec6cf0 Merge "Update binary name to "brotli"." 2017-11-13 22:43:22 +00:00
Alex Deymo
b10e07aea7 Update binary name to "brotli".
With the update of brotli to version 1.0.1 the new binary tool is now
called "brotli". This patch updates the scripts to use the new name.

Bug: 34220646
Test: `make dist`; ota_from_target_files on non-A/B device.
Change-Id: Ie8da4333388d029d5960a723a55efd875d8ee820
2017-11-13 18:11:45 +01:00
Tao Bao
d8bb564f99 Merge "releasetools: Reduce the memory use in test_common.py." am: 44cb0db6a7 am: 4fa1453f31
am: b3f0a951cf

Change-Id: I2abed40806a26bcbbf7bab9f5f25e6c2c26e6e7e
2017-11-11 01:48:27 +00:00
Tao Bao
b3f0a951cf Merge "releasetools: Reduce the memory use in test_common.py." am: 44cb0db6a7
am: 4fa1453f31

Change-Id: I16286bfdb209d3497acd161b1aafd0f756a686bb
2017-11-11 01:44:17 +00:00
Tao Bao
44cb0db6a7 Merge "releasetools: Reduce the memory use in test_common.py." 2017-11-11 01:32:31 +00:00
Colin Cross
30ca7be207 Merge "Convert signapk to Android.bp" am: 3563ac582a am: 4666a08608
am: 14409571c7

Change-Id: Idab0f1f5550324af17e7f7b402d3000b8b23f21c
2017-11-10 19:37:28 +00:00
Colin Cross
14409571c7 Merge "Convert signapk to Android.bp" am: 3563ac582a
am: 4666a08608

Change-Id: I9cbe96a55927b22ac897632260b3cd38edc7ff82
2017-11-10 19:28:29 +00:00
Colin Cross
3563ac582a Merge "Convert signapk to Android.bp" 2017-11-10 19:17:26 +00:00
Tao Bao
5155990a68 Merge "releasetools: Write back default_system_dev_certificate." am: ff87a9f9d9 am: b55251898d
am: 3b71247a2e

Change-Id: Ib9b1c936037b66ad98bffb53d5f3ee2b764749fa
2017-11-10 00:08:15 +00:00
Tao Bao
3b71247a2e Merge "releasetools: Write back default_system_dev_certificate." am: ff87a9f9d9
am: b55251898d

Change-Id: Ia2b4dc9f853d60f272b494b0d71be4a91383cfb6
2017-11-09 23:58:03 +00:00
Colin Cross
ad44dd4f3c Convert signapk to Android.bp
See build/soong/README.md for more information

Test: m checkbuild
Change-Id: I89a7fa7647e7081ca49720fae3be23ce84ab38e5
2017-11-09 15:11:34 -08:00
Tao Bao
f718f90212 releasetools: Write back default_system_dev_certificate.
When signing a target_files.zip, the OTA certificate specified by
default_system_dev_certificate could be replaced with a mapped key. When
that happens, we must explicitly specify --package_key when generating
OTA packages with ota_from_target_files.py. Otherwise the OTA package
will be signed with the wrong key, which leads to verification failures.

This CL updates the default_system_dev_certificate value in
misc_info.txt accordingly.

Test: Sign a target_files.zip and replace the OTA key. Check
      META/misc_info.txt in the generated target_files.zip.
  $ ./build/make/tools/releasetools/sign_target_files_apks.py -v \
      --replace_ota_keys \
      -k build/target/product/security/testkey=build/target/product/security/platform \
      out/dist/aosp_marlin-target_files-eng.tbao.zip \
      signed-marlin-target_files-test.zip

Change-Id: I093234b5add3e27c5b3887cefeffd74e6f0a3e98
2017-11-09 10:23:50 -08:00
Tao Bao
31b0807310 releasetools: Reduce the memory use in test_common.py.
test_common constructs a few 2GiB strings in memory, which leads to huge
memory footprint (18GiB). This CL moves away from in-memory strings to
generators, which reduces the memory use down to 41MiB. It also reduces
the time cost from 294s to 139s as an extra benefit for free.

The CL addresses some trivial pylint warnings as well.

* Before

$ /usr/bin/time -v python -m unittest -v test_common
...
----------------------------------------------------------------------
Ran 11 tests in 294.986s

OK
	Command being timed: "python -m unittest -v test_common"
	User time (seconds): 110.51
	System time (seconds): 109.34
	Percent of CPU this job got: 74%
	Elapsed (wall clock) time (h:mm:ss or m:ss): 4:55.06
	Average shared text size (kbytes): 0
	Average unshared data size (kbytes): 0
	Average stack size (kbytes): 0
	Average total size (kbytes): 0
	Maximum resident set size (kbytes): 18894172
	Average resident set size (kbytes): 0
	Major (requiring I/O) page faults: 1
	Minor (reclaiming a frame) page faults: 20774908
	Voluntary context switches: 48
	Involuntary context switches: 3241
	Swaps: 0
	File system inputs: 184
	File system outputs: 8406424
	Socket messages sent: 0
	Socket messages received: 0
	Signals delivered: 0
	Page size (bytes): 4096
	Exit status: 0

* After

$ /usr/bin/time -v python -m unittest -v test_common
...
----------------------------------------------------------------------
Ran 11 tests in 139.100s

OK
	Command being timed: "python -m unittest -v test_common"
	User time (seconds): 59.00
	System time (seconds): 4.73
	Percent of CPU this job got: 45%
	Elapsed (wall clock) time (h:mm:ss or m:ss): 2:19.17
	Average shared text size (kbytes): 0
	Average unshared data size (kbytes): 0
	Average stack size (kbytes): 0
	Average total size (kbytes): 0
	Maximum resident set size (kbytes): 41252
	Average resident set size (kbytes): 0
	Major (requiring I/O) page faults: 0
	Minor (reclaiming a frame) page faults: 106569
	Voluntary context switches: 44
	Involuntary context switches: 103
	Swaps: 0
	File system inputs: 8
	File system outputs: 8422808
	Socket messages sent: 0
	Socket messages received: 0
	Signals delivered: 0
	Page size (bytes): 4096
	Exit status: 0

Fixes: 68988396
Test: See above.
Change-Id: I00f16603a4ee59fb085b189c6f5b5ee9d2378690
2017-11-08 17:10:33 -08:00
Tianjie Xu
b2f60c0611 Merge "Fix the imgdiff failure when running test_common unittest" am: 7136100be6 am: 2b8489cf45
am: 929c7c6c81

Change-Id: I3af15e4e5d2b05e35ea51e9718bae40fc57df55b
2017-11-08 00:03:55 +00:00
Tianjie Xu
929c7c6c81 Merge "Fix the imgdiff failure when running test_common unittest" am: 7136100be6
am: 2b8489cf45

Change-Id: I6b94e092bd980ccd4266cd47af6cf53a0cc44e46
2017-11-07 23:53:42 +00:00
Tianjie Xu
7136100be6 Merge "Fix the imgdiff failure when running test_common unittest" 2017-11-07 23:40:20 +00:00
Tianjie Xu
df055580d0 Fix the imgdiff failure when running test_common unittest
imgdiff fails on plain strings after we put more checks the input
data. This leads to failure when running unittest
"test_recovery_from_boot". The CL fixes the issue by serving gzipped
dummy images as the test input.

Bug: 68988329
Test: InstallRecoveryScriptFormatTest passes
Change-Id: I1952b311681ac4f39c0e51aef1de1177aebeac43
2017-11-07 12:38:08 -08:00
Dan Willemsen
acaf1a5ed4 Merge changes Ib37508d4,Ia46ac30e am: dcd46870f2 am: 550fa7b4d3
am: 67f4bccdbb

Change-Id: Ia36ba3298f1cd1b5558790a59c1723904c661576
2017-11-06 23:07:35 +00:00
Dan Willemsen
67f4bccdbb Merge changes Ib37508d4,Ia46ac30e am: dcd46870f2
am: 550fa7b4d3

Change-Id: I0191f69cac5b67eb258431bfb503c5d706b56607
2017-11-06 23:04:35 +00:00
Dan Willemsen
dcd46870f2 Merge changes Ib37508d4,Ia46ac30e
* changes:
  Turn off Windows builds during BUILD_HOST_static
  zipalign: Fix build failure in static_sdk_tools.
2017-11-06 22:53:46 +00:00
Daniel Cardenas
07f4a0e49c Merge "PDK fix. Remove conditional that stops component from being in PDK." am: 4578bf1f96 am: 212f32d7d1
am: a8653af161

Change-Id: I040a006ca5d78a2d92bd17b76f8c52e0042a4a46
2017-11-06 22:08:11 +00:00
Daniel Cardenas
a8653af161 Merge "PDK fix. Remove conditional that stops component from being in PDK." am: 4578bf1f96
am: 212f32d7d1

Change-Id: Ibdff632204ae04da89cd9d1f43474bc5a52be784
2017-11-06 22:02:33 +00:00
Daniel Cardenas
429e5a6363 PDK fix. Remove conditional that stops component from being in PDK.
Bug: 67663308
Test: Build on master and PDK branch
Change-Id: I101452230376c4c509004cf6d03070ce85620e89
2017-11-06 11:57:06 -08:00
Narayan Kamath
887c645e02 zipalign: Fix build failure in static_sdk_tools.
Convert all dependencies to static deps.

Test: make -j50 static_sdk_tools BUILD_HOST_static=1
Bug: 35246701
Bug: 68804545

Change-Id: Ia46ac30e5c05226f1bfec82a84f05e4be945bf74
2017-11-06 11:12:08 -08:00
Tao Bao
365bb41b01 Merge "releasetools: Fix the doctest for rangelib.py." am: 7e85dd9dc0 am: 2b38618a62
am: ed6f6bc272

Change-Id: I83fd2157ef4fbc9eee6151146d47f3257b9066b5
2017-11-03 00:31:29 +00:00
Tao Bao
ed6f6bc272 Merge "releasetools: Fix the doctest for rangelib.py." am: 7e85dd9dc0
am: 2b38618a62

Change-Id: Ib7835fe53b81a39903b8422cb6931b011788f0bb
2017-11-03 00:26:48 +00:00
Tao Bao
c0dcbd0017 releasetools: Fix the doctest for rangelib.py.
$ python rangelib.py
**********************************************************************
File "rangelib.py", line 323, in __main__.RangeSet.next_item
Failed example:
    list(rangelib.RangeSet("10-19 3 5 7").next_item())
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest __main__.RangeSet.next_item[2]>", line 1, in <module>
        list(rangelib.RangeSet("10-19 3 5 7").next_item())
    NameError: name 'rangelib' is not defined
**********************************************************************
1 items had failures:
   1 of   3 in __main__.RangeSet.next_item
***Test Failed*** 1 failures.

Test: python rangelib.py
Change-Id: I6c791ff4453f40d90b34f97b881460da9878fe64
2017-11-02 12:19:36 -07:00
Narayan Kamath
3d3d3d9014 Merge "zipalign: Remove dependency on androidfw." am: 9709191837 am: cc498428e5
am: 122d1546d7

Change-Id: I96c203205a9e55afa15a01a86c45374e3b1e3910
2017-11-01 11:42:06 +00:00
Narayan Kamath
122d1546d7 Merge "zipalign: Remove dependency on androidfw." am: 9709191837
am: cc498428e5

Change-Id: I8feb5facf8932943e11d27061d54fbaf88b02843
2017-11-01 11:40:02 +00:00
Narayan Kamath
9709191837 Merge "zipalign: Remove dependency on androidfw." 2017-11-01 11:12:18 +00:00
Jaekyun Seok
9ef0c230c1 Merge "Rename ro.vendor.product.* to ro.product.vendor.*" am: 9e622c7e06
am: e4d8ef1ba7

Change-Id: I6a8983e41b6bace2bfb80dffc6520a57c5379a9f
2017-11-01 03:08:29 +00:00
Jaekyun Seok
43c2f8aeee Rename ro.vendor.product.* to ro.product.vendor.*
"ro.vendor." prefix will be used only for vendor-specific properties
except for ro.vendor.build.date, ro.vendor.build.date.utc and
ro.vendor.build.fingerprint.

Those exceptions have been used since Android L. So we can't rename them
to support the system-only upgrade from old Android.

Bug: 36796459
Test: confirmed that ro.vendor.product.* were changed to
ro.product.vendor.* in vendor/build.prop

Merged-In: Ibc107b00264a2dc194261d1968b27a9b17b5d798
Change-Id: Ibc107b00264a2dc194261d1968b27a9b17b5d798
(cherry picked from commit 8cf6443264)
2017-11-01 10:11:32 +09:00
Alex Klyubin
d7f2eec094 Merge "Add OWNERS for SignApk" am: 9a04e12eba am: d47e269bf2
am: a23ac980f0

Change-Id: I13631eeb834b1a7251dad3ac70a1fcc29df0d67f
2017-11-01 00:58:16 +00:00
Tao Bao
a348832eaa Merge "releasetools: Remove the deprecated flag --board_config." am: 224b5f9926 am: 076dd6aa85
am: 5275117088

Change-Id: Ia0bd2afb2ca8bf8d54e901ab4a7ec292fce567ef
2017-11-01 00:57:16 +00:00
Tao Bao
9847030783 Merge "releasetools: Fix the wrong command when falling back to bsdiff." am: f2a3454fa5 am: e1c0604259
am: 08fe2b65cd

Change-Id: Ib8ef00c492a9594c09d6c7e9aa5416b3d461ced8
2017-11-01 00:55:25 +00:00
Alex Klyubin
a23ac980f0 Merge "Add OWNERS for SignApk" am: 9a04e12eba
am: d47e269bf2

Change-Id: I126c9eee0f8459cc652c3b6ba959badc4de1796f
2017-10-31 23:30:00 +00:00
Tao Bao
5275117088 Merge "releasetools: Remove the deprecated flag --board_config." am: 224b5f9926
am: 076dd6aa85

Change-Id: I88accd860310ca3fdfdb6644a25505208dbeb277
2017-10-31 23:29:10 +00:00
Tao Bao
08fe2b65cd Merge "releasetools: Fix the wrong command when falling back to bsdiff." am: f2a3454fa5
am: e1c0604259

Change-Id: I806f248d671b344dd5e201c787eb374e4a6ea625
2017-10-31 23:26:57 +00:00
Tao Bao
f69f143fb8 Merge "releasetools: Fix the comment for '--verify' flag." am: f9b1b4c37d am: 4c38da5b2e
am: c6f0d75e57

Change-Id: I3c8a0c5dc01071bc5c63be7646fe69e1477b902b
2017-10-31 22:13:24 +00:00
Tao Bao
c6f0d75e57 Merge "releasetools: Fix the comment for '--verify' flag." am: f9b1b4c37d
am: 4c38da5b2e

Change-Id: I05a6cd2b85c34d22df156b9cba4c95cd7d8103ce
2017-10-31 22:09:06 +00:00
Treehugger Robot
9a04e12eba Merge "Add OWNERS for SignApk" 2017-10-31 21:53:45 +00:00
Tao Bao
224b5f9926 Merge "releasetools: Remove the deprecated flag --board_config." 2017-10-31 21:36:45 +00:00
Tao Bao
f2a3454fa5 Merge "releasetools: Fix the wrong command when falling back to bsdiff." 2017-10-31 21:11:56 +00:00
Treehugger Robot
f9b1b4c37d Merge "releasetools: Fix the comment for '--verify' flag." 2017-10-31 21:00:19 +00:00
Victor Hsieh
dd58be5787 Merge "Migrate to the new apksig API" am: da343de3ba am: 9d3b6c2ec4
am: 2d43232c24

Change-Id: Id142d61c8c7c1af80d65cf895232892392ee762f
2017-10-31 19:37:45 +00:00
Alex Klyubin
c6c6dfe742 Add OWNERS for SignApk
Test: build/make/tools/checkowners.py -c -v OWNERS
Bug: 30972906
Change-Id: I7a2c9301376e24239924ffbedcb2b97727da700a
2017-10-31 12:36:04 -07:00
Victor Hsieh
2d43232c24 Merge "Migrate to the new apksig API" am: da343de3ba
am: 9d3b6c2ec4

Change-Id: I7a52983656e26b6ba98655f249f2522380ad6768
2017-10-31 19:27:10 +00:00
Tao Bao
4b76a0e9ee releasetools: Remove the deprecated flag --board_config.
It has been long deprecated since commit
fdd8e69c42 (Donut).

Test: `m dist` with aosp_marlin-userdebug and aosp_angler-userdebug.
Test: No user of "--board_config" in code search.
Change-Id: Ic0336c22cac32de5de88161748d09b579f892e99
2017-10-31 12:16:48 -07:00
Tao Bao
d41c9179d2 releasetools: Fix the wrong command when falling back to bsdiff.
Commit b937ead5d9 added the fallback to
bsdiff on imgdiff failures. However, it missed setting the transfer
style accordingly, which led to patch header mismatch.

Bug: 68659848
Test: Generate an incremental that has the fallback from imgdiff to
      bsdiff. Examine the generated transfer list and verify that it has
      "bsdiff" for the fallback command.

Change-Id: I55e46879d590a8af82ea796b9d98ffdb30360408
2017-10-31 12:09:07 -07:00
Tao Bao
edb35b85e2 releasetools: Fix the comment for '--verify' flag.
'-v' is not the abbreviation for '--verify' (but for '--verbose'
instead).

Test: N/A
Change-Id: I86339a1f7ea538d88ac6ed61595361531b79065c
2017-10-31 11:55:41 -07:00
Victor Hsieh
d50662502f Migrate to the new apksig API
Following the new API contract, this effectively add extra padding
before central dir to make it 4KB aligned.

Test: build succeeded
Bug: 30972906
Change-Id: I7cac9d2c4371b473c88df867b3b2ae906443db10
2017-10-31 08:24:02 -07:00
Narayan Kamath
0e4110e4c3 zipalign: Remove dependency on androidfw.
Use zip_archive directly. Note that this codepath is used only
when recompressing archives with zopfli during the alignment step.
It's unclear whether this is in use at all, but I verified that the
results are identical (note the usage of the "-z" flag in the test
below).

Test: make && out/host/linux-x86/bin/zipalign -v -f -z 8 \
        out/target/product/marlin/system/app/Email/Email.apk ./out.zip

Bug: 35246701
Change-Id: I641cdb6d409cc07974d49d42c9f9e6d4f905e472
2017-10-30 12:18:16 +00:00
Jaekyun Seok
8cf6443264 Rename ro.vendor.product.* to ro.product.vendor.*
"ro.vendor." prefix will be used only for vendor-specific properties
except for ro.vendor.build.date, ro.vendor.build.date.utc and
ro.vendor.build.fingerprint.

Those exceptions have been used since Android L. So we can't rename them
to support the system-only upgrade from old Android.

Bug: 36796459
Test: confirmed that ro.vendor.product.* were changed to
ro.product.vendor.* in vendor/build.prop

Change-Id: Ibc107b00264a2dc194261d1968b27a9b17b5d798
2017-10-26 09:25:33 +09:00
Ryan Campbell
63fc0e681d Create product sysprops on vendor partition.
Duplicate essential product sysprops for manufacturer, model, brand, name, and device
from system on vendor so that mixed builds (vendor.img + GSI system.img) have correct
product information in their CTS/VTS reports.

Test: make
Bug: 64458205
Merged-In: Ib63b37772be493b9e035d9b7e8c5e2cf66f2fa8c
Change-Id: Ib63b37772be493b9e035d9b7e8c5e2cf66f2fa8c
(cherry picked from commit aea0f92ff3)
2017-10-25 11:35:14 +09:00
Tao Bao
ff1b86ee73 Specify --max_timestamp when calling brillo_update_payload.
Bug: 36232423
Test: Create OTA packages (full, incremental and downgrade) with
      ota_from_target_files.py; check the parameters passed down to
      brillo_update_payload.
Change-Id: I3af397f05fe16f4a9f0eb73e8272bac6afdc002a
(cherry picked from commit ed08bc4a22)
2017-10-24 22:42:08 +00:00
Colin Cross
2377f23d44 Merge "Update references to build/core to build/make/core" am: 6db8597174 am: bce301801f am: 4ffa2e1ebc
am: 40be14c239

Change-Id: I126f1387ad66bace815d7a8bd3f46357cb39e7f2
2017-10-21 00:01:42 +00:00
Colin Cross
40be14c239 Merge "Update references to build/core to build/make/core" am: 6db8597174 am: bce301801f
am: 4ffa2e1ebc

Change-Id: I9ff0a8d8e2abd407935e691be324894a5da09f8c
2017-10-20 23:53:47 +00:00
Colin Cross
bce301801f Merge "Update references to build/core to build/make/core"
am: 6db8597174

Change-Id: I4be5bc1805d1900991966d24fda15f2705ee248d
2017-10-20 23:49:17 +00:00
Colin Cross
6db8597174 Merge "Update references to build/core to build/make/core" 2017-10-20 23:41:12 +00:00
Colin Cross
6cdc5d20f3 Update references to build/core to build/make/core
sed -i -e 's"\([^/]\)build/core"\1build/make/core"g' $(git grep -l build/core)

Test: m checkbuild
Change-Id: Idf3a2fed79aee5d2c07bd8e42f0c0660f253ddc2
2017-10-20 12:49:28 -07:00
Tao Bao
3ae25c97e0 Merge "releasetools: Work around the issue with mke2fs created images." am: d526e0c8e9 am: f55aae7211 am: c4cd4afaf8
am: 26801092a0

Change-Id: I62ca1d077ce1db55d89cfa220ac2f19e3e0201d8
2017-10-20 17:52:58 +00:00
Tao Bao
26801092a0 Merge "releasetools: Work around the issue with mke2fs created images." am: d526e0c8e9 am: f55aae7211
am: c4cd4afaf8

Change-Id: Iafb5a1a4f6d336fa6d6f190a8859d7d9e7e15438
2017-10-20 17:40:04 +00:00
Tao Bao
f55aae7211 Merge "releasetools: Work around the issue with mke2fs created images."
am: d526e0c8e9

Change-Id: I9d4d034ad3f2763ac3da6a22bf0bd0dc02eb98c3
2017-10-20 17:31:12 +00:00
Tao Bao
b937ead5d9 releasetools: Work around the issue with mke2fs created images.
When generating block based OTAs, we read files from the sparse image
directly with the help of block map file. However, the block map info
might not be accurate if the image is created with mke2fs. Because
mke2fs may skip allocating actual blocks if they contain all zeros.
ota_from_target_files.py consequently passes incomplete APK files to
imgdiff, which fails to generate patches.

This CL works around the issue by falling back from imgdiff to bsdiff on
failures. We should figure out a better way in b/68016761 to remove the
workaround, which would otherwise hide other issues in imgdiff.

Bug: 67824829
Bug: 68016761
Test: ota_from_target_files.py passes on previously failing TF zips.
Change-Id: Ib24c5b5f89812b97a0c87c6bf0dc147ae39bc92f
2017-10-19 16:56:22 -07:00
Tao Bao
7ed24aa7aa Merge "releasetools: Remove the workarounds for mkyaffs2image." am: d2a09ef2d1 am: 9c531a9bef am: c15e55f802
am: b5a8aa05e8

Change-Id: I1213410958d7e2f4f6c91f7029ff7d495b2e627a
2017-10-18 23:24:28 +00:00
Tao Bao
b5a8aa05e8 Merge "releasetools: Remove the workarounds for mkyaffs2image." am: d2a09ef2d1 am: 9c531a9bef
am: c15e55f802

Change-Id: I1b5d4df1f4cb9237ab8e7b66b4c68f8fb3d6b69d
2017-10-18 22:29:15 +00:00
Tao Bao
9c531a9bef Merge "releasetools: Remove the workarounds for mkyaffs2image."
am: d2a09ef2d1

Change-Id: I7f975b9d734f3bc9594758a365574a9ce009d19c
2017-10-18 22:04:12 +00:00
Tao Bao
300506e147 Merge "Build repeatable system images with mke2fs."
am: 404af2ca4b

Change-Id: I49a97fe49449b1e2466eb8cd612816c526da0bcb
2017-10-18 18:05:46 +00:00
Tao Bao
fa863c86b7 releasetools: Remove the workarounds for mkyaffs2image.
Test: `m dist` on Linux and macOS.
Test: Use an existing target_files.zip for bullhead. Remove IMAGES/*
      and rebuild the images with 'add_img_to_target_files.py -a'. It
      generates idential images as in the original TF.zip.
Change-Id: I803656bf2c924dce53f2271dcb967a94fff48440
2017-10-18 10:21:33 -07:00
Treehugger Robot
404af2ca4b Merge "Build repeatable system images with mke2fs." 2017-10-18 17:20:00 +00:00
Colin Cross
bb8322e08b Merge "Follow renames of conscrypt and bouncycastle to remove -host suffix" am: f4f94ab567 am: 94ddb28a26 am: 4d5c09aad9
am: ee0dcd825e

Change-Id: I607dbefe79590a5d580dcf7ff36a9171f9c38458
2017-10-18 14:55:53 +00:00
Colin Cross
ee0dcd825e Merge "Follow renames of conscrypt and bouncycastle to remove -host suffix" am: f4f94ab567 am: 94ddb28a26
am: 4d5c09aad9

Change-Id: I5124abc4f48bea0931a75a9eef2133411e809a7b
2017-10-18 11:57:46 +00:00
Colin Cross
94ddb28a26 Merge "Follow renames of conscrypt and bouncycastle to remove -host suffix"
am: f4f94ab567

Change-Id: I9c978fb748ec3ce15cc9ea238193606a4726ae8f
2017-10-18 10:51:53 +00:00
Treehugger Robot
f4f94ab567 Merge "Follow renames of conscrypt and bouncycastle to remove -host suffix" 2017-10-18 09:41:11 +00:00
Tom Cherry
671fcedf7b Merge "Allow ro. properties to have arbitrary lengths" am: 1d6e8e31d0 am: 47b3003e9b am: 646f3c2651
am: 70f86d2f96

Change-Id: I1a4af547ee4345f7aba12c8d8c302f8ef4ce70b9
2017-10-17 22:58:44 +00:00
Tom Cherry
70f86d2f96 Merge "Allow ro. properties to have arbitrary lengths" am: 1d6e8e31d0 am: 47b3003e9b
am: 646f3c2651

Change-Id: Ic1398ce6dee690b94e53e781296e8cbcddc4bfbf
2017-10-17 22:52:05 +00:00
Tom Cherry
47b3003e9b Merge "Allow ro. properties to have arbitrary lengths"
am: 1d6e8e31d0

Change-Id: I4a3872a59ba39289bf58741e19ca05b9b9c7bbee
2017-10-17 22:42:04 +00:00
Tom Cherry
1d6e8e31d0 Merge "Allow ro. properties to have arbitrary lengths" 2017-10-17 22:33:11 +00:00
Colin Cross
b34d45ad65 Follow renames of conscrypt and bouncycastle to remove -host suffix
Test: m checkbuild
Change-Id: I72bd7249cf6bdc4a2251f6877c776f439649da81
2017-10-17 15:27:52 -07:00
Tao Bao
d86e3114fc Build repeatable system images with mke2fs.
We have added support in mkuserimg_mke2fs.sh that allows specifying
filesystem UUID and hash seed UUID. This CL generates and passes the
UUIDs based on the image name and build fingerprint. This way we can
rebuild and get identical images.

Note that this only applies to images generated with `m dist` and with
signing tools (sign_target_files_apks.py and
add_img_to_target_files.py). Images under $OUT (built with `make`) are
not affected.

Bug: 64994964
Test: lunch marlin-userdebug; run `m dist` twice (after deleting the
      intermediate files under $OUT/obj/PACKAGING), and compare the
      generated images.
Change-Id: I41cf4e5869582bb930af2f35a8e9c79bff43b2a2
(cherry picked from commit 3aa21e6bb9)
2017-10-16 22:48:33 -07:00
Ryan Campbell
02871f24cf Merge "Create product sysprops on vendor partition." into oc-mr1-dev am: 5dbc0cab73
am: 4a57b1645e

Change-Id: Icd72104e98f0ad13f3c1bf15a57a02612d7c75f6
2017-10-17 02:15:41 +00:00
Ryan Campbell
4a57b1645e Merge "Create product sysprops on vendor partition." into oc-mr1-dev
am: 5dbc0cab73

Change-Id: I13705b6d8337720dcf5d89d1a019a01a805e1c6c
2017-10-17 01:42:58 +00:00
Bowgo Tsai
50b8e537a6 Merge "Adding Android verified boot 1.0 metadata into ENG builds" am: 5f958ccad5 am: 86c4f8ed54 am: 08a05cd9ae
am: 0e1ada16ce

Change-Id: I87610d125ec4238c7b62774a053ee65fd1838368
2017-10-15 04:14:28 +00:00
Bowgo Tsai
0e1ada16ce Merge "Adding Android verified boot 1.0 metadata into ENG builds" am: 5f958ccad5 am: 86c4f8ed54
am: 08a05cd9ae

Change-Id: Ie7471976439616452b0c830b19471be1748a750a
2017-10-15 03:26:24 +00:00
Bowgo Tsai
86c4f8ed54 Merge "Adding Android verified boot 1.0 metadata into ENG builds"
am: 5f958ccad5

Change-Id: I54405288a18db3940b0721d5638127e66b7cac3e
2017-10-15 02:48:17 +00:00
Ryan Campbell
aea0f92ff3 Create product sysprops on vendor partition.
Duplicate essential product sysprops for manufacturer, model, brand, name, and device
from system on vendor so that mixed builds (vendor.img + GSI system.img) have correct
product information in their CTS/VTS reports.

Test: make
Bug: 64458205
Change-Id: Ib63b37772be493b9e035d9b7e8c5e2cf66f2fa8c
2017-10-13 15:47:58 -07:00
Tom Cherry
47c4eb4680 Allow ro. properties to have arbitrary lengths
Bug: 23102347
Bug: 34954705
Test: provide a fingerprint >92 characters long and see that it
      successfully works

Change-Id: Ida9ffd5266acb3b432b208780804a08e8f7391b4
2017-10-12 09:21:48 -07:00
Bowgo Tsai
6ceeb1a8bf Adding Android verified boot 1.0 metadata into ENG builds
Adding verified boot metadata with a "disable magic". The resulting
metadata at the end of each image (e.g., system.img, vendor.img) will
be the same as triggering an "adb disable-verity" on an USERDEBUG image.

This can help simplify the code on fs_mgr, which won't have to check if
current image is an ENG build or not.

Bug: 63056044
Test: boot sailfish eng/userdebug builds
Change-Id: I95d23ac7b76c04d6d4483c9c4dc1de16bf0d9c3a
2017-10-12 10:08:44 +08:00
TreeHugger Robot
800b7a3b2f Merge "Specify --max_timestamp when calling brillo_update_payload." 2017-10-09 21:41:49 +00:00
Dan Willemsen
905b2e00f1 Ignore zip comments in dump-package-stats
Use -q to silence zip comments, which also silences the first line.

Bug: 67345114
Test: find vendor -name '*.apk' | xargs build/tools/dump-package-stats
Change-Id: Icb319c603de7c29644c58520213940179f67b7e4
2017-10-03 18:57:18 -07:00
Chih-Hung Hsieh
a0a1e3a2c8 Merge "Use -Werror in build/make" am: 2d1681c804 am: 7dba41687e am: 87b8c55312
am: cc60af86c4

Change-Id: I2cc6461d93d1389c719ad4395902281e10310aea
2017-10-03 23:08:29 +00:00
Dan Willemsen
8bbeef7c0c Merge "Ignore zip comments in dump-package-stats" am: 75cc5bf9ae am: c4c502e751 am: c624182c0c
am: 05a1495e41

Change-Id: Ia3bd9a4530c943823581c70689698f67689525ed
2017-10-03 23:07:14 +00:00
Chih-Hung Hsieh
cc60af86c4 Merge "Use -Werror in build/make" am: 2d1681c804 am: 7dba41687e
am: 87b8c55312

Change-Id: I12ebc5273e1e95bf5907390d5e6ca8894ac82c6f
2017-10-03 23:00:15 +00:00
Dan Willemsen
05a1495e41 Merge "Ignore zip comments in dump-package-stats" am: 75cc5bf9ae am: c4c502e751
am: c624182c0c

Change-Id: I252d77518c0b6ce0b1d4934255c99c66bba86e50
2017-10-03 22:51:56 +00:00
Chih-Hung Hsieh
7dba41687e Merge "Use -Werror in build/make"
am: 2d1681c804

Change-Id: If94e0a0210c7e47880729ad18b7a24e26be4d597
2017-10-03 22:47:22 +00:00
Dan Willemsen
c4c502e751 Merge "Ignore zip comments in dump-package-stats"
am: 75cc5bf9ae

Change-Id: If9f2fa10f24aa90234bd01bdd00177308d80aa9e
2017-10-03 22:40:09 +00:00
Treehugger Robot
2d1681c804 Merge "Use -Werror in build/make" 2017-10-03 22:38:24 +00:00
Tao Bao
ed08bc4a22 Specify --max_timestamp when calling brillo_update_payload.
Bug: 36232423
Test: Create OTA packages (full, incremental and downgrade) with
      ota_from_target_files.py; check the parameters passed down to
      brillo_update_payload.
Change-Id: I3af397f05fe16f4a9f0eb73e8272bac6afdc002a
2017-10-03 14:18:33 -07:00
Chih-Hung Hsieh
2a5bc9dfbf Use -Werror in build/make
* Remove unused local variables.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: Iced5bb903902f49d7cd5cf5f572906a512c75e18
2017-10-03 13:53:13 -07:00
Dan Willemsen
093075304b Ignore zip comments in dump-package-stats
Use -q to silence zip comments, which also silences the first line.

Bug: 67345114
Test: find vendor -name '*.apk' | xargs build/tools/dump-package-stats
Change-Id: Icb319c603de7c29644c58520213940179f67b7e4
2017-10-03 12:56:09 -07:00
Tao Bao
34d99c17f4 Merge "Use computed salt for AVB-signed images." am: 4655de40c1 am: 815b445c14
am: 431b213f70

Change-Id: I49f904aba86b1f97774bfdd482692cacf099245f
2017-09-29 19:58:56 +00:00
Tao Bao
815b445c14 Merge "Use computed salt for AVB-signed images."
am: 4655de40c1

Change-Id: Ifd379a8b90b09ea40f56d15e65c17545024d76dc
2017-09-29 19:53:46 +00:00
Tao Bao
2b6dfd6689 Use computed salt for AVB-signed images.
We want the generated images being identical for the same source files.
Currently the generated ext4 image (either from make_ext4fs or mke2fs)
is reproducible, but the AVB footer added by avbtool contain changes
because of the random salt being used.

This CL changes the avbtool invocation to specify "--salt <hexstring>"
(already supported by avbtool) to use reproducible salt that's computed
based on fingerprints (or thumbprints if applicable).

Bug: 67023482
Test: Regenerate images from the same source as follows:
  Use a target_files.zip from an AVB-enabled target.
    $ zip -d target_files.zip IMAGES/\*
    $ ./build/make/tools/releasetools/add_img_to_target_files.py \
          -v target_files.zip
  Repeat the above commands and compare the generated images.
Change-Id: Id9db17ae0132ca3a820b4be5a5ef06ca3fef71ed
(cherry picked from commit 8f05cca1d9)
2017-09-29 10:47:40 -07:00
Tao Bao
16cda2fbff Use computed salt for AVB-signed images.
We want the generated images being identical for the same source files.
Currently the generated ext4 image (either from make_ext4fs or mke2fs)
is reproducible, but the AVB footer added by avbtool contain changes
because of the random salt being used.

This CL changes the avbtool invocation to specify "--salt <hexstring>"
(already supported by avbtool) to use reproducible salt that's computed
based on fingerprints (or thumbprints if applicable).

Bug: 67023482
Test: Regenerate images from the same source as follows:
  Use a target_files.zip from an AVB-enabled target.
    $ zip -d target_files.zip IMAGES/\*
    $ ./build/make/tools/releasetools/add_img_to_target_files.py \
          -v target_files.zip
  Repeat the above commands and compare the generated images.
Change-Id: Id9db17ae0132ca3a820b4be5a5ef06ca3fef71ed
Merged-In: Id9db17ae0132ca3a820b4be5a5ef06ca3fef71ed
(cherry picked from commit 8f05cca1d9)
2017-09-29 10:44:57 -07:00
TreeHugger Robot
034d90e30c Merge "Use computed salt for AVB-signed images." 2017-09-29 16:29:36 +00:00
Tao Bao
8f05cca1d9 Use computed salt for AVB-signed images.
We want the generated images being identical for the same source files.
Currently the generated ext4 image (either from make_ext4fs or mke2fs)
is reproducible, but the AVB footer added by avbtool contain changes
because of the random salt being used.

This CL changes the avbtool invocation to specify "--salt <hexstring>"
(already supported by avbtool) to use reproducible salt that's computed
based on fingerprints (or thumbprints if applicable).

Bug: 67023482
Test: Regenerate images from the same source as follows:
  Use a target_files.zip from an AVB-enabled target.
    $ zip -d target_files.zip IMAGES/\*
    $ ./build/make/tools/releasetools/add_img_to_target_files.py \
          -v target_files.zip
  Repeat the above commands and compare the generated images.
Change-Id: Id9db17ae0132ca3a820b4be5a5ef06ca3fef71ed
2017-09-28 10:22:19 -07:00
Tao Bao
b14eaa572c Build repeatable system images with mke2fs.
am: 87153c64fc

Change-Id: Id4eb7ceadab99d544be38194a9f88ef40ce23f2d
2017-09-28 04:16:11 +00:00
Tao Bao
87153c64fc Build repeatable system images with mke2fs.
We have added support in mkuserimg_mke2fs.sh that allows specifying
filesystem UUID and hash seed UUID. This CL generates and passes the
UUIDs based on the image name and build fingerprint. This way we can
rebuild and get identical images.

Note that this only applies to images generated with `m dist` and with
signing tools (sign_target_files_apks.py and
add_img_to_target_files.py). Images under $OUT (built with `make`) are
not affected.

Bug: 64994964
Test: lunch marlin-userdebug; run `m dist` twice (after deleting the
      intermediate files under $OUT/obj/PACKAGING), and compare the
      generated images.
Change-Id: I41cf4e5869582bb930af2f35a8e9c79bff43b2a2
(cherry picked from commit 3aa21e6bb9)
2017-09-27 14:49:36 -07:00
Billy Lamberta
dac941106a Docs: Remove deprecated templates-sac/ for droiddoc.
Consolidated to use droiddoc templates in external/doclava/res/assets/

Test: make tradefed-docs
Bug: 36808726
Change-Id: Id410ce1599d6e98bc4882fa2ee256a8a0e8968d1
2017-09-27 13:43:05 -07:00
Dan Willemsen
2165aeb270 Merge "Add -lm to the default libs for Linux & Darwin" am: 5118763940 am: c8e3f1e0d8 am: 6997a8e62e
am: ca936b85b7

Change-Id: I9766f02d8d7d942ed4c3da8372aedaa9022e8c2c
2017-09-27 07:28:49 +00:00
Dan Willemsen
ca936b85b7 Merge "Add -lm to the default libs for Linux & Darwin" am: 5118763940 am: c8e3f1e0d8
am: 6997a8e62e

Change-Id: I26d6972103cf2db610546dce958c19529c5139ea
2017-09-27 07:22:47 +00:00
Dan Willemsen
c8e3f1e0d8 Merge "Add -lm to the default libs for Linux & Darwin"
am: 5118763940

Change-Id: I8685d42c742db41d186176346254833249cd0d59
2017-09-27 07:13:58 +00:00
Dan Willemsen
a3a06feeed Add -lm to the default libs for Linux & Darwin
libm is a default library for device builds, so default it for host
builds as well.

Also removes duplicate additions of -ldl, -lpthread, -lm and -lrt.

Test: m host
Change-Id: I6a07e12053090eb6997b79d4091c28ac9a9022de
2017-09-26 20:26:11 -07:00
TreeHugger Robot
06a83e4842 Merge "Build repeatable system images with mke2fs." 2017-09-27 01:10:29 +00:00
Tao Bao
3aa21e6bb9 Build repeatable system images with mke2fs.
We have added support in mkuserimg_mke2fs.sh that allows specifying
filesystem UUID and hash seed UUID. This CL generates and passes the
UUIDs based on the image name and build fingerprint. This way we can
rebuild and get identical images.

Note that this only applies to images generated with `m dist` and with
signing tools (sign_target_files_apks.py and
add_img_to_target_files.py). Images under $OUT (built with `make`) are
not affected.

Bug: 64994964
Test: lunch marlin-userdebug; run `m dist` twice (after deleting the
      intermediate files under $OUT/obj/PACKAGING), and compare the
      generated images.
Change-Id: I41cf4e5869582bb930af2f35a8e9c79bff43b2a2
2017-09-22 15:51:55 -07:00
Dan Willemsen
621eeeae55 Merge "Remove ijar" am: 1dcffadbc7 am: dee143988e
am: a3e8ffd536

Change-Id: I80497bc760a2e6571b4a837b02f5db9f42f932b7
2017-09-22 21:34:34 +00:00
Dan Willemsen
dee143988e Merge "Remove ijar"
am: 1dcffadbc7

Change-Id: I55b0892905cf67655661f5a15ef3574e9e27db97
2017-09-22 21:30:17 +00:00
Dan Willemsen
6f2284e4fe Remove ijar
It's no longer used.

Test: cs/
Change-Id: Ib24094e494d4caa390f83df28c179b6012691ebc
2017-09-21 16:08:51 -07:00
Tao Bao
38a54546ea Merge "Consider prebuilt vendor.img as having vendor partition." am: 8a7b0dee6b am: 4a5a1e15a1
am: e45026effa

Change-Id: I50ed26b5bc532d37ddc3d30a915c183974ad34fa
2017-09-14 01:07:05 +00:00
Tao Bao
f23bbf19d4 Consider prebuilt vendor.img as having vendor partition.
vendor.img could be built from the source - in which case we have
unpacked files under VENDOR/ - or dropped in as a prebuilt binary blob.
We should consider either of them as target having a vendor partition.
Because we need to add its AVB hashtree info into vbmeta.img if target
is using AVB. Otherwise libfs_mgr would refuse to mount this
"AVB-enabled" vendor.img.

For targets not using AVB, this change is no-op.

Bug: 65462819
Test: Having vendor.img as prebuilt, `make dist`. Check that the
      generated vbmeta.img contains the info from vendor.img.
Test: Build, flash and boot the above image.zip.
Change-Id: Iaeb30e2059cb33fb39f23e5ffd28f338d00ccbfc
Merged-In: Iaeb30e2059cb33fb39f23e5ffd28f338d00ccbfc
(cherry picked from commit b22afea0f0)
2017-09-14 00:42:56 +00:00
Tao Bao
4a5a1e15a1 Merge "Consider prebuilt vendor.img as having vendor partition."
am: 8a7b0dee6b

Change-Id: I24451a308365873432eafd3fdc30403a9514ef7e
2017-09-14 00:25:48 +00:00
Tao Bao
b22afea0f0 Consider prebuilt vendor.img as having vendor partition.
vendor.img could be built from the source - in which case we have
unpacked files under VENDOR/ - or dropped in as a prebuilt binary blob.
We should consider either of them as target having a vendor partition.
Because we need to add its AVB hashtree info into vbmeta.img if target
is using AVB. Otherwise libfs_mgr would refuse to mount this
"AVB-enabled" vendor.img.

For targets not using AVB, this change is no-op.

Bug: 65462819
Test: Having vendor.img as prebuilt, `make dist`. Check that the
      generated vbmeta.img contains the info from vendor.img.
Test: Build, flash and boot the above image.zip.
Change-Id: Iaeb30e2059cb33fb39f23e5ffd28f338d00ccbfc
2017-09-13 11:05:15 -07:00
Tianjie Xu
aca3ab70a9 Merge "Add a verbose option to RunCommand in build_image.py" am: ab61b6b895 am: b34a5ce36e
am: 4ddff24f8c

Change-Id: I1c7ce0e26193ad62c98a82fc0f695693da1fe1c2
2017-09-11 20:18:53 +00:00
Tianjie Xu
b34a5ce36e Merge "Add a verbose option to RunCommand in build_image.py"
am: ab61b6b895

Change-Id: I7ebc5a522a76134576ab3f7ed61e2f6916d179da
2017-09-11 20:04:00 +00:00
Tianjie Xu
ab61b6b895 Merge "Add a verbose option to RunCommand in build_image.py" 2017-09-11 19:22:38 +00:00
Dan Willemsen
912d2130d9 Merge "Convert to Android.bp" am: 65631cf079 am: 8c3849a15d
am: cf9b5e13b9

Change-Id: I2f3e47dddd688ded4409fd61917367a6e705aa6c
2017-09-09 22:50:18 +00:00
Dan Willemsen
8c3849a15d Merge "Convert to Android.bp"
am: 65631cf079

Change-Id: I22e6fecccd465e5f2a962168ee78c241ecb31aa2
2017-09-09 22:42:58 +00:00
Dan Willemsen
c0a0f2dc1f Convert to Android.bp
Test: m atree fs_config fs_config_generate_test fs_config-unit-tests fs_get_stats zipalign
Test: cd out/host/linux-x86/nativetest64/fs_config-unit-tests ./fs_config-unit-tests
Change-Id: I3c5403a7f1cf221715eb52a41c640af9afcee175
2017-09-09 13:47:34 -07:00
Baligh Uddin
1f3d727474 Merge "Fix the detection for compressed APKs." into oc-mr1-dev
am: 8712ac10a7

Change-Id: If14f8a180693cc1df7348c871720c69649a59daf
2017-09-09 13:24:42 +00:00
Tianjie Xu
149b7fbf08 Add a verbose option to RunCommand in build_image.py
Make the build log less verbose; also print the result for
AdjustPartitionSizeForVerity().

Bug: 65292710
Test: Run add_img_to_target_files with and without "-v" and check
the logs.

Change-Id: Icdc86197ce69db036658ea9e77cc4ebe1750463b
2017-09-09 03:42:31 +00:00
Tao Bao
0f99033b71 Fix the detection for compressed APKs.
We pack _all_ the APK certs info into META/apkcerts.txt at build time,
including the ones that are not installed for the target. When
detecting for compressed APKs, we should only count the ones that are
actually installed.

Bug: 65498015
Test: `check_target_files_signatures.py bullhead-target_files.zip`
Change-Id: I2f32d4667be0efbfd5f9365dde819f009572533d
2017-09-08 19:46:01 -07:00
Tao Bao
afee8f3036 Skip checking files that have less blocks in block map.
When creating ext4 images with mke2fs, it may skip allocating some
blocks if they contain all zeros. As a result, there could be less
blocks listed in the block map than the actual file length.

For example, for a file with a length of 112200-byte (27+ blocks),
the listed blocks in block.map could be '43665-43688' (24 blocks).
Because some all-zero blocks are not taking actual space.

The generated ext4 images are perfectly valid - kernel will figure out
that data block is not allocated and writes all zeros into user buffer.
However, we can't fully reconstruct a file from its block list in our
Python script. Ideally this can be avoided by mounting or parsing an
ext4 image directly, which is yet to be supported in our script.

This CL skips checking for such files to avoid failing
validate_target_files.py.

Bug: 65213616
Test: validate_target_files.py passes on targets with mke2fs generated
      images (e.g. marlin).
Change-Id: Id9cc59e345b9283844044ef94ceb5702f0ca0526
(cherry picked from commit b418c30e3a)
2017-09-08 11:22:59 -07:00
Chih-Hung Hsieh
32031f6aa4 Merge "Accept alternative email addresses." am: 0b14739e0f am: 6dfe4bc16a
am: 7f11838211

Change-Id: Iec10445efd2039a60650a9c1a4be41039ea95d96
2017-09-07 22:42:09 +00:00
Chih-Hung Hsieh
6dfe4bc16a Merge "Accept alternative email addresses."
am: 0b14739e0f

Change-Id: I32c6c40c84796601dbd7392c14175c3bda7aa920
2017-09-07 22:32:09 +00:00
Chih-Hung Hsieh
2b1efe63cf Accept alternative email addresses.
Some OWNERS files use secondary email addresses, so we only
check existence of _account_id and email attributes.

Test: run against existing OWNERS files
Change-Id: I6f0804a8a90b7a23783c3fe45686d4d973876ed1
2017-09-07 13:07:26 -07:00
Tao Bao
64e506778d Merge "Skip checking files that have less blocks in block map." am: aa599f3916 am: 6b8eeb0bf4
am: ff5c236e34

Change-Id: I5821975ebcbe1032f50cd966fe0800a184a0f9fc
2017-09-07 18:00:50 +00:00
Tao Bao
6b8eeb0bf4 Merge "Skip checking files that have less blocks in block map."
am: aa599f3916

Change-Id: I11ea419d275b5af8f0b095377fbdb19fee465c1d
2017-09-07 17:56:50 +00:00
Tao Bao
aa599f3916 Merge "Skip checking files that have less blocks in block map." 2017-09-07 17:50:51 +00:00
Tao Bao
28bec43b96 Merge "releasetools: Validate A/B OTA payload signatures." am: 631b3a031c am: d5ec31f8a9
am: 9e8416917a

Change-Id: I091a3a43e47b2cca5d4605ac41e6981951d29cd5
2017-09-06 21:15:46 +00:00
Tao Bao
d5ec31f8a9 Merge "releasetools: Validate A/B OTA payload signatures."
am: 631b3a031c

Change-Id: I3abd410e0709cd44b2e2b74471e3cc023dba7cd5
2017-09-06 20:48:14 +00:00
Tao Bao
b418c30e3a Skip checking files that have less blocks in block map.
When creating ext4 images with mke2fs, it may skip allocating some
blocks if they contain all zeros. As a result, there could be less
blocks listed in the block map than the actual file length.

For example, for a file with a length of 112200-byte (27+ blocks),
the listed blocks in block.map could be '43665-43688' (24 blocks).
Because some all-zero blocks are not taking actual space.

The generated ext4 images are perfectly valid - kernel will figure out
that data block is not allocated and writes all zeros into user buffer.
However, we can't fully reconstruct a file from its block list in our
Python script. Ideally this can be avoided by mounting or parsing an
ext4 image directly, which is yet to be supported in our script.

This CL skips checking for such files to avoid failing
validate_target_files.py.

Bug: 65213616
Test: validate_target_files.py passes on targets with mke2fs generated
      images (e.g. marlin).
Change-Id: Id9cc59e345b9283844044ef94ceb5702f0ca0526
2017-09-05 15:53:24 -07:00
Tao Bao
a198b1e964 releasetools: Validate A/B OTA payload signatures.
$ PYTHONPATH=$PYTHONPATH:system/update_engine/scripts \
    ./build/make/tools/releasetools/check_ota_package_signature.py \
    build/target/product/security/testkey.x509.pem \
    out/dist/aosp_marlin-ota-eng.zip

Package: out/dist/aosp_marlin-ota-eng.zip
Certificate: build/target/product/security/testkey.x509.pem
...
Whole package signature VERIFIED

Verifying A/B OTA payload signatures...
...
Payload signatures VERIFIED

Bug: 65261072
Test: Signed a package and its payload with the right keys; ran the
      command above.
Test: Signed the payload with a different key; ran the command above and
      observed the reported verification failure.
Change-Id: If626ecb327a9826cd0956eef94914c939068a7d1
2017-09-01 14:33:15 -07:00
Tao Bao
4650e91c90 Merge "Add compatibility metadata for Treble-enabled non-A/B OTA packages." am: 02b158d7a4 am: 7313d99f00
am: f34b216b2c

Change-Id: Ia1b46d2b341ffdea6faf4188874641b08389c158
2017-08-29 19:32:08 +00:00
Tao Bao
7313d99f00 Merge "Add compatibility metadata for Treble-enabled non-A/B OTA packages."
am: 02b158d7a4

Change-Id: I54e64fcd3fbff266f8082a4347432941a8c6e8fe
2017-08-29 19:20:08 +00:00
Tao Bao
bcd1d161e8 Add compatibility metadata for Treble-enabled non-A/B OTA packages.
Commit 21803d3574 only added compatibility
metadata for A/B OTA packages, because by that time we didn't use
'ro.treble.enabled' property to determine if a target was Treble-enabled.

This CL uses 'ro.treble.enabled' to guard the packing of compatibility
metadata for both of A/B and non-A/B OTA packages. It also switches to
checking the system/vendor fingerprints to determine if there's an
update to the partition (previously it was computing the SHA-1 of the
images, which may have unintentionally changed due to issues that give
non-repetitive builds).

Bug: 64339310
Test: Generate OTA packages (full and incremental) on Treble-enabled
      targets (sailfish, as well as a non-A/B angler target with
      Treble-enabled locally); check that the compatibility.zip entry
      exists.
Test: Generate OTA packages on Treble-unenabled non-A/B target (angler);
      check that the compatibility.zip entry doesn't exist.
Test: Generate OTA packages on Treble-unenabled A/B target; check that
      the compatibility.zip entry doesn't exist.

Change-Id: I2a1fcf612439d849ba8ccea217a0faf5d5ba8e14
2017-08-28 15:19:44 -07:00
Tao Bao
3a32028c41 Merge "Remove file_contexts.bin from non-A/B OTA package." am: 7a1ed9edef am: f7b5d5fbaa
am: 5009e0a560

Change-Id: I36757a414682f84bac6022c897d516b8f63e870c
2017-08-25 23:18:47 +00:00
Tao Bao
f7b5d5fbaa Merge "Remove file_contexts.bin from non-A/B OTA package."
am: 7a1ed9edef

Change-Id: I8e3a230473e442b5c4d42eb77f2f09457e6ddabd
2017-08-25 23:14:47 +00:00
Tao Bao
ac7b7db12c Remove file_contexts.bin from non-A/B OTA package.
This entry only exists in non-A/B full OTA path. However, this file has
never been loaded by recovery - recovery was only reading the one from
the recovery image (which also has been removed by a recent change in
[1]).

[1]: commit e35926e1aff2e6b9b54656bd59c8178e295a1b7e in
platform/bootable/recovery.

Bug: 63538434
Test: `m dist` on angler. file_contexts.bin is gone from full OTA
      package. Sideloading the generated full OTA on angler.
Change-Id: Iec2e2d36599fa1ed499516a3e74f06cd36ade494
2017-08-25 14:14:53 -07:00
Narayan Kamath
b5c7de2c6b Merge "releasetools: Add support for compressed APKs." into oc-mr1-dev
am: 1d2518a649

Change-Id: If80c340c6680362568ad30866686b3a60047fa14
2017-08-23 14:28:53 +00:00
Narayan Kamath
a07bf049b9 releasetools: Add support for compressed APKs.
Compressed APKs can be identified by a "compressed=<ext>" entry in
the apkcerts.txt file. When we encounter such an entry, we need to
decompress the file to a temporary location before we process its
certs. When we're signing, we should also recompress the package
after it's signed.

Bug: 64531948
Test: ./build/tools/releasetools/check_target_files_signatures.py
Test: ./build/tools/releasetools/sign_target_files_apks.py
Test: compared signed output before / after this change, verify that
      it's bitwise identical when no compressed APKs are present.

Change-Id: Id32e52f9c11023955330c113117daaf6b73bd8c2
2017-08-21 13:21:20 +01:00
Jeff Gaston
5b767956fd Merge "Remove the need to find Android.mk files via directory symlinks" am: 6ab53d7211 am: 03e7e81837
am: aed14c5515

Change-Id: I84c8258ebb89eff647cdd52663f812c5600145e1
2017-08-08 00:19:21 +00:00
Jeff Gaston
aed14c5515 Merge "Remove the need to find Android.mk files via directory symlinks" am: 6ab53d7211
am: 03e7e81837

Change-Id: Ib453be719ce27c3f354b1353e45939cee2102aea
2017-08-08 00:16:53 +00:00
Jeff Gaston
03e7e81837 Merge "Remove the need to find Android.mk files via directory symlinks"
am: 6ab53d7211

Change-Id: I0495d45001821d095531d5be7c049fc2836888f7
2017-08-08 00:14:51 +00:00
Jeff Gaston
5c1f3fd068 Remove the need to find Android.mk files via directory symlinks
Bug: 64397960
Test: m -j
Change-Id: I5b77dd654dfced63900913c447b5448b632158d7
2017-08-07 14:21:20 -07:00
Tao Bao
ccce786735 Merge "Look for non-existent files listed in avb_vbmeta_args." am: 5180c3b97b
am: d91be38c5e

Change-Id: Ib9f1508aeb75da3682f2f50341b2ac12a6926a13
2017-07-21 20:54:51 +00:00
Tao Bao
d91be38c5e Merge "Look for non-existent files listed in avb_vbmeta_args."
am: 5180c3b97b

Change-Id: I6a035f46f09f70f11c271693158392f98927aa0f
2017-07-21 20:52:24 +00:00
Tao Bao
9a5f419ecf Look for non-existent files listed in avb_vbmeta_args.
In BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS, if we have defined
"--include_descriptors_from_image" with an image file whose path points
to source tree, add_img_to_target_files.py or sign_target_files_apks.py
may fail to find the file. Because these scripts may run without a
source tree, by taking target_files.zip as the only input.

This CL scans additional locations in the input target_files.zip to find
those missing files in avb_vbmeta_args. As long as the files are included
in the target_files.zip, they get a second chance to be found.

Bug: 63910867
Test: As follows:
 1. Setup BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS with a local file path;
 2. Remove the local file;
 3. sign_target_files_apks.py fails without this CL;
 4. sign_target_files_apks.py works.
Change-Id: I3c58f80a5535db02b74cfe40d0c0beff72587cf8
(cherry picked from commit 1dc5d47653)
2017-07-21 11:57:00 -07:00
Tao Bao
7a0a560c15 Merge "Look for non-existent files listed in avb_vbmeta_args." into oc-dr1-dev
am: 9c77abd6f2

Change-Id: Id96d37fd4e4ca639d3ed15e8472f1f2b2953e1ff
2017-07-21 17:18:00 +00:00
Tao Bao
f691e0a869 Merge "Look for non-existent files listed in avb_vbmeta_args." into oc-dr1-dev
am: 9c77abd6f2

Change-Id: I86b3d6fa39a08014d97397322349dc1c389346d5
2017-07-21 17:18:00 +00:00
Tao Bao
1dc5d47653 Look for non-existent files listed in avb_vbmeta_args.
In BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS, if we have defined
"--include_descriptors_from_image" with an image file whose path points
to source tree, add_img_to_target_files.py or sign_target_files_apks.py
may fail to find the file. Because these scripts may run without a
source tree, by taking target_files.zip as the only input.

This CL scans additional locations in the input target_files.zip to find
those missing files in avb_vbmeta_args. As long as the files are included
in the target_files.zip, they get a second chance to be found.

Bug: 63910867
Test: As follows:
 1. Setup BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS with a local file path;
 2. Remove the local file;
 3. sign_target_files_apks.py fails without this CL;
 4. sign_target_files_apks.py works.
Change-Id: I3c58f80a5535db02b74cfe40d0c0beff72587cf8
2017-07-21 01:20:14 -07:00
Tianjie Xu
a4caab580c Merge "Generate brotli compressed {}.new.dat for full OTA" am: 1b28eca1a1 am: a07a04c737
am: 4b53a17756

Change-Id: If03919b9012f4a693e895b02a0c148eeb0a4da5e
2017-07-14 23:34:39 +00:00
Tianjie Xu
4b53a17756 Merge "Generate brotli compressed {}.new.dat for full OTA" am: 1b28eca1a1
am: a07a04c737

Change-Id: I5f2b92791a759def118c6aa70a3e0777a9e8da85
2017-07-14 23:30:32 +00:00
Tianjie Xu
a07a04c737 Merge "Generate brotli compressed {}.new.dat for full OTA"
am: 1b28eca1a1

Change-Id: I3474e8efb634513fbc4876e5c272cf56b3443e12
2017-07-14 23:27:21 +00:00
Tianjie Xu
1b28eca1a1 Merge "Generate brotli compressed {}.new.dat for full OTA" 2017-07-14 23:21:54 +00:00
Tianjie Xu
b0a29ad8c2 Generate brotli compressed {}.new.dat for full OTA
Brotli has a better compression ratio than deflation. So for non-AB
full OTA, we can compress the new.dat with brotli first and store it
in the zip package.
This increase the OTA generation time by ~5 minutes for a full OTA
(measured based on 2.0G system.new.dat)

Bug: 34220646
Test: Generate a full OTA for bullhead
Change-Id: I9c0550af8eafcfa68711f74290c8e2d05a96648f
2017-07-14 10:53:21 -07:00
Tao Bao
f7f27b9002 Merge "Add the missing 'import stat' line." into oc-dr1-dev
am: d43ab80c75

Change-Id: I5d2712c53e9284b96a80ca66cc2b8361e27d3176
2017-07-12 22:21:55 +00:00
Tao Bao
9fdd00f682 Add the missing 'import stat' line.
Accidentally broken by the cherry-pick in commit
f829b40c48 - the original CL in oc-dev
doesn't require the 'import stat' line.

Bug: 63629728
Test: `pylint --rcfile=pylintrc sign_target_files_apks.py`
Test: Successfully sign a build with sign_target_files_apks.py.
Change-Id: I94be613fb2219597148c4339ac33fc93d0cdae47
2017-07-12 12:01:43 -07:00
Tao Bao
55625564c6 Merge "Track the AVB property name change." am: c45161536f
am: fcc2cf6c1e

Change-Id: I9bbed4c45961f2d3fa775b8b977ae58bbaae33ff
2017-07-07 23:35:43 +00:00
Tao Bao
fcc2cf6c1e Merge "Track the AVB property name change."
am: c45161536f

Change-Id: If20f1f0880680b8da185d846a9e0f17139389b50
2017-07-07 23:33:41 +00:00
Tao Bao
48ae05ea77 Track the AVB property name change.
system_avb_hashtree_enable has been renamed to
avb_system_hashtree_enable in commit
3e599ead66. 'care_map.txt' is missing due
to the change.

Bug: 63142730
Test: `m dist` and check IMAGES/care_map.txt exists in target_files zip.
Change-Id: I60c269b41df844b50353d357bf67c20f15548642
(cherry picked from commit 3f72176da0)
2017-07-07 15:02:37 -07:00
Tao Bao
3f72176da0 Track the AVB property name change.
system_avb_hashtree_enable has been renamed to
avb_system_hashtree_enable in commit
3e599ead66. 'care_map.txt' is missing due
to the change.

Bug: 63142730
Test: `m dist` and check IMAGES/care_map.txt exists in target_files zip.
Change-Id: I60c269b41df844b50353d357bf67c20f15548642
2017-06-29 15:19:09 -07:00
Tao Bao
1612f02ff2 Merge "Allow packing custom radio images into target_files zip." am: 9ea6a8b817
am: ce10b6e2f3

Change-Id: I3b6f7ade42f58baa722e2ee3df81efac48a5b653
2017-06-29 03:19:02 +00:00
Tao Bao
ce10b6e2f3 Merge "Allow packing custom radio images into target_files zip."
am: 9ea6a8b817

Change-Id: Ifdcdfa2214e4fa75bb0c7a5df1cb1796814fa7bc
2017-06-29 03:16:17 +00:00
Tao Bao
9ea6a8b817 Merge "Allow packing custom radio images into target_files zip." 2017-06-28 22:03:19 +00:00
Tao Bao
118b3243f8 Merge "Support replacing AVB signing keys." am: 682849976d
am: b5363b2dbc

Change-Id: I8388e8c3c3bf801d7a9d50f111e91555b933a4d7
2017-06-28 19:44:54 +00:00
Tao Bao
b5363b2dbc Merge "Support replacing AVB signing keys."
am: 682849976d

Change-Id: Iedbd4ce27ffdfeb3d88406f75636221739427add
2017-06-28 19:41:25 +00:00
Tao Bao
c218a470fb Support replacing AVB signing keys.
sign_target_files_apks.py now supports signing targets using verified
boot 2.0 (aka AVB). It allows replacing AVB signing keys for both of
chained and non-chained partitions.

An example command line looks as follows.
 $ ./build/tools/releasetools/sign_target_files_apks.py \
     --avb_vbmeta_key external/avb/test/data/testkey_rsa2048.pem \
     --avb_vbmeta_algorithm SHA256_RSA2048 \
     --avb_vbmeta_extra_args \
         "--signing_helper_with_files ./signing-helper.sh" \
     --avb_system_key external/avb/test/data/testkey_rsa4096.pem \
     --avb_system_algorithm SHA256_RSA4096 \
     --avb_system_extra_args \
         "--signing_helper_with_files ./signing-helper.sh" \
     product-target_files.eng.zip signed-product-target_files.zip

To verify the signed images:
 $ unzip signed-product-target_files.zip IMAGES/\*
 $ avbtool verify_image --image IMAGES/vbmeta.img \
     --expected_chain_partition system:1:testkey_rsa4096_pub.pem \
     --key external/avb/test/data/testkey_rsa2048.pem

Bug: 38315721
Test: sign_target_files_apks.py on AVB-enabled target w/ and w/o chained
      partitions respectively. Check the signing command lines; validate
      the signed images with 'avbtool verify_image'.
Change-Id: Ia009555b16ddb6d8ba6a0858d5ca7d983bbab887
(cherry picked from commit 639118ff4d)
2017-06-28 12:38:32 -07:00
Tao Bao
7b8a7936dd Merge "Delay the write-back of misc_info in sign_target_files_apks.py." into oc-dr1-dev 2017-06-28 19:36:51 +00:00
Tao Bao
57ae9a2234 Delay the write-back of misc_info in sign_target_files_apks.py.
Currently we're writing META/misc_info.txt to the new TF.zip during
ReplaceVerityPrivateKey(). We should delay that until we have replaced
everything in need. Otherwise we won't be able to replace/overwrite
that zip entry (unless `zip -d` first).

This CL also cleans up the return value of ReplaceVerityPublicKey() and
ReplaceVerityKeyId(), since the caller no longer needs the values.

Test: sign_target_files_apks.py and check the generated signed TF.zip.
Change-Id: I9fbd7182247728281519e5e3971557f6b018ad65
(cherry picked from commit 46a5999a02)
2017-06-28 11:07:34 -07:00
TreeHugger Robot
3b7460eda9 Merge "Move /default.prop to /system/etc/prop.default" into oc-dr1-dev 2017-06-28 06:28:10 +00:00
Tao Bao
95a95c3a5e Allow packing custom radio images into target_files zip.
Radio images are added to INSTALLED_RADIOIMAGE_TARGET, which by default
will be packed under RADIO/ in a target_files zip. This CL introduces
BOARD_PACK_RADIOIMAGES that allows additionally copying them into
IMAGES/, which will then be included into <product>-img.zip.

Bug: 62195105
Test: Define BOARD_PACK_RADIOIMAGES and `m dist`. Check the generated
      target_files zip and <product>-img.zip.
Change-Id: I3deafd2dfecd1d4dbfdfc2d002fc40ef22fb60ea
2017-06-27 13:50:12 -07:00
Tao Bao
639118ff4d Support replacing AVB signing keys.
sign_target_files_apks.py now supports signing targets using verified
boot 2.0 (aka AVB). It allows replacing AVB signing keys for both of
chained and non-chained partitions.

An example command line looks as follows.
 $ ./build/tools/releasetools/sign_target_files_apks.py \
     --avb_vbmeta_key external/avb/test/data/testkey_rsa2048.pem \
     --avb_vbmeta_algorithm SHA256_RSA2048 \
     --avb_vbmeta_extra_args \
         "--signing_helper_with_files ./signing-helper.sh" \
     --avb_system_key external/avb/test/data/testkey_rsa4096.pem \
     --avb_system_algorithm SHA256_RSA4096 \
     --avb_system_extra_args \
         "--signing_helper_with_files ./signing-helper.sh" \
     product-target_files.eng.zip signed-product-target_files.zip

To verify the signed images:
 $ unzip signed-product-target_files.zip IMAGES/\*
 $ avbtool verify_image --image IMAGES/vbmeta.img \
     --expected_chain_partition system:1:testkey_rsa4096_pub.pem \
     --key external/avb/test/data/testkey_rsa2048.pem

Bug: 38315721
Test: sign_target_files_apks.py on AVB-enabled target w/ and w/o chained
      partitions respectively. Check the signing command lines; validate
      the signed images with 'avbtool verify_image'.
Change-Id: Ia009555b16ddb6d8ba6a0858d5ca7d983bbab887
2017-06-27 10:50:46 -07:00
Hung-ying Tyan
7eb6a926ad Move /default.prop to /system/etc/prop.default
This patch tries to fix the problem where the default properties need
to go with the system image especially on non-AB devices where
/default.prop is on the ramdisk image. A symlink is created at
/default.prop for backward compatibility.

Bug: 37815285
Test: Tested with ag/2416542. Booted pixel phones, checked the location
      of prop.default, verified the symlink, checked a few properties
      (via adb shell getprop) and manually tested a few apps (Camera,
      Maps etc).
      sign_target_files_apks.py was tested with:
      sign_target_files_apks -o -e DynamiteLoader.apk= -e DynamiteModulesA.apk= \
          -e DynamiteModulesB.apk= -e DynamiteModulesC.apk= -e DynamiteModulesD.apk= \
          -e GoogleCertificates.apk= out/dist/*-target_files-*.zip signed-target_files.zip
      Booted to recovery and ran 'adb sideload' successfully.
Change-Id: I1a9a2ba49c8252afc13ced3dea71253afbd3091e
Merged-In: I1a9a2ba49c8252afc13ced3dea71253afbd3091e
(cherry-picked from 4fbbe4578bb10d54292d9b243edf4999fddf1c93)
2017-06-27 15:10:32 +08:00
Hung-ying Tyan
f829b40c48 Move /default.prop to /system/etc/prop.default
This patch tries to fix the problem where the default properties need
to go with the system image especially on non-AB devices where
/default.prop is on the ramdisk image. A symlink is created at
/default.prop for backward compatibility.

Bug: 37815285
Test: Tested with ag/2416542. Booted pixel phones, checked the location
      of prop.default, verified the symlink, checked a few properties
      (via adb shell getprop) and manually tested a few apps (Camera,
      Maps etc).
      sign_target_files_apks.py was tested with:
      sign_target_files_apks -o -e DynamiteLoader.apk= -e DynamiteModulesA.apk= \
          -e DynamiteModulesB.apk= -e DynamiteModulesC.apk= -e DynamiteModulesD.apk= \
          -e GoogleCertificates.apk= out/dist/*-target_files-*.zip signed-target_files.zip
      Booted to recovery and ran 'adb sideload' successfully.
Change-Id: I1a9a2ba49c8252afc13ced3dea71253afbd3091e
2017-06-27 15:05:17 +08:00
Tianjie Xu
35f6f99056 Merge "Remove the obsolete location check for install-recovery.sh" am: 8fb65a5d63
am: ea5dad9010

Change-Id: I26e314431a87732a486566d2702106d28d323d92
2017-06-22 18:27:49 +00:00
Tianjie Xu
e0bda97ea1 Merge "Verify the contents in install-recovery.sh" am: 924c1c0598
am: 01c463e406

Change-Id: Ie8177614c855e3f554184d570b2f98b29aefc8c6
2017-06-22 18:27:39 +00:00
Tianjie Xu
8fb65a5d63 Merge "Remove the obsolete location check for install-recovery.sh" 2017-06-22 18:12:44 +00:00
Tianjie Xu
924c1c0598 Merge "Verify the contents in install-recovery.sh" 2017-06-22 18:12:44 +00:00
Chih-hung Hsieh
877a7a43d2 Merge "Add OWNERS in build/make" am: d79ce64555
am: 9af11fce7a

Change-Id: I44e3689a9280de474055ec4f109278ef2ff7d8cf
2017-06-22 04:34:38 +00:00
Chih-hung Hsieh
d79ce64555 Merge "Add OWNERS in build/make" 2017-06-22 04:27:13 +00:00
Chih-Hung Hsieh
044fc0c4a4 Add OWNERS in build/make
* Owners are selected from top CL approvals or owners.
  They will be suggested to review/approve future CLs.
* OWNERS files are recognized by the new find-owners plugin, see .md files in
  https://gerrit.googlesource.com/plugins/find-owners/+/master/src/main/resources/Documentation/

Test: build/make/tools/checkowners.py -c -v OWNERS
Change-Id: Ibe6765e5448c471ca413413e3d052507ccee4ea6
2017-06-21 16:09:56 -07:00
Bowgo Tsai
f636a80888 AVB: support chain partition signing
Current build system will include AVB metadata from each partition and
store them into /vbmeta partiton when BOARD_AVB_ENABLE is set, which makes
each partition tightly-coupled.

Add the support for 'chain partition':
  - The vbmeta of each partition is stored on the same partition itself.
  - The public key used to verify each partition is stored in /vbmeta.

For example, the following build variables are required to enable chain
partition for system partition:
  - BOARD_AVB_SYSTEM_KEY_PATH := path/to/system_private_key
  - BOARD_AVB_SYSTEM_ALGORITHM := SHA512_RSA8192
  - BOARD_AVB_SYSTEM_ROLLBACK_INDEX := 1
  - BOARD_AVB_SYSTEM_ROLLBACK_INDEX_LOCATION := 2

The corresponding settings will be added into META/misc_info.txt for
build_image.py and/or add_img_to_target_files.py:
  - avb_system_key_path=path/to/system_private_key
  - avb_system_algorithm=SHA512_RSA8192
  - avb_system_add_hashtree_footer_args=--rollback_index 1
  - avb_system_rollback_index_location=2

To enable chain partition for other partitions, just replace SYSTEM with
BOOT, VENDOR and/or DTBO in the build variables.

Also switch from  `avbtool make_vbmeta_image --setup_rootfs_from_kernel system.img ...`
to `avbtool add_hashtree_footer --image system.img --setup_as_rootfs_from_kernel...`
when BOARD_BUILD_SYSTEM_ROOT_IMAGE is true. This works for both chained
and no-chained:
  - chained: `avbtool add_hashtree_footer --setup_as_rootfs_from_kernel` will
    add dm-verity kernel cmdline descriptor to system.img
  - no-chained: `avbtool make_vbmeta_image --include_descriptors_from_image
    system.img` will include the kernel cmdline descriptor from system.img into
    vbmeta.img

Bug: 38399657
Test: `make` pass, flash images from $OUT and boot device without chain partitions
Test: `make` pass, flash images from $OUT and boot device with chain partitions
Test: `make dist` pass, flash images from TF.zip and boot device without chain partitions
Test: `make dist` pass, flash images from TF.zip and boot device with chain partitions
Test: follow the same steps in
      https://android-review.googlesource.com/#/c/407572/

Change-Id: I344f79290743d7d47b5e7441b3a21df812a69099
Merged-In: I344f79290743d7d47b5e7441b3a21df812a69099
(cherry picked from commit 3e599ead66)
2017-06-21 10:22:38 +08:00
Tianjie Xu
9c384d2ca5 Verify the contents in install-recovery.sh
Check the SHA1 of recovery.img and boot.img embedded in the
install-recovery.sh.

Bug: 35411009
Test: validation script detects mismatch for both full recovery and
recovery-from-boot.
Change-Id: I5f07a869d9fa17fad26a22ef9ca3ecb06b1b28e3
2017-06-20 17:28:35 -07:00
Tianjie Xu
78de9f173d Remove the obsolete location check for install-recovery.sh
The script has been moved to /system/bin since L.

Bug: 35411009
Test: Generate a exact same OTA for bullhead.
Change-Id: Iaecb86e3dabc5b659605837bb06f16d20fa80334
2017-06-20 16:52:54 -07:00
Bowgo Tsai
abbba2c832 Merge "AVB: support chain partition signing" am: 0effed4b94
am: dcad0945ab

Change-Id: I5bc9f2dcc94b2db846d9956c0def6b3c9910b2c5
2017-06-20 07:07:33 +00:00
Treehugger Robot
0effed4b94 Merge "AVB: support chain partition signing" 2017-06-20 06:57:34 +00:00
Tao Bao
5edb6ee6fd Merge "Allow sign_target_files_apks.py to create zip64 signed TF.zip." am: 9baf675285
am: 7d5f8ec704

Change-Id: I23d08c4a7b3311afafa857e4efb5a982f8cf0f25
2017-06-14 05:49:58 +00:00
Treehugger Robot
9baf675285 Merge "Allow sign_target_files_apks.py to create zip64 signed TF.zip." 2017-06-14 05:36:51 +00:00
Tianjie Xu
f5fd565275 Merge "Fix duplicate 'META/care_map.txt' when calling add_img_to_target_files" am: 463c25f890
am: fa0542dced

Change-Id: Ia1d5b0b478f700b4df8ebbf9db10d4035d394792
2017-06-14 00:34:06 +00:00
Tao Bao
2b8f489e30 Allow sign_target_files_apks.py to create zip64 signed TF.zip.
We should only disallow zip64 for the image and OTA zips (because we
don't have zip64 support in libziparchive yet). But target_files zips
are fine to use zip64 with host tools (and we already do that in
add_img_to_target_files.py).

This CL also sets the default compression method to DEFLATED when
creating the signed TF.zip.

Test: sign_target_files.apks.py signing a large TF.zip passes.
Change-Id: I8043739860604134fa1166e920c95c28797bbcc1
2017-06-13 13:01:23 -07:00
Tianjie Xu
9ac4cb0984 Fix duplicate 'META/care_map.txt' when calling add_img_to_target_files
In case the system/vendor image is updated for an A/B target file, we'll
delay the write of META/care_map.txt. Specifically, we'll run "zip -d"
to remove the old entry and then zip in the new one from tmp dir.

Bug: 62345693
Test: Run add_img_to_target_files.py on sailfish target files, and
care_map.txt is updated.

Change-Id: Id2f9997aac50c0740e6944d0d0d43d98f5fc6c29
2017-06-13 11:20:29 -07:00
Bowgo Tsai
3e599ead66 AVB: support chain partition signing
Current build system will include AVB metadata from each partition and
store them into /vbmeta partiton when BOARD_AVB_ENABLE is set, which makes
each partition tightly-coupled.

Add the support for 'chain partition':
  - The vbmeta of each partition is stored on the same partition itself.
  - The public key used to verify each partition is stored in /vbmeta.

For example, the following build variables are required to enable chain
partition for system partition:
  - BOARD_AVB_SYSTEM_KEY_PATH := path/to/system_private_key
  - BOARD_AVB_SYSTEM_ALGORITHM := SHA512_RSA8192
  - BOARD_AVB_SYSTEM_ROLLBACK_INDEX := 1
  - BOARD_AVB_SYSTEM_ROLLBACK_INDEX_LOCATION := 2

The corresponding settings will be added into META/misc_info.txt for
build_image.py and/or add_img_to_target_files.py:
  - avb_system_key_path=path/to/system_private_key
  - avb_system_algorithm=SHA512_RSA8192
  - avb_system_add_hashtree_footer_args=--rollback_index 1
  - avb_system_rollback_index_location=2

To enable chain partition for other partitions, just replace SYSTEM with
BOOT, VENDOR and/or DTBO in the build variables.

Also switch from  `avbtool make_vbmeta_image --setup_rootfs_from_kernel system.img ...`
to `avbtool add_hashtree_footer --image system.img --setup_as_rootfs_from_kernel...`
when BOARD_BUILD_SYSTEM_ROOT_IMAGE is true. This works for both chained
and no-chained:
  - chained: `avbtool add_hashtree_footer --setup_as_rootfs_from_kernel` will
    add dm-verity kernel cmdline descriptor to system.img
  - no-chained: `avbtool make_vbmeta_image --include_descriptors_from_image
    system.img` will include the kernel cmdline descriptor from system.img into
    vbmeta.img

Bug: 38399657
Test: `make` pass, flash images from $OUT and boot device without chain partitions
Test: `make` pass, flash images from $OUT and boot device with chain partitions
Test: `make dist` pass, flash images from TF.zip and boot device without chain partitions
Test: `make dist` pass, flash images from TF.zip and boot device with chain partitions
Test: follow the same steps in
      https://android-review.googlesource.com/#/c/407572/

Change-Id: I344f79290743d7d47b5e7441b3a21df812a69099
2017-06-13 17:45:10 +08:00
Tao Bao
ddb9391d6b Merge "Delay the write-back of misc_info in sign_target_files_apks.py." am: d6e8002734
am: 6da0f9c8fd

Change-Id: Ifbaea16ab19a30c74132319b199cc2f41c3a3bff
2017-06-08 22:34:22 +00:00
Treehugger Robot
d6e8002734 Merge "Delay the write-back of misc_info in sign_target_files_apks.py." 2017-06-08 22:24:53 +00:00
Chih-Hung Hsieh
30e550cfb7 Merge "Find target keywords in the first 100 lines." am: 61ddffc6af
am: 4bf15225d4

Change-Id: I8375de1b5359e4bcbb028f0e158bc20545fbf8fe
2017-06-08 01:50:50 +00:00
Chih-Hung Hsieh
655c542dc8 Find target keywords in the first 100 lines.
Bug: 62416199
Test: warn.py build.log
Change-Id: I8c5ef310758fdd44519aeb1efe2f0bd92fe1ac87
2017-06-07 23:17:13 +00:00
Tao Bao
46a5999a02 Delay the write-back of misc_info in sign_target_files_apks.py.
Currently we're writing META/misc_info.txt to the new TF.zip during
ReplaceVerityPrivateKey(). We should delay that until we have replaced
everything in need. Otherwise we won't be able to replace/overwrite
that zip entry (unless `zip -d` first).

This CL also cleans up the return value of ReplaceVerityPublicKey() and
ReplaceVerityKeyId(), since the caller no longer needs the values.

Test: sign_target_files_apks.py and check the generated signed TF.zip.
Change-Id: I9fbd7182247728281519e5e3971557f6b018ad65
2017-06-07 15:13:50 -07:00
Tao Bao
1629a7e663 Merge "Fix the broken script in AssertFingerprintOrThumbprint." am: 9718140570 am: d791faf34e
am: ee8a023c4e

Change-Id: I66067ffc253be23c11ff30a2805677f23105b40e
2017-06-05 22:52:15 +00:00
Treehugger Robot
9718140570 Merge "Fix the broken script in AssertFingerprintOrThumbprint." 2017-06-05 22:33:05 +00:00
Tao Bao
f6737d7506 Merge "Remove three board_avb_* args from META/misc_info.txt." am: 401b1d2509 am: 6466063839
am: 26912a3a57

Change-Id: Ief85e4efe05855b4486ed7e2f8bac22302ddd6a9
2017-06-05 20:24:06 +00:00
Tao Bao
d2d01e519e Fix the broken script in AssertFingerprintOrThumbprint.
Bug: 62252466
Test: Re-generate an incremental OTA that goes from the fingerprint to
      thumbprint, and check the updater-script.
Change-Id: I6e2cbf68cbd22fbcf0d200fc3fdc8a33da510a53
2017-06-05 12:27:52 -07:00
Tao Bao
3ebfddeabe Remove three board_avb_* args from META/misc_info.txt.
board_avb_algorithm and board_avb_key_path are overlapping with
avb_signing_args. In core/Makefile, only avb_signing_args (i.e.
INTERNAL_AVB_SIGNING_ARGS) will be used in the AVB-signing command. It
covers the contents in board_avb_{algorithm,key_path}. We should do the
same thing in tools/releasetools to avoid potential inconsistency.

This CL cleans up the logic in tools/releasetools, by always using
avb_signing_args. This also allows easier signing key replacement (so we
can replace the key/algorithm/signer in 'avb_signing_args').

board_avb_system_add_hashtree_footer_args is unused in releasetools
script, and the same information has been covered by
system_avb_add_hashtree_footer_args. This CL removes this arg as well.

Test: `m dist`. Then a) check the removed three args no longer exist in
      META/misc_info.txt; b) check that rebuilding images with
      add_img_to_target_files.py uses the same parameters.
Change-Id: I7db890b5c942de5b6868d8d1ebf937586d4729c0
2017-06-05 10:33:52 -07:00
Tao Bao
891c29766e Merge "Support re-generating DTBO image from add_img_to_target_files.py." am: 4536e45f66 am: b88e3f20a6
am: cdabed4ee8

Change-Id: Ic890baa277142baf355c1196afd7705c117761a3
2017-06-02 22:39:44 +00:00
Tao Bao
4536e45f66 Merge "Support re-generating DTBO image from add_img_to_target_files.py." 2017-06-02 22:13:36 +00:00
Tianjie Xu
9989175c0e Merge "Generate care_map.txt when AVB is enabled" am: 65b98cd3b1 am: 1e0b14eb33
am: 72274464c4

Change-Id: I7549c4f1b66ee1bf8dfaab26e90a2022f9f19dea
2017-06-02 18:24:35 +00:00
Tianjie Xu
65b98cd3b1 Merge "Generate care_map.txt when AVB is enabled" 2017-06-02 18:09:58 +00:00
Tianjie Xu
6b2e155ee6 Generate care_map.txt when AVB is enabled
When AVB is enabled, generate care_map.txt and add it to the target
files. Also copy it into the OTA package where it will later be used
by the update_verifier.

Bug: 62208947
Test: \
1. Run add_img_to_target_files on the TF of a new pixel device,
and care_map.txt generates successfully.

2. Make dist in oc-dr1-release and find care_map.txt in the OTA package.

3. update_verifier succeeds in reading all the blocks on the care_map,
and fails to read out-of-bound blocks.

Change-Id: I2881711e6f87789cb7de150dbeca18b756fed68a
2017-06-01 21:36:43 -07:00
Tao Bao
c633ed0230 Support re-generating DTBO image from add_img_to_target_files.py.
This is a step to enable signing a given target_files zip with release
keys.

When calling sign_target_files_apks.py, we will delete all the entries
under IMAGES/ in order to re-generate them (with the proper release
keys). In order to support that, we need to pack everything in need into
TF.zip.

Steps to test the CL.
a) Choose a target that has both AVB and DTBO enabled.
 $ m dist

b) Check IMAGES/dtbo.img and PREBUILT_IMAGES/dtbo.img both exist in the
   generated out/dist/TF.zip.

c) Remove the entries under IMAGES/ from the generated TF.zip.
 $ zip -d TF.zip IMAGES/\*

d) Re-generate the images with TF.zip.
 $ build/make/tools/releasetools/add_img_to_target_files.py TF.zip

e) Check that IMAGES/dtbo.img is re-generated, and it's identical to the
   image in b). Note that by default the re-generated image will carry a
   different footer, because of the random salt. This CL is verified by
   specifying the same salt.

Bug: 38315721
Test: see above.
Change-Id: I0bdc4e1cd4800962dc3902ca550dad6a8ca56c78
2017-06-01 20:07:33 -07:00
Tao Bao
ffa864c5ed Merge "Pack avbtool into otatools.zip." am: db5fa05429 am: 308b234593
am: 0c2bc7a7b1

Change-Id: I1f15f62536e3030bee7fec0fdacb1ef8ee57a69e
2017-06-01 07:30:30 +00:00
Treehugger Robot
db5fa05429 Merge "Pack avbtool into otatools.zip." 2017-06-01 07:19:17 +00:00
Tao Bao
30295a396f Merge "Remove the obsolete logic in img_from_target_files.py." am: ba029141dc am: f37c956b6d
am: 464fed4f53

Change-Id: If990a48a06ba4b48e865e4098d58fed4a074d896
2017-05-31 23:30:59 +00:00
Tao Bao
2bb109709a Remove the obsolete logic in img_from_target_files.py.
img_from_target_files.py used to handle the case that a given TF.zip not
containing the image entries under IMAGES/. That is only the case for
pre-Lollipop releases.

Also unzip the needed files only since we know that for sure now.

Test: img_from_target_files.py with an existing bullhead-TF.zip gives
      the same bullhead-img.zip.
Change-Id: I892379ba388df80ae63be9d3ce647fbb77fd4753
2017-05-31 11:17:56 -07:00
Tao Bao
3cba374da2 Pack avbtool into otatools.zip.
Also pack the test keys for easier testing.

Bug: 38315721
Test: m otatools-package and avbtool is present in otatools.zip.
Change-Id: Ieb63bf3f4bc211ef1f48ab278cb01b70845d06da
2017-05-31 10:20:25 -07:00
Bowgo Tsai
b4c268eb7b Merge "Support signing custom images with AVB HASH or AVB HASHTREE" am: fe7aeb1de7 am: 16b64cbb58
am: 3989b738b8

Change-Id: I11393e1833db97301ffdd31ec3db0968e87c1a24
2017-05-31 03:38:24 +00:00
Treehugger Robot
fe7aeb1de7 Merge "Support signing custom images with AVB HASH or AVB HASHTREE" 2017-05-31 03:24:25 +00:00
Tianjie Xu
9307492d4e Merge "Remove the obsolete UnpackPackageDir() in edify generator" am: f7a76f9a30 am: cb2490c645
am: 932a9c8a61

Change-Id: I616920f452b7fda545d87dd285474f9f0acd5b14
2017-05-31 01:25:19 +00:00
Tianjie Xu
f7a76f9a30 Merge "Remove the obsolete UnpackPackageDir() in edify generator" 2017-05-31 01:08:15 +00:00
Tianjie Xu
3a97af0ca4 Merge "Move recovery building from sign_target_files_apk to add_img_to_target_files" am: 0996f815db am: d50b6e4cae
am: 38800822ef

Change-Id: Ib2a237c601142fa168f0f73f6c12fd28c3ac4b79
2017-05-30 21:02:27 +00:00
Tianjie Xu
0ba01a614a Merge "Update the recovery files under SYSTEM/ if recovery patch is rebuilt" am: ada0854169 am: 9080b10f3a
am: d153e86abd

Change-Id: Ic7e6731d8a5da15353c793acd33b6106e11382b2
2017-05-27 00:27:44 +00:00
Tianjie Xu
616fbeb144 Move recovery building from sign_target_files_apk to add_img_to_target_files
Currently we're building the boot/recovery image twice, which is
redundant. And b/38455129 shows a problematic case when the image
from two builds doesn't match. We should only build the recovery
image once in the add_img_to_target_files.

Bug: 62021378
Test: call sign_target_files_apk on an angler target file,
recovery-from-boot.p generates successfully; and SHA of recovery.img
matches the one in install-recovery.sh.

Change-Id: I01e033501d80c18a87cbb870300eee5c19a04441
2017-05-26 17:20:22 -07:00
Tianjie Xu
38af07ff20 Update the recovery files under SYSTEM/ if recovery patch is rebuilt
If we pass "rebuild_recovery" to add_img_to_target_files, the recovery
patch is rebuilt. But related files under SYSTEM/ (e.g.
SYSTEM/recovery-from-boot.p && SYSTEM/bin/install-recovery.sh) are not
updated.

This may cause a mismatch between system.img and SYSTEM/, and
may lead to a failure in validate_target_files.py.

Bug: 62096364
Test: Rebuild the system image in the TF and observe the recovery files
under SYSTEM/ get updated.

Change-Id: I7d679a612a86d02cf2eff81d1d120c0067138ed9
2017-05-26 22:40:23 +00:00
Bowgo Tsai
7ea994b21c Support signing custom images with AVB HASH or AVB HASHTREE
`make custom_images` supports to build different kinds of *non-droid* images,
e.g., odm.img. Adding the support of signing them with either AVB HASH footer
or AVB HASHTREE footer. The user can use HASH for small images and
HASHTREE for large images.

Sample signing configurations:
 * AVB HASH footer:
   - CUSTOM_IMAGE_AVB_HASH_ENABLE := true
   - CUSTOM_IMAGE_AVB_ADD_HASH_FOOTER_ARGS := --append_to_release_string my_odm_image

 * AVB HASHTREE footer:
   - CUSTOM_IMAGE_AVB_HASHTREE_ENABLE := true
   - CUSTOM_IMAGE_AVB_ADD_HASHTREE_FOOTER_ARGS := --fec_num_roots 8

 * Using custom signing key:
   - CUSTOM_IMAGE_AVB_ALGORITHM := SHA256_RSA2048
   - CUSTOM_IMAGE_AVB_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem

Bug: 36701014
Test: `make custom_images` with AVB HASH footer
Test: `make custom_images` with AVB HASHTREE footer
Test: `make droid` to check system.img is still properly signed with AVB HASHTREE
Test: `make droid` to check vendor.img is still properly signed with AVB HASHTREE

Change-Id: I8dc420e12e37e9a631345c0cd883339db05d489f
2017-05-24 14:21:03 +08:00
Tianjie Xu
6a324ba588 Remove the obsolete UnpackPackageDir() in edify generator
package_extract_dir is used in file based OTA only and should be killed.

Bug: 37959785
Test: code search shows no usage of this function in aosp.
Change-Id: Id3719b969c24b7ecef0c7f0e4a3af09a72be54d4
2017-05-23 17:15:14 -07:00
Tao Bao
4a0d1f2ece Fix the symlink detection when signing TF.zip.
am: 3eb353cdb0

Change-Id: I00c256d5eacab5e60c1292f9572eaaaee5a1c11e
2017-05-23 20:25:57 +00:00
Tao Bao
3eb353cdb0 Fix the symlink detection when signing TF.zip.
We used to check for 'attr >> 16 == 0xa1ff' (i.e. 0o120777) to detect
symlinks in the input target_files zip (TF.zip). This becomes broken
after we switch to soong_zip, which packs symlinks with 0o120700.

This CL fixes the issue by using stat.S_ISLNK() instead.

Note that we don't need to stage the files with the exact permission
bits as in the input TF.zip. Because this part is covered by mkbootfs
by using the canned or the compiled-in fs_config - as long as the
files/directories are accessible and the symlinks are created.

Bug: 38455129
Test: sign_target_files_apks.py on bullhead TF.zip. Check the
      checksums in SYSTEM/bin/install-recovery.sh.
Change-Id: I51c1fc9a257fb3f18c16c2ed71528abaa6f7d9c9
(cherry picked from commit 406050bdb6)
2017-05-23 11:18:26 -07:00
Tao Bao
78a41f6553 Merge "Fix the symlink detection when signing TF.zip." 2017-05-23 18:15:44 +00:00
Tao Bao
406050bdb6 Fix the symlink detection when signing TF.zip.
We used to check for 'attr >> 16 == 0xa1ff' (i.e. 0o120777) to detect
symlinks in the input target_files zip (TF.zip). This becomes broken
after we switch to soong_zip, which packs symlinks with 0o120700.

This CL fixes the issue by using stat.S_ISLNK() instead.

Note that we don't need to stage the files with the exact permission
bits as in the input TF.zip. Because this part is covered by mkbootfs
by using the canned or the compiled-in fs_config - as long as the
files/directories are accessible and the symlinks are created.

Bug: 38455129
Test: sign_target_files_apks.py on bullhead TF.zip. Check the
      checksums in SYSTEM/bin/install-recovery.sh.
Change-Id: I51c1fc9a257fb3f18c16c2ed71528abaa6f7d9c9
2017-05-22 23:33:11 -07:00
Mark Salyzyn
c2eb5566b6 Merge "Android.mk: clear variable at end of use" am: 5d9c1e7430 am: edf9c79e42
am: 05f9a1cec6

Change-Id: I628b58bc041c470ba6d4f426a0e09f6bca581132
2017-05-19 20:57:13 +00:00
William Roberts
6b19e495b1 Android.mk: clear variable at end of use
Clear fs_config_generate_extra_partition_list after use.

Test: build fs_config_files and fs_config_dirs targets.

Change-Id: Ie18bcd2df2ff1becb178e9ba45d226e2e9a8faab
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2017-05-19 20:14:27 +00:00
Chih-Hung Hsieh
fd3b52addf Merge "Recognize new clang and make warnings." am: dd51cfc9a2 am: 6d8d482f79
am: e6a58345bd

Change-Id: I18c3a1d481846660c0d86dab7c1cb94ccd99b6d5
2017-05-18 23:35:21 +00:00
Chih-Hung Hsieh
8ef1aae6d3 Recognize new clang and make warnings.
Test: warn.py build.log
Change-Id: I078b3cc35a00590312208cb90af0a1f2431abf09
2017-05-18 14:29:59 -07:00
Yueyao Zhu
3a3d9c5837 Merge "add dtbo support for ota" am: 294d5c5f07 am: 793a9bb490
am: d2f336664c

Change-Id: I800efcf88ddb00d9624514b1c748e998f1ebd3e5
2017-05-15 17:01:55 +00:00
Treehugger Robot
294d5c5f07 Merge "add dtbo support for ota" 2017-05-15 16:49:46 +00:00
Julius D'souza
86568d4acc Merge "Add the option to reserve headroom for partition images. This is useful for devices with low disk space with different build variants." am: bba00b2cb9 am: e255054a08
am: b83a34bf9e

Change-Id: I5ae85fbf49d7cfae4c72d5cdec2ee5cfc28e8d8e
2017-05-13 01:48:23 +00:00
Treehugger Robot
bba00b2cb9 Merge "Add the option to reserve headroom for partition images. This is useful for devices with low disk space with different build variants." 2017-05-13 01:37:25 +00:00
Yueyao Zhu
889ee5e7d3 add dtbo support for ota
Test: make dist and locally push ota on a device
Change-Id: I920b98f20e248b437955b2a963eb69ed2ddb8d45
2017-05-12 17:50:46 -07:00
Tianjie Xu
ab40afa40d Merge "Add a script to parse an block-based ota package" am: f34d435925 am: ca3aad1943
am: 61ee5aecd0

Change-Id: Iccbe2c22c9091fb4e843e255242217e7299eef51
2017-05-11 22:33:46 +00:00
Tianjie Xu
f34d435925 Merge "Add a script to parse an block-based ota package" 2017-05-11 21:52:10 +00:00
Tao Bao
df8e605204 Merge "OTA Tools: Handle password encrypted keys" am: 4e1c113554 am: c3947ece97
am: 686c732c63

Change-Id: I67face061729bb0b25345ada85387f6e1bbefb57
2017-05-11 19:51:50 +00:00
Christian Oder
f63e2cd47b OTA Tools: Handle password encrypted keys
* Add logic to handle decrypted keys from common.GetKeyPassword in
WriteABOTAPackageWithBrilloScript.

* Get the keys passwords in main and store them in OPTIONS.key_passwords.
This allows accessing them in WriteABOTAPackageWithBrilloScript and SignOutput
so it's only required to ask for the password once, while allowing to use
decrypted signing keys.

Test: ota_from_target_files.py on marlin and angler respectively.
Change-Id: I7c9b0198855a4b630c52b8552e904f312f09c4ce
2017-05-10 16:54:42 -07:00
Tianjie Xu
ce9d78fcd9 Add a script to parse an block-based ota package
The script prints the meta info, new/patch data size. It also simulates
the transfer commands and calculates amount of I/O as well as cache
needed.

We can add the more options to parse system/vendor.map so that we can
analyze the location change of files.

Bug: 31514709
Test: parse a bullhead incremental/full ota.
Change-Id: I70ed4f4c15e595b1851109e9799d44ac4e815c16
2017-05-09 21:01:19 +00:00
Julius D'souza
001c676b81 Add the option to reserve headroom for partition images.
This is useful for devices with low disk space with different
build variants.

Bug: 37469715
Test: Regular image builds successfully, errors occur when
the headroom size is greater than available partition space.

Change-Id: I526cdd0f84981bbd16e3afcfe1cd7fc43dce98ef
2017-05-08 11:59:25 -07:00
Tao Bao
f5b5e5c378 Merge "releasetools: Add a verbose parameter to common.Run()." am: a149a83e24 am: 7d887baf42
am: 9464b0722d

Change-Id: I9f8aa72e347cbf744318242220b245e3a3ee308d
2017-05-05 23:21:57 +00:00
Tao Bao
39451582c4 releasetools: Add a verbose parameter to common.Run().
Caller can optionally specify the verbose flag which overrides
OPTIONS.verbose. The command line won't be outputed with verbose=False.
This is useful for cases that a) those command lines are less useful
(but will spam the output otherwise); b) sensitive info is part of the
invocation.

'verbose=False' will be consumed by common.Run() only, instead of being
passed to subprocess.Popen().

Test: ota_from_target_files.py on a block based OTA.
Change-Id: I7d5b4094d756a60f84f89c6a965e7ccc68e435f8
2017-05-04 11:18:56 -07:00
Jaekyun Seok
9e7eab53c1 Split vendor license notices into vendor partition
Xml files will be generated instead of html files, and then Settings
will generate html file on runtime from xml files of partitions.

Test: build succeeded and tested on sailfish
Bug: 37099941
Merged-In: Id7899381a537b1947cbb6164ed2b4a98492334af
Change-Id: Id7899381a537b1947cbb6164ed2b4a98492334af
(cherry picked from commit 3b7560bf88)
2017-05-01 22:07:50 +00:00
Jaekyun Seok
035a49f301 Split vendor license notices into vendor partition
am: 3b7560bf88

Change-Id: Ib2926d1b97a5bdc9ef59738bd9e993487da0730d
2017-05-01 21:26:51 +00:00
Jaekyun Seok
3b7560bf88 Split vendor license notices into vendor partition
Xml files will be generated instead of html files, and then Settings
will generate html file on runtime from xml files of partitions.

Test: build succeeded and tested on sailfish
Bug: 37099941
Change-Id: Id7899381a537b1947cbb6164ed2b4a98492334af
2017-04-28 16:29:17 +09:00
Chih-Hung Hsieh
ee0ffb596b Merge "Get Android TOP from build.log file." am: 72a662a282 am: 5bc24ca63a
am: a463931292

Change-Id: Ibd67280ffe97bf5ab3ea988f862331a145681da5
2017-04-27 23:00:21 +00:00
Chih-Hung Hsieh
ef21d1458b Get Android TOP from build.log file.
find_android_root works only when warn.py is found
so it works for build bot, but not when warn.py is
run against a stand alone build.log file.
Now get the TOP directory path from build.log
if it is found.

Bug: 37725427
Test: warn.py --gencsv build.log
Change-Id: I7b776c2e71a8d8d769f0600b08abe37acbd6ce7c
2017-04-27 10:25:37 -07:00
Tao Bao
f9937b5c24 Merge "Revert "Revert "Add compatibility metadata to OTA package""" 2017-04-27 16:12:57 +00:00
Mark Salyzyn
c1b0993552 Merge "fs_config_dirs and fs_config_files miscalculates LOCAL_REQUIRED_MODULES" am: d0020fafe2 am: 151e856015
am: de12e39af7

Change-Id: I4352677bec833b32c6c6a2acf86276d5fa7ed72a
2017-04-27 15:49:35 +00:00
Mark Salyzyn
eb8dc72724 fs_config_dirs and fs_config_files miscalculates LOCAL_REQUIRED_MODULES
Misspelled fs_config_generate_extra_partition_list when used to
calculate LOCAL_REQUIRED_MODULES dependencies.  This resulted in
fs_config_dirs and fs_config_files failing to generate the vendor,
oem or odm variants (ie: fs_config_files_vendor)

Test: build generates correct fs_config override files.
Bug: 37721445
Bug: 36071012
Change-Id: I053dd5cdb357c7cea05a5ff63b0686bd0bc99df6
2017-04-27 08:01:27 -07:00
Tao Bao
4bede622dc Merge "Revert "Revert "Add compatibility metadata to OTA package""" into oc-dev
am: cc2bfa484e

Change-Id: Ief6654d9b1f6d4f355b792806b809e9378a32b4a
2017-04-26 21:30:53 +00:00
Tao Bao
21803d3574 Revert "Revert "Add compatibility metadata to OTA package""
This reverts commit b1e59b8a73.

This CL enables generating compatibility zip entry in an A/B OTA
package. We're not enabling the support for non-A/B OTAs for now until
they have the necessary support (e.g. /proc/config.gz exists).

Bug: 36810913
Test: Generate full and incremental packages for marlin and applly under
      normal boot and sideload respectively.

Change-Id: I69f0a3feb7a0efc7f727f92f31c9e63f47ee6530
(cherry picked from commit b63c952cc7)
2017-04-26 14:28:46 -07:00
Mark Salyzyn
0934979502 Merge changes I44289a3d,I0537453b,I23a655b1 am: 7928afb83d am: b6650076ad
am: 6d63c8a7d5

Change-Id: I2165562709fdebf98c90958299ed23079b41f080
2017-04-26 14:47:57 +00:00
Mark Salyzyn
1fd588cfb2 fs_config_generator: Add fs_config_(dirs|files)_(vendor|oem|odm)
Add build targets to generate the vendor, oem and odm slices of the
fs_config_dirs and fs_config_files targets for each of the respective
filesystems, and automatically trigger the individual and enabled
partition build objects based as dependents of fs_config_dirs and
fs_config_files.

Sensitive to the following board definition pairs:

BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE  BOARD_USES_VENDORIMAGE
BOARD_OEMIMAGE_FILE_SYSTEM_TYPE     BOARD_USES_OEMIMAGE
BOARD_ODMIMAGE_FILE_SYSTEM_TYPE     BOARD_USES_ODMIMAGE

Which when defined and set means the images are generated for vendor,
oem or odm respectively.

Test: manually build w/ m 'fs_config_(dirs|files)_(vendor|oem|odm)'
      and check the expected products, or fails if not pertinent.
Test: build for product that produces split to system and vendor and
      subsequently boots with vendor products correctly configured.
Bug: 36071012
Change-Id: I44289a3dd50b7657367c826ad813c671a3de6afc
2017-04-25 15:09:09 -07:00
Mark Salyzyn
256d339413 fs_config_generate: add -P <partitionlist> option
Add a -P option to fs_config_generate that allows us to filter on
a comma separated partition whitelist or minus prefixed -blacklist.
A partition is defined as accessible as <partition>/ or
system/<partition>/.

No change for legacy, where no -P flag is specified.

For system.img, but not vendor, oem or odm file references:
fs_config_generate -P -vendor,-oem,-odm

For vendor.img file references:
fs_config_generate -P vendor

For oem.img file references:
fs_config_generate -P oem

For odm.img file references:
fs_config_generate -P odm

Add and fortify tests for each of these cases.

SideEffects: none
Test: gTest host fs_config-unit-test
Bug: 36071012
Change-Id: I0537453bb289d41ef98ad76e69f78ae49358a1b3
2017-04-25 15:09:01 -07:00