Commit graph

5036 commits

Author SHA1 Message Date
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
Mark Salyzyn
5649b31a17 fs_config_generate: unit test
Test -D and -F flag of fs_config_generate

Test: gTest host fs_config-unit-tests
Bug: 36071012
Change-Id: I23a655b17b7c55817f2aacc760700ff1b0728db3
2017-04-25 15:08:56 -07:00
Tao Bao
b63c952cc7 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
2017-04-25 15:04:41 -07:00
George Burgess IV
ce662c40f4 Merge "warn.py: have URLs open in new tabs" am: 7ffb8c8fa8 am: 2f6f02d812
am: 763e59213d

Change-Id: I7ec4e89370c007d28dd0db5ceafd80ae9f15a94f
2017-04-25 17:17:25 +00:00
George Burgess IV
169f5f1c6c warn.py: have URLs open in new tabs
Bug: None
Test: Ran warn.py on a build log. Code links in resultant HTML open in
new tabs when clicked.

Change-Id: Ia3def5ea14fe216700cb2ffabe4a39b98e69d55a
2017-04-21 15:19:36 -07:00
TreeHugger Robot
dd4cdfd30a Merge changes Ieb58dd9a,I8ada38df into oc-dev
* changes:
  AVB: support BOARD_BUILD_SYSTEM_ROOT_IMAGE
  AVB: support signing vendor.img
2017-04-18 04:10:58 +00:00
Tao Bao
f6d073e487 Merge "Revert "Add compatibility metadata to OTA package"" into oc-dev
am: 533183dc68

Change-Id: Iacede7d5a6357c91e86a8bc8dbf113b991e2765c
2017-04-17 20:44:46 +00:00
Tao Bao
b1e59b8a73 Revert "Add compatibility metadata to OTA package"
This reverts commit 853cd306b0.

Temporarily reverting the CL to work around the bug in recovery code.

Bug: 37413730
Change-Id: I8e77112ffafcf32332794739ee1c855cc83b32b0
2017-04-17 18:40:18 +00:00
Bowgo Tsai
16ba563b71 AVB: support BOARD_BUILD_SYSTEM_ROOT_IMAGE
Passing --setup_rootfs_from_kernel to avbtool when
BOARD_BUILD_SYSTEM_ROOT_IMAGE is true

Bug: 33590159
Test: 'make' sailfish with BOARD_AVB_ENABLE := true
Test: 'make dist' with BOARD_AVB_ENABLE := true
Change-Id: Ieb58dd9ae6be1eceb90a33c739b85cff5cbc6e0a
Merged-In: Ieb58dd9ae6be1eceb90a33c739b85cff5cbc6e0a
(cherry picked from commit 9b3776017f)
2017-04-15 13:57:42 +08:00
Bowgo Tsai
3f0fd3d085 AVB: support signing vendor.img
Uses avbtool to sign vendor.img if BOARD_AVB_ENABLE is set.
It also allows appending additional arguments to avbtool via
BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS.

e.g.,
  BOARD_AVB_ENABLE := true
  BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS := --generate_fec

Bug: 35415839
Test: "make" with the above variables and use avbtool to check vbmeta is
      appended to vendor.img
Test: "make dist" with the above variables

Change-Id: I8ada38dff3def6d34613e77c67944def8a49f464
Merged-In: I8ada38dff3def6d34613e77c67944def8a49f464
(cherry picked from commit 8ee4a3db8c)
2017-04-15 13:57:21 +08:00
Bowgo Tsai
1c6d3e1b87 Merge changes Ieb58dd9a,I8ada38df am: 9ea5c1aad0 am: 225a18d07d
am: 13de7b5f0b

Change-Id: Ied184158f06af1fae79240299bad732e067e5fcd
2017-04-15 05:47:28 +00:00
Bowgo Tsai
9b3776017f AVB: support BOARD_BUILD_SYSTEM_ROOT_IMAGE
Passing --setup_rootfs_from_kernel to avbtool when
BOARD_BUILD_SYSTEM_ROOT_IMAGE is true

Bug: 33590159
Test: 'make' sailfish with BOARD_AVB_ENABLE := true
Test: 'make dist' with BOARD_AVB_ENABLE := true
Change-Id: Ieb58dd9ae6be1eceb90a33c739b85cff5cbc6e0a
2017-04-15 08:53:40 +08:00
Bowgo Tsai
8ee4a3db8c AVB: support signing vendor.img
Uses avbtool to sign vendor.img if BOARD_AVB_ENABLE is set.
It also allows appending additional arguments to avbtool via
BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS.

e.g.,
  BOARD_AVB_ENABLE := true
  BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS := --generate_fec

Bug: 35415839
Test: "make" with the above variables and use avbtool to check vbmeta is
      appended to vendor.img
Test: "make dist" with the above variables

Change-Id: I8ada38dff3def6d34613e77c67944def8a49f464
2017-04-15 08:53:06 +08:00
Michael Schwartz
140ba703b6 Merge "Add compatibility metadata to OTA package" into oc-dev
am: 5a933fc8d5

Change-Id: I69efaa4a920ddf13bbdd0de98dbabc0075480b3b
2017-04-14 21:04:49 +00:00
Michael Schwartz
853cd306b0 Add compatibility metadata to OTA package
Store the metadata in a archive within the OTA package so the collection
can be retrieved as a single unit by the device.

Bug: 36810913
Test: `make dist` marlin (ab) and angler (non-AB) for incremental and full OTA.
Change-Id: I94118e48a3c6ed5ff890b67d7dafbca02346aeea
2017-04-13 21:32:05 -07:00
Sam Saccone
32f9483eb5 Merge "Add the ability to save off the CSV to a file." am: c5b172b1eb am: 4b22df2b4e
am: 340b9610e2

Change-Id: I7dabc9900ee039aca124b6efc2cbc50858d5d895
2017-04-13 15:00:18 +00:00
Sam Saccone
03aaa7e2d8 Add the ability to save off the CSV to a file.
While we are generating the html file also expose a way for a user to
save off a csv file. This prevents having to run the tool twice.

* Add a new flag called csvpath that takes a file path for the csv dump.
* Use csv.writer to simply print formats.
* Modify the dump_csv and count_severity to take a csv writer.

Test: run with a build.log file, compare before and after html/csv dumps.
Change-Id: I27ed730625a352fdc3fb2928433eb5e8b2ea229c
2017-04-12 18:58:53 -07:00
Tao Bao
f859165bd1 Merge "releasetools: Add validate_target_files.py." am: 6cb177f15c am: c23d275d02
am: d5244a593f

Change-Id: I2f4e4473ffbe1e1802ec31a0e95d1247634ff2ea
2017-04-06 21:07:01 +00:00
Tao Bao
6cb177f15c Merge "releasetools: Add validate_target_files.py." 2017-04-06 20:50:09 +00:00
Chih-hung Hsieh
badde95384 Merge "Encode special characters in email addresses." am: c4a7ed3530 am: 1124a1bd01
am: f754ef73a5

Change-Id: I1eb192492a53263182eddce2f1ab86a015400cce
2017-04-06 00:53:15 +00:00
Chih-hung Hsieh
c4a7ed3530 Merge "Encode special characters in email addresses." 2017-04-06 00:40:51 +00:00
Chih-Hung Hsieh
bee0dec6c4 Encode special characters in email addresses.
Now accept email addresses with '+' character.

Bug: 33166666
Test: checkowners.py -v -c `find . -name OWNERS`
Change-Id: I7792551e6be74e942906a75344233439d4bfeca3
2017-04-05 14:16:49 -07:00
Tao Bao
afaa0a638b releasetools: Add validate_target_files.py.
Bug: 35408446
Test: validate_target_files.py on existing target_files zips.
Change-Id: I140ef86533eee5adb93c2546510fdd7e9ce4e81a
2017-04-05 09:04:13 -07:00
Alex Deymo
4775eb67db Merge "Don't include the dev-key on IOT products." am: 41febee0cc am: b20d1d7a74
am: b83d6d50ab

Change-Id: I09c22951828599f7d0b3f290d0297bc06455528c
2017-04-04 00:57:10 +00:00
Alex Deymo
cec578c916 Don't include the dev-key on IOT products.
This patch updates the logic to use the PRODUCT_IOT variable instead of
BRILLO.

Bug: 36702887
Test: `make`; Image doesn't have the dev key.
Change-Id: I1751e97d8cdfeba83c7e4720a017a5f4dcfd49da
2017-04-03 15:04:35 -07:00
Elliott Hughes
b2fedccb26 Merge "fsconfig: Use defined macro for masking" am: 35eaf52ee2 am: d83bb4193a
am: ced2e48998

Change-Id: I9819032f3d0473cb307e96b96331cd753b871e69
2017-04-03 21:35:42 +00:00
doheon1.lee
5cd3bcab86 fsconfig: Use defined macro for masking
Mask opeation with CAP_ prefixed name can be wrapped with
CAP_MASK_LONG macro.

Change-Id: Ide31ad62fac0d28e7a02e45059fe6d2461da7e27
2017-04-03 15:17:06 +09:00
Jaekyun Seok
39f97ae22a Enforce RROs for all the build-time ROs
This CL is to generate every static RRO package for its target package
automatically at build-time.

BOARD_ENFORCE_RRO build variable is added to specify whether enforcing
RRO is required or not.

BOARD_ENFORCE_RRO_EXEMPT_SOURCES build variable is added to specify
the module list of which item should be exempt from enforcing RRO.

Test: tested on bullhead and sailfish
Bug: 34097942
Change-Id: I455b2ce34e66c57a540c299b5e378b7c4e78d5b8
(cherry picked from commit 3070610b72)
2017-03-30 10:43:38 +09:00
Makoto Onuki
517d32d4da Add USE_FILESLIST_GO to switch to fileslist.go
fileslist.go is still disabled by default.  To enable, use:
USE_FILESLIST_GO=true m -j

Bug: 36274890
Test: Manual, with m -j

Change-Id: I722e17fa7fb6ba91e2b2c44cd7524d974cbe4a56
(cherry picked from commit 9fe97e231b)
2017-03-28 13:19:03 -07:00
Makoto Onuki
c99ba3fb96 Merge "Add USE_FILESLIST_GO to switch to fileslist.go" am: d625ef2894 am: 0a069a74c2
am: 6a05fb3d33

Change-Id: I9d49341e4e9145151a728160944276b43f83d76e
2017-03-28 16:58:23 +00:00
Makoto Onuki
d625ef2894 Merge "Add USE_FILESLIST_GO to switch to fileslist.go" 2017-03-28 16:41:05 +00:00
Mark Salyzyn
f8b86e2651 Merge "fs_config_generate: README" am: 058e2f7b19 am: ccf3fcaba0
am: 4f254445e7

Change-Id: I334f9f5183ae93ba2db01bd82d10528967e024c0
2017-03-27 23:38:52 +00:00
Mark Salyzyn
058e2f7b19 Merge "fs_config_generate: README" 2017-03-27 23:29:02 +00:00
Scott Main
803e7d0e86 Delete all of templates-sdk/.
These files are now located in external/doclava/res/assets/
Related CLs:
https://googleplex-android-review.git.corp.google.com/#/c/1524290/
https://googleplex-android-review.git.corp.google.com/#/c/1928220/

Change-Id: Ia7dba884897c5b69243055190b6283537d35717f
2017-03-27 17:23:36 +00:00
Tianjie Xu
7224a8ff83 Merge "Fix unittest for blockimgdiff" am: 36bcb78eb9 am: 0e6a7f1838
am: 1b7e203272

Change-Id: Id6db83ef492aec3aba8ef8bf4c00658963ffaef3
2017-03-26 05:35:59 +00:00
Tianjie Xu
a011dec9b2 Fix unittest for blockimgdiff
The test broke due to api change in constructor of Transfer.

Bug: 36456381
Test: blockimgdiff test passes
Change-Id: Ic73b66f8fb6141ff6f50c113b0d8cc55d34e0b5d
2017-03-24 16:28:16 -07:00
Makoto Onuki
9fe97e231b Add USE_FILESLIST_GO to switch to fileslist.go
fileslist.go is still disabled by default.  To enable, use:
USE_FILESLIST_GO=true m -j

Bug: 36274890
Test: Manual, with m -j

Change-Id: I722e17fa7fb6ba91e2b2c44cd7524d974cbe4a56
2017-03-24 16:12:16 -07:00
Mark Salyzyn
87ba0144f8 fs_config_generate: README
Test: none
Bug: 36071012
Change-Id: If30461fb9c522f705874fdfdc2b7cd54a5c3732e
2017-03-24 08:57:27 -07:00
Tao Bao
15d816bfc5 Merge "Add a missing default value for OPTIONS.extracted_input." am: 2c280271ac am: 3918b311f5
am: 5114910040

Change-Id: Ia52560941ffe86d08ffeb20728e6aea6afff583d
2017-03-22 07:43:10 +00:00
Tao Bao
5f8ff9319b Add a missing default value for OPTIONS.extracted_input.
Test: ota_from_target_files.py without --extracted_input_target_files.
Change-Id: Ieaba43fa557b544b24f3eeccd68ac289d1fe3d31
2017-03-21 22:36:20 -07:00
Dan Willemsen
ea8f68ed6c Merge "Speed up non-AB ota_from_target_files in the build system" am: 47ba4239c8 am: 02e29c5b48
am: 62fb821faf

Change-Id: Idb3a0c991efe712865db7343861212a74ea56b0a
2017-03-22 02:26:50 +00:00
Dan Willemsen
cea5cd210e Speed up non-AB ota_from_target_files in the build system
We've just created the target files package and still have the extracted
directory, so pass that to ota_from_target_files so that it doesn't have
to re-extract what we just compressed.

This saves a little bit of time -- for bullhead-userdebug on internal
master, this brings the time to build an OTA from ~340s -> ~310s. Much
of the time is still spent generating and signing the OTA.

Test: lunch bullhead-userdebug; m -j otapackage
Test: bullhead-ota-*.zip is identical before/after
Change-Id: Ib51cf6b02123e9c49280e9957c6590645470a52c
2017-03-21 15:34:27 -07:00