Commit graph

6149 commits

Author SHA1 Message Date
Daniel Norman
113142152b Merge "Validates the config lists used by the script." am: a4ab1d8490 am: 0e58857364
am: d181c2119a

Change-Id: I597359107d78dccbb898e0897171e0876d4ddf79
2019-03-19 17:27:34 -07:00
Daniel Norman
0e58857364 Merge "Validates the config lists used by the script."
am: a4ab1d8490

Change-Id: I49846ae2cd3e66df79b8230363f916fa5c380f5a
2019-03-19 17:10:46 -07:00
Daniel Norman
a4ab1d8490 Merge "Validates the config lists used by the script." 2019-03-19 23:56:25 +00:00
Tao Bao
9782c5b49c Merge "releasetools: Allow skipping PRESIGNED APEXes." am: 2812fd32ac am: 7898831d95
am: 5e779eec7c

Change-Id: Ib2a9cc3e12198471ee891d6c0e81013c0302b82a
2019-03-19 16:46:59 -07:00
Tao Bao
7898831d95 Merge "releasetools: Allow skipping PRESIGNED APEXes."
am: 2812fd32ac

Change-Id: I2586d1663b0625dee739f964116e8371d90fb813
2019-03-19 16:24:24 -07:00
Tao Bao
2812fd32ac Merge "releasetools: Allow skipping PRESIGNED APEXes." 2019-03-19 23:04:07 +00:00
Daniel Norman
aa967cc673 Merge "Adds optional --rebuild_recovery flag to merge_target_files." am: fab3f29e5a am: 62f2c36d9a
am: 3e9a4b096e

Change-Id: Ie0f12dcefbadfab262f0c824665b9282aa0217be
2019-03-19 15:31:29 -07:00
Daniel Norman
62f2c36d9a Merge "Adds optional --rebuild_recovery flag to merge_target_files."
am: fab3f29e5a

Change-Id: I834d2e7ed672dce20960dd5c97b57fe3dbdc3bb6
2019-03-19 14:52:17 -07:00
Daniel Norman
fab3f29e5a Merge "Adds optional --rebuild_recovery flag to merge_target_files." 2019-03-19 21:32:28 +00:00
Tao Bao
14b806debc Merge "Revert "releasetools: check_target_files_signatures.py checks APEXes."" am: a0debcb62f am: a08464f59d
am: b06dc4ea54

Change-Id: Iceb51beb117f391f4d5ba54756ffe2c36e52cd2a
2019-03-19 13:55:00 -07:00
Tao Bao
a08464f59d Merge "Revert "releasetools: check_target_files_signatures.py checks APEXes.""
am: a0debcb62f

Change-Id: Iffe70f3385d53e15e7fee3fdfa56dc5fb33aa4e6
2019-03-19 13:40:35 -07:00
Tao Bao
e134399cab releasetools: Allow skipping PRESIGNED APEXes.
This CL adds support that allows treating an APEX as pre-signed. We can
skip signing an APEX with `-e <apex-name>=` and
`--extra_apex_payload_key <apex-name>=`. Note that the payload_key and
container_key must be in consistent state - either they're both
PRESIGNED or none of them is. CheckApkAndApexKeysAvailable() has been
updated to perform the sanity check.

Bug: 123716522
Test: Run sign_target_files_apks.py with the above flags.
Test: python -m unittest test_sign_target_files_apks
Change-Id: Id1e2f3f2facd4a97a385983cc9b78c028f7e7e73
2019-03-19 12:25:02 -07:00
Daniel Norman
e596452f03 Validates the config lists used by the script.
This validation is to help ensure that any usage of custom merge config
files does not accidentally exclude any item that has been added to the
default config lists.

Bug: 124197349
Test: Run merge_target_files with custom merge config files.
Change-Id: I34c51cb75212368146a2944d37621f311060d24d
2019-03-19 17:47:49 +00:00
Tao Bao
5516d37f41 Revert "releasetools: check_target_files_signatures.py checks APEXes."
This reverts commit d8469727bc. The script
is broken on target_files.zip that don't contain any APEX.

Bug: 128848294
Test: Run check_target_files_signatures.py on target_files.zip w/o APEX.
2019-03-19 09:30:08 -07:00
Tao Bao
a9dc04e78e Merge "releasetools: Kill the use of os.getenv('AVBTOOL')." am: e3f9dc6113 am: 26541cd427
am: 52c4db2511

Change-Id: I382906c7b245f34a59ef5d59c6797256b2e485b2
2019-03-19 09:13:30 -07:00
Tao Bao
26541cd427 Merge "releasetools: Kill the use of os.getenv('AVBTOOL')."
am: e3f9dc6113

Change-Id: I31c769d45d049a0867aed3db84790fb8b2db1c6d
2019-03-19 09:05:09 -07:00
Tao Bao
e3f9dc6113 Merge "releasetools: Kill the use of os.getenv('AVBTOOL')." 2019-03-19 15:53:26 +00:00
Tao Bao
f88e0ce01d releasetools: Kill the use of os.getenv('AVBTOOL').
OTA tools should pick up the avbtool, as listed in dict['avb_avbtool'],
from the current PATH (plus bin/ under the dir specified via `--path`),
the same way as handling all other host tools.

Test: `m dist`
Change-Id: I3eb4d2c61979b03d9c23b2403d9a38cf052d87ea
2019-03-18 21:01:43 -07:00
Yifan Hong
45a05bc545 Merge "Add supernod build target." am: 691defc4bd am: 5aec484888
am: 2725896bce

Change-Id: I5b83bc2af99d65c43660b3b764c3f7b5f2a0471a
2019-03-18 18:01:46 -07:00
Yifan Hong
5aec484888 Merge "Add supernod build target."
am: 691defc4bd

Change-Id: I5716c6a8028bb6c7beaf2ecbdd6ea28e44ad07ec
2019-03-18 17:06:47 -07:00
Yifan Hong
691defc4bd Merge "Add supernod build target." 2019-03-18 23:46:05 +00:00
Tao Bao
7f0951757e Merge "releasetools: Fix an issue when using APEX container key mapping." am: 7cd870ed60 am: f9a68d8167
am: 0891df1563

Change-Id: Id1edceb9e3666d325af602aad20206cf1937596f
2019-03-18 14:52:13 -07:00
Tao Bao
f9a68d8167 Merge "releasetools: Fix an issue when using APEX container key mapping."
am: 7cd870ed60

Change-Id: I3124312baf6f3e40a00f8c2bb079fa3155197828
2019-03-18 14:34:51 -07:00
Daniel Norman
a4911da57d Adds optional --rebuild_recovery flag to merge_target_files.
Also makes AddSystem check that an output_zip exists before attempting
to add the recovery patch to the output zip.

Bug: 128838154
Test: Running merge_target_files with --rebuild_recovery and verifying
it passes --rebuild_recovery to add_img_to_target_files.
Change-Id: I19347b2c0dabf29b7196045b18551b5d0687df2c
2019-03-18 12:29:31 -07:00
Tao Bao
fa9de0aae8 releasetools: Fix an issue when using APEX container key mapping.
The keys_info in the touched code is a tuple, which is immutable.

Bug: 123716522
Test: Run sign_target_files_apks.py with '-e foo.apex=bar' that replaces
      the APEX container key.

Change-Id: I4e57e46c93a56b7f6646764d021ebb42c19bf7f5
2019-03-18 10:26:09 -07:00
Tao Bao
5208545b40 releasetools: Support signing APEXes.
Bug: 123716522
Test: Run sign_target_files_apks.py to sign a target_files with APEXes.
Test: Run check_target_files_signatures.py on signed artifact.
Test: python -m unittest test_sign_target_files_apks
Change-Id: I3fa13e3d9461cf5e0838e0572d436e218164fe41
(cherry picked from commit aa7e993a22)
2019-03-17 14:00:28 -07:00
Tao Bao
315f19d548 releasetools: Add apex_utils.py.
The added `testdata/testkey_with_passwd.key` is generated with:

$ openssl pkcs8 -inform DER -in testdata/testkey_with_passwd.pk8 \
    -out testdata/testkey_with_passwd.key -passin pass:foo

Bug: 123716522
Test: python -m unittest test_apex_utils
Change-Id: I7b7f00178ecab35c3e41ecf4d10295fe9bf480ab
(cherry picked from commit 1cd59f2a26)
2019-03-17 14:00:14 -07:00
Tao Bao
9d9de37999 Revert "Add ability to sign bundled APEX into device signing process."
This reverts commit b3517c0d18.

Bug: 123716522
Test: N/A (done with the re-landing CLs)
Change-Id: I6e6232826b7b1eadce435ef88afdd51ade49fcf0
2019-03-17 13:59:48 -07:00
Tao Bao
35a7add43f releasetools: check_target_files_signatures.py checks APEXes.
Only the container certs will be checked and reported. For the payload
within an APEX, we can't easily extract the cert info.

It needs to go along a longer path, if ever needed, by:
 - extracting public keys from all the available certs;
 - using each of them to verify against an APEX payload to find a match
   (`avbtool verify_image --image payload --key public_key`).

Bug: 123716522
Test: Run check_target_files_signatures.py on target_files with APEXes.
Change-Id: I2ef318e05433d2d65ab84e2dff9e01fb6ee3373d
(cherry picked from commit d8469727bc)
2019-03-17 13:16:39 -07:00
Baligh Uddin
eb5af6fa98 Merge changes I3fa13e3d,I7b7f0017,I2ef318e0
am: 0573298a18

Change-Id: I89a00b65ec6c9c44ccd0d43eda6c9f8049749f04
2019-03-17 11:54:41 -07:00
Tao Bao
aa7e993a22 releasetools: Support signing APEXes.
Bug: 123716522
Test: Run sign_target_files_apks.py to sign a target_files with APEXes.
Test: Run check_target_files_signatures.py on signed artifact.
Test: python -m unittest test_sign_target_files_apks
Change-Id: I3fa13e3d9461cf5e0838e0572d436e218164fe41
2019-03-15 22:15:51 -07:00
Tao Bao
1cd59f2a26 releasetools: Add apex_utils.py.
The added `testdata/testkey_with_passwd.key` is generated with:

$ openssl pkcs8 -inform DER -in testdata/testkey_with_passwd.pk8 \
    -out testdata/testkey_with_passwd.key -passin pass:foo

Bug: 123716522
Test: python -m unittest test_apex_utils
Change-Id: I7b7f00178ecab35c3e41ecf4d10295fe9bf480ab
2019-03-15 22:08:42 -07:00
Tao Bao
d8469727bc releasetools: check_target_files_signatures.py checks APEXes.
Only the container certs will be checked and reported. For the payload
within an APEX, we can't easily extract the cert info.

It needs to go along a longer path, if ever needed, by:
 - extracting public keys from all the available certs;
 - using each of them to verify against an APEX payload to find a match
   (`avbtool verify_image --image payload --key public_key`).

Bug: 123716522
Test: Run check_target_files_signatures.py on target_files with APEXes.
Change-Id: I2ef318e05433d2d65ab84e2dff9e01fb6ee3373d
2019-03-15 20:56:13 -07:00
Tao Bao
7026c13851 Merge changes I1f645008,Ic68c019f am: 015f83137d am: 3f759a23ce
am: d532b602fd

Change-Id: I1804a5bd8b5427ceaeb130ab08c75d4eecfaf01f
2019-03-15 20:55:17 -07:00
Tao Bao
3f759a23ce Merge changes I1f645008,Ic68c019f
am: 015f83137d

Change-Id: I20ae63c891848d0426259b066265e7423a7ed5c8
2019-03-15 20:47:13 -07:00
Tao Bao
2cc0ca1770 releasetools: Add common.ExtractAvbPublicKey().
Bug: 123716522
Test: python -m unittest test_common
Change-Id: I1f645008a14cc882ef280f169c36e4b14a53ef88
2019-03-15 10:47:46 -07:00
Tao Bao
badceb2d60 releasetools: Initalize logger when signing.
Other modules have switched to logging module. sign_target_files_apks.py
needs to init the logger to get the logs.

Test: Run `sign_target_files_apks.py -v`. Check outputs.
Test: Run `check_target_files_signatures.py -v`.
Change-Id: Ic68c019f6fb14840561885f1194ad6efdfdb7d82
2019-03-15 09:53:00 -07:00
Chih-hung Hsieh
8cdaee91cd Merge "Accept the "file:(project:)?filePath" directive." am: cda227eeaf am: eb617633aa
am: aed44f5202

Change-Id: Iea6e1398817148ed5653832dc6b49b5f88b03270
2019-03-13 14:13:27 -07:00
Chih-hung Hsieh
eb617633aa Merge "Accept the "file:(project:)?filePath" directive."
am: cda227eeaf

Change-Id: I977f161f5879573bdcbe415fb25b2e994ba25d7e
2019-03-13 14:02:07 -07:00
Yifan Hong
69e0d61cbe Add supernod build target.
superimage-nodeps and supernod depends
on images from $(ANDROID_PRODUCT_OUT) (not from
target files package). It doesn't rebuild source
images if they are present.

A typical workflow is:

    m -j
    # change code in system
    m snod -j
    m supernod -j

Test: For non retrofit, run:
      `m snod -j; m supernod -j`
Fixes: 128321505
Change-Id: Ib8c011cadb9c0cd334234aef39f19be6a48fee62
2019-03-13 11:15:21 -07:00
Chih-Hung Hsieh
cc47729719 Accept the "file:(project:)?filePath" directive.
Test: checkowners.py some_owner_files
Bug: 126777637
Bug: 126761563
Change-Id: Iee03521681bc38fa28970a015058e1eba3c8b87a
2019-03-12 11:56:33 -07:00
Daniel Norman
b144b1f637 Merge "Adds support for optional config files to configure the merge." am: cf9509df01 am: f03c76d047
am: 186ae7abb2

Change-Id: I1c110236e0f26c6a550d780f7bdfcd3285fda791
2019-03-12 10:15:36 -07:00
Daniel Norman
f03c76d047 Merge "Adds support for optional config files to configure the merge."
am: cf9509df01

Change-Id: I67c1b99c582027e9993d9fe92acb94b4a66b80cd
2019-03-12 10:07:13 -07:00
Daniel Norman
2c99c5bbd2 Adds support for optional config files to configure the merge.
Bug: 124467065
Test: Running `python merge_target_files.py` using the three new flags
and observing that their contents are passed to the merge_target_files() function.
Change-Id: I4de46f041f5ae8bc8be2730313ce873a952bf78e
2019-03-12 16:51:18 +00:00
Pavel Salomatov
3fe23692ea Merge "releasetools: Add compatibility for custom out directory." am: b6f2f8b2d9 am: 0c470d3b8c
am: 9a5bc48596

Change-Id: Icfe258cfcda7a11505c53bdefd18c6bc322df844
2019-03-11 14:41:41 -07:00
Pavel Salomatov
0c470d3b8c Merge "releasetools: Add compatibility for custom out directory."
am: b6f2f8b2d9

Change-Id: I93b394aed846563a54a9c83a3705f91ffbc2cc01
2019-03-11 13:14:37 -07:00
Treehugger Robot
b6f2f8b2d9 Merge "releasetools: Add compatibility for custom out directory." 2019-03-11 19:51:14 +00:00
Pavel Salomatov
3267655004 releasetools: Add compatibility for custom out directory.
sign_target_files_apks script looks for the signapk.jar inside the out dir.
If the our dir is set to a different directory via OUT_DIR_COMMON_BASE the script does not work properly.

From now script checks if the OUT_DIR_COMMON_BASE is set, then searches the jar in the proper path.
If OUT_DIR_COMMON_BASE is unset, searches in "out" like it did before.

Test: Build with OUT_DIR_COMMON_BASE set and unset and verify that sign_target_files_apks works in both cases

Change-Id: I9218b98ff79526184f8353705640193405afac9e
2019-03-11 19:22:29 +03:00
Tao Bao
f05a054ce3 Merge "releasetools: Include retrofit info into package metadata." am: 28a11ef040 am: dff72247d8
am: 5242934a9c

Change-Id: I5b6900e9fcfcccfbb1a252c65a18c4ac602825de
2019-03-07 12:06:08 -08:00
Tao Bao
dff72247d8 Merge "releasetools: Include retrofit info into package metadata."
am: 28a11ef040

Change-Id: I76c8f757efea6bb2ce8d0dc084083e5c8f6f6bc6
2019-03-07 11:04:35 -08:00