Commit graph

5577 commits

Author SHA1 Message Date
Tianjie Xu
5ed32ce7a0 Merge "Iterate through the sorted file map when finding transfers" am: a7229a08b7
am: 0541a6a556

Change-Id: Idd384a1a089dc05a329b0e5e640d9cd4481e1ef7
2018-01-13 00:51:27 +00:00
Tianjie Xu
a7229a08b7 Merge "Iterate through the sorted file map when finding transfers" 2018-01-13 00:01:03 +00:00
Tianjie Xu
20a86cdd8d Iterate through the sorted file map when finding transfers
This helps to generate a deterministic package.

Bug: 71770360
Test: Generate a incremental package and transfers are added by file name.
Change-Id: I7562a200b97a1babbb09a77801324cc9408cc01f
2018-01-12 12:21:00 -08:00
Tao Bao
2db1385db5 releasetools: Remove the reloading of target info dict.
In non-A/B OTA path, we've been loading the info dict for the target
build twice (once to have a peek at the OTA type, with a reload after
unzipping the target-files zip). Remove the reloading.

This CL moves the loading of the source info dict up a bit to avoid
having two copies in the A/B and non-A/B paths. It also moves up the
sanity checks of the loaded info dicts before unzipping the target-files
zips.

Test: Generate full and incremental packages for bullhead and marlin.
Change-Id: Iccb953feb0b6ecf62e6f73d6e9ceea00077d098d
2018-01-11 21:59:30 -08:00
Tao Bao
6c9202b6fd Merge "releasetools: Remove the fallback-to-full logic." am: 896fa043bc am: c6548f8df4
am: a4b102c012

Change-Id: Ifba99e3c52bc269fc1fe9999406aa6f8726e8eb7
2018-01-11 22:59:28 +00:00
Tao Bao
e70cb693c4 Merge "releasetools: Remove two dead functions in ota_from_target_files.py." am: 155a140c82 am: 11348df23b
am: 8c7013631b

Change-Id: I0814587cbdf2cb50732b8e2f3bbc4acd0668ecc1
2018-01-11 22:58:39 +00:00
Tao Bao
a4b102c012 Merge "releasetools: Remove the fallback-to-full logic." am: 896fa043bc
am: c6548f8df4

Change-Id: I339b96181b4887cbc726d2111fd109a086eb5001
2018-01-11 22:54:59 +00:00
Tao Bao
8c7013631b Merge "releasetools: Remove two dead functions in ota_from_target_files.py." am: 155a140c82
am: 11348df23b

Change-Id: I7f941e6ff93e002d27d98b9d6b39384fffae505a
2018-01-11 22:54:11 +00:00
Treehugger Robot
896fa043bc Merge "releasetools: Remove the fallback-to-full logic." 2018-01-11 22:24:36 +00:00
Treehugger Robot
155a140c82 Merge "releasetools: Remove two dead functions in ota_from_target_files.py." 2018-01-11 22:23:18 +00:00
Tianjie Xu
f9ab3c6319 Merge "Sort the split transfers to generate a determinate package" am: c56071b21b am: 4c17a597d2
am: adffc700a8

Change-Id: I0fca63ca3de62b875042142afeaac09552f2bcb9
2018-01-11 05:26:01 +00:00
Tianjie Xu
adffc700a8 Merge "Sort the split transfers to generate a determinate package" am: c56071b21b
am: 4c17a597d2

Change-Id: Iae594600273f8e424fd03b5469ea98072a50d13d
2018-01-11 05:18:28 +00:00
Tianjie Xu
c56071b21b Merge "Sort the split transfers to generate a determinate package" 2018-01-11 04:15:28 +00:00
Tao Bao
175df38e6c releasetools: Remove two dead functions in ota_from_target_files.py.
GetBuildProp() and GetVendorBuildProp() have been factored into
BuildInfo class. These two functions were meant to be deleted in commit
481bab8d48.

Test: python -m unittest test_ota_from_target_files
Test: No users of these two functions.
Change-Id: Id590a46d597939973ef2339cdfea4f5163548d4d
2018-01-10 19:57:57 -08:00
Tao Bao
08df009083 Merge "releasetools: Add a BuildInfo class." am: b54f6157a4 am: 177f57df64
am: 82749884e4

Change-Id: I6a83b5d3c62b9cdb4ac2e020333a9b373ff0f4e9
2018-01-10 22:54:50 +00:00
Tao Bao
32b80dca9f releasetools: Remove the fallback-to-full logic.
The fallback-to-full logic doesn't look beneficial, but may hide away
real bugs, especially when it's on by default.

Test: Generate an incremental non-A/B OTA successfully.
Test: Inject bugs into script; observe that incremental OTA
      generation errors out instead of silently falling back.
Test: No internal users of the flag from code search.
Change-Id: Ifc627d898552c0bd72463e8c107e36610421608e
2018-01-10 14:03:16 -08:00
Tao Bao
82749884e4 Merge "releasetools: Add a BuildInfo class." am: b54f6157a4
am: 177f57df64

Change-Id: Id579d8dfffcc2ee6cb3009dce4b27568e2ace77d
2018-01-10 21:25:58 +00:00
Tao Bao
b54f6157a4 Merge "releasetools: Add a BuildInfo class." 2018-01-10 20:37:41 +00:00
Tianjie Xu
d3bf67e1d3 Sort the split transfers to generate a determinate package
We split large apks and generated patches for them in parallel,
resulting in nondeterminate packages between different runs. This CL
sort the split transfers by target name first; and then add them
sequentially to the final transfer list.

Also fix a side effect where we may generate a wrong sha1 for split
ranges due to synchronization error.

Bug: 71770360
Bug: 71759418

Test: Generate the package several times, compare the log and the transfer list.
Change-Id: I2a49e22594d59ffaa98b11edc776be4e3c4c561f
2018-01-10 12:23:57 -08:00
Tao Bao
481bab8d48 releasetools: Add a BuildInfo class.
Prior to this CL, we have similar codes in different paths
(WriteFullOTAPackage / WriteBlockIncrementalOTAPackage /
WriteABOTAPackageWithBrilloScript). This CL factors out the common codes
that deal with OEM-specific properties into BuildInfo class, and adds
tests for the new class.

Test: python -m unittest test_ota_from_target_files
Test: Create an incremental package that uses and doesn't use OEM
      properties respectively.
Test: Create a full package that uses and doesn't use OEM properties
      respectively.
Change-Id: Ida914cace12803d55396fa503bafcac2db2a520e
2018-01-09 15:08:23 -08:00
Elliott Hughes
3eca5d27ff Merge "adbs was broken for a year and no-one noticed." am: 5a436f10e5 am: 260b272319
am: 001396ba85

Change-Id: Ia0c08e5d41c6b7f924fc607ee4bc5582183bdad7
2018-01-09 01:52:48 +00:00
Elliott Hughes
001396ba85 Merge "adbs was broken for a year and no-one noticed." am: 5a436f10e5
am: 260b272319

Change-Id: Idcd7ebfda2f5b5351fee06762096004e322321ce
2018-01-09 00:54:43 +00:00
Elliott Hughes
1a701d93f9 adbs was broken for a year and no-one noticed.
Time to remove it.

Bug: https://b/15270043
Test: N/A
Change-Id: Idb56fc99c213732eca75f81ddd9d7a8a19374b42
2018-01-08 13:55:00 -08:00
Tao Bao
cf6a42f055 Merge "releasetools: Add tests for common.ReadApkCerts()." am: e3692095a1 am: 05d63dc7b0
am: 19fc696154

Change-Id: Ia25dd1a17e71beb96885655ddc151715f97bc5e1
2018-01-06 01:06:40 +00:00
Tao Bao
19fc696154 Merge "releasetools: Add tests for common.ReadApkCerts()." am: e3692095a1
am: 05d63dc7b0

Change-Id: I9e849a806db2accc02c26c803f2054382eb18603
2018-01-06 00:59:47 +00:00
Treehugger Robot
e3692095a1 Merge "releasetools: Add tests for common.ReadApkCerts()." 2018-01-05 23:30:53 +00:00
Tao Bao
818ddf5e7e releasetools: Add tests for common.ReadApkCerts().
Test: python -m unittest test_common
Test: Run sign_target_files_apks.py on a target with compressed APKs.
Change-Id: I107a8b8f2f0f82e2d1947f14c8a8b3778f633b11
2018-01-05 11:53:55 -08:00
Colin Cross
abc4bb71db Merge changes I9fda7fe3,I0a34b2b4,Ie64a283d am: 96029a1276 am: e3d02af57d
am: 23ab1f1580

Change-Id: I1489f5725d252ddf6beb9bbc3a4123612466f64d
2018-01-05 06:32:28 +00:00
Colin Cross
23ab1f1580 Merge changes I9fda7fe3,I0a34b2b4,Ie64a283d am: 96029a1276
am: e3d02af57d

Change-Id: Iefd8871754f8aae4ca8de2468d2a3774e7ed76c0
2018-01-05 06:29:55 +00:00
Colin Cross
96029a1276 Merge changes I9fda7fe3,I0a34b2b4,Ie64a283d
* changes:
  Clear resource_export_package outside conditionals
  Fix adbs after move from build/tools to build/make/tools
  Use proguard.jacoco.flags for EMMA_INSTRUMENT_STATIC
2018-01-05 06:22:35 +00:00
Tao Bao
055dcc96f9 Merge "releasetools: Clean up build_image.py." am: 7c53288810 am: 7c8c39179a
am: 74713e35fe

Change-Id: I37753878ad7fe9994f4dfc3e0a1124d6ae751f7f
2018-01-04 22:35:02 +00:00
Tao Bao
74713e35fe Merge "releasetools: Clean up build_image.py." am: 7c53288810
am: 7c8c39179a

Change-Id: Ie760c6387ac9546edc8dc301ab664ecab96db58e
2018-01-04 22:30:06 +00:00
Tao Bao
550012ea79 Merge "releasetools: Move assertions into CheckHeadroom()." am: b050f66e42 am: 780be982a7
am: 000c76c68b

Change-Id: Idb98698d18da2797c862c5d1992cbb5044705287
2018-01-04 18:51:22 +00:00
Tao Bao
000c76c68b Merge "releasetools: Move assertions into CheckHeadroom()." am: b050f66e42
am: 780be982a7

Change-Id: I0848092782d30436885b3da3716e302e583da503
2018-01-04 18:47:17 +00:00
Colin Cross
d31ff8ff32 Fix adbs after move from build/tools to build/make/tools
adbs broke when build/tools was moved to build/make/tools in
aosp/286781.

Bug: 15270043
Test: build/tools/adbs
Change-Id: I0a34b2b446f996bcc53a7dde6381402f8eed9bd0
2018-01-03 14:21:35 -08:00
Tao Bao
c72727ac3f releasetools: Clean up build_image.py.
Mostly cosmetic changes, such as moving print statement to print
function. The only functional change is to wrap the file opening in
Append() with try statement, which would dump the error message as
needed.

Test: `m dist`
Test: python -m unittest test_build_image
Change-Id: I4e6c593517cf737bfcbe51bc533b22a247b10e44
2018-01-03 11:52:28 -08:00
Tao Bao
d8a953d7ab releasetools: Move assertions into CheckHeadroom().
Assert the input arguments inside CheckHeadroom() function, and add
matching tests. Also use common.MakeTemp{File,Dir} in tests.

Test: `m dist`
Test: python -m unittest test_build_image
Change-Id: Ib45f24651af9591a9cfdd72aac3558f6c9a80f44
2018-01-03 11:52:16 -08:00
Tao Bao
29a2cc5803 Merge "releasetools: Clean up ReplaceVerityKeyId and add tests." am: b35128521d am: 2a0f657c56
am: 413a88b386

Change-Id: I50d530fe8a262f601adf61755a42bf19d0c7f75a
2018-01-03 19:52:01 +00:00
Tao Bao
413a88b386 Merge "releasetools: Clean up ReplaceVerityKeyId and add tests." am: b35128521d
am: 2a0f657c56

Change-Id: I0da4fccfbf7d6873de59e5a019cb13f3414e3b40
2018-01-03 19:46:56 +00:00
Tao Bao
b601efd8b9 Merge "releasetools: Add common.MakeTempDir()." am: ec728cbad0 am: 043544035e
am: 9c097cf8a7

Change-Id: I5ac425d41656de9cc6cbba89e6859772ea8718f8
2018-01-02 23:43:44 +00:00
Tao Bao
9c097cf8a7 Merge "releasetools: Add common.MakeTempDir()." am: ec728cbad0
am: 043544035e

Change-Id: I1ac5a296f9af4b3989642e1bf6cfc623fa72404f
2018-01-02 23:37:38 +00:00
Tao Bao
e838d1446c releasetools: Clean up ReplaceVerityKeyId and add tests.
Test: python -m unittest test_sign_target_files_apks
Test: Run sign_target_files_apks.py on marlin target_files.zip.
Change-Id: Ic3c3f4f14c73f8f8e48a8341e024e0861e665989
2018-01-02 12:29:31 -08:00
Tao Bao
1c830bfbaa releasetools: Add common.MakeTempDir().
This simplifies the work to track mkdtemp()'d dirs. This CL also cleans
up the temporary file creation in build_image.py.

Test: `m dist`
Test: python -m unittest test_common
Change-Id: Ied7d86126714b9b26e5df7bcca1dfdea21cfcf60
2018-01-02 12:22:01 -08:00
Tao Bao
7eb7637f6b Merge "releasetools: Clean up sign_target_files_apks.py." am: 7d100ce03b am: 336f2cce7d
am: 2b8f63693e

Change-Id: Iad866e0a5dd3ab2257f19fab3511ecda88de3285
2018-01-02 20:09:58 +00:00
Tao Bao
192101a6e8 Merge "releasetools: Fix a bug in blockimgdiff.HeapItem." am: a5e3a258fd am: 442be8f1e5
am: 3859f0d09f

Change-Id: I9dcb7c9d444512c27324e932093b5036c9c57311
2018-01-02 20:05:57 +00:00
Tao Bao
2b8f63693e Merge "releasetools: Clean up sign_target_files_apks.py." am: 7d100ce03b
am: 336f2cce7d

Change-Id: Idb8b486616222a809e34d61d721e8f3f2a6d41ae
2018-01-02 20:05:56 +00:00
Tao Bao
3859f0d09f Merge "releasetools: Fix a bug in blockimgdiff.HeapItem." am: a5e3a258fd
am: 442be8f1e5

Change-Id: I81040b7cb4acbd4ea791a0eb9b251b8d39cabfe3
2018-01-02 20:02:22 +00:00
Treehugger Robot
7d100ce03b Merge "releasetools: Clean up sign_target_files_apks.py." 2018-01-02 19:56:03 +00:00
Tao Bao
0c28d2d02d releasetools: Clean up sign_target_files_apks.py.
Mostly cosmetic changes, such as replacing print statement with print
function. Also change 'import cStringIO' to optionally look for the one
in io module, to allow Python 2/3 compatibility.

Test: pylint --rcfile=pylintrc sign_target_files_apks.py
Test: Run sign_target_files_apks.py on marlin target_files.zip.
Change-Id: I4dc98b01da6f89e624114bbca5522f659901c1f2
2018-01-02 09:57:29 -08:00
Tao Bao
186ec99eb9 releasetools: Fix a bug in blockimgdiff.HeapItem.
HeapItem defines __bool__(), which contains a logical error that should
return the opposite value.

Note that the bug only manifests while using Python 3, which calls
__bool__(). With Python 2, `if x:` or bool(x) actually calls
x.__nonzero__() or x.__len__(). If a class defines neither __len__() nor
__nonzero__(), as the case in HeapItem, it always returns True.

Test: python -m unittest test_blockimgdiff
Test: python3 -m unittest test_blockimgdiff
Test: Generate an incremental non-A/B OTA package successfully.
Change-Id: Ibe8430e0b495a7d2f430cfffb716d2536ffb53d2
2018-01-02 09:54:32 -08:00
Dan Shi
5a96e18528 Merge "Test config should use manifest package attribute" am: a6c3cece9e am: 4647f8125a
am: 7abb8ccbca

Change-Id: I0926bcf899c022dd17afd5ecdaba6d327e070e3f
2017-12-22 23:46:52 +00:00
Dan Shi
7abb8ccbca Merge "Test config should use manifest package attribute" am: a6c3cece9e
am: 4647f8125a

Change-Id: Ie0ede8acaf7085c0312f5305ad6c7b54fd8a09aa
2017-12-22 23:41:46 +00:00
Dan Shi
9a50168c85 Test config should use manifest package attribute
Bug: 70981774,69929803
Test: m -j SetupWizardActivityTests
Change-Id: I6d50744504eac71d6ecae5db9b14e6d30eb923fe
2017-12-22 13:34:50 -08:00
Tao Bao
da7adc9f58 Merge "releasetools: Remove the dead code for blockimgdiff_version <= 2." am: be8ea6ec11 am: d052700179
am: b4a93bd4c8

Change-Id: Ia7f89941d7df6b93443e3ed019beab80cea3fb76
2017-12-21 22:48:59 +00:00
Tao Bao
b4a93bd4c8 Merge "releasetools: Remove the dead code for blockimgdiff_version <= 2." am: be8ea6ec11
am: d052700179

Change-Id: I7108f50d08d13026a5dd414f74f069714b9cf793
2017-12-21 22:37:13 +00:00
Dan Shi
12e5732070 Merge "Auto generate test config files" am: 3c28ff7bff am: 4ccd1a5a00
am: 26201a4d44

Change-Id: Id65ca55a8031ae354a8c98b3c59c02fcc6de276c
2017-12-21 22:30:46 +00:00
Dan Shi
26201a4d44 Merge "Auto generate test config files" am: 3c28ff7bff
am: 4ccd1a5a00

Change-Id: Ibc089081ab2925f8e3453eddf8c64d81d3b49596
2017-12-21 22:25:40 +00:00
Tao Bao
be8ea6ec11 Merge "releasetools: Remove the dead code for blockimgdiff_version <= 2." 2017-12-21 22:20:32 +00:00
Dan Shi
3c28ff7bff Merge "Auto generate test config files" 2017-12-21 21:53:12 +00:00
Tao Bao
0582cb639f releasetools: Remove the dead code for blockimgdiff_version <= 2.
The code is on infeasible path since we already have assertions in
common.BlockDifference().

Also remove the dead code that checks for OPTIONS.info_dict, as we
already set that in ota_from_target_files.main(), for both of A/B and
non-A/B.

Test: Generate incremental OTAs w/ and w/o the CL, and get identical
      packages.
Change-Id: Ifb8fc101e78f5ce58c60c8e49028b66ce0d20246
2017-12-21 11:53:27 -08:00
Tao Bao
8393ee7722 Merge "releasetools: Fix the bug that skips loading OEM dict." am: 7889375102 am: 80fb79f200
am: a61ffc1291

Change-Id: I3bcaf431c53b8ae82357f71ef41907297cd885fc
2017-12-21 19:21:57 +00:00
Tao Bao
a61ffc1291 Merge "releasetools: Fix the bug that skips loading OEM dict." am: 7889375102
am: 80fb79f200

Change-Id: Iac9c5c63886406aed585fe09c1ee9ba060a6a6cb
2017-12-21 18:01:30 +00:00
Tao Bao
2f5358d38b releasetools: Fix the bug that skips loading OEM dict.
The CL in [1] unintentionally breaks the OEM dict loading logic in the
incremental BBOTA path. We should always require and load the OEM
property dict if _either_ of the source and target builds uses OEM
properties. Otherwise with the current "and" operator, it skips loading
the OEM property dict and thus fails to generate an OTA package that has
OEM property changes (e.g. updating from build with fingerprint to
another one using thumbprint).

The CL in [1] actually makes the right change in the file-based OTA
path, but introduces the bug in the block-based OTA path.

This CL also cleans up the line that reads recovery_mount_options.

[1] commit 7f804ba71f ("releasetools:
allow for multiple OEM property values.").

Test: Genearte an OTA that has OEM property changes successfully.
Change-Id: Idce4ad59825d432618535ce09ab22bd7ddc524f2
2017-12-20 23:06:02 -08:00
Dan Shi
efb892d858 Auto generate test config files
This change allows one to run atest <module name>. The TradeFed test
config file will be automatically created in testcases directory based
on the settings.

Bug: 69929803, 69932044
Test: m -j NotificationStressTests libminijail_test
add following lines in notificationtests/Android.mk,
before "include $(BUILD_PACKAGE)"
LOCAL_COMPATIBILITY_SUITE := general-test

Change-Id: Ib5e9cd152d957b5d5beb6ed23a899a021a7e06d6
2017-12-20 15:05:17 -08:00
Tao Bao
ccb1781cb2 Merge "build_image: Factor out CheckHeadroom() and add tests." am: b379762089 am: 0642ea4b4f
am: cdc134d19b

Change-Id: I3136ad92d600700dacc1c6fcffab3c571d4e4a0c
2017-12-19 01:02:08 +00:00
Tao Bao
cdc134d19b Merge "build_image: Factor out CheckHeadroom() and add tests." am: b379762089
am: 0642ea4b4f

Change-Id: I50590620a32444c086d2b24390680d14c2f643c0
2017-12-19 00:46:56 +00:00
Treehugger Robot
b379762089 Merge "build_image: Factor out CheckHeadroom() and add tests." 2017-12-19 00:00:41 +00:00
Tao Bao
9a4d2ddcec Merge "releasetools: Fix the tag replacement for ro.build.vendor.fingerprint." am: b08567cbb6 am: 1296fef56c
am: e2ab3d5c32

Change-Id: Icca5ed5716c11357a467be146d772d6b5b633eda
2017-12-18 22:32:25 +00:00
Tao Bao
90a2bcc3e0 Merge "Remove the support for BOARD_HAS_EXT4_RESERVED_BLOCKS." am: d30b75190d am: 4d45f51596
am: 3652c0ba76

Change-Id: I3cd249a50eea521d019ed9b2745a62dd850df537
2017-12-18 22:31:32 +00:00
Tao Bao
e2ab3d5c32 Merge "releasetools: Fix the tag replacement for ro.build.vendor.fingerprint." am: b08567cbb6
am: 1296fef56c

Change-Id: I39a7e18ed09902e001de264d2503e5ca93e43927
2017-12-18 22:28:59 +00:00
Tao Bao
3652c0ba76 Merge "Remove the support for BOARD_HAS_EXT4_RESERVED_BLOCKS." am: d30b75190d
am: 4d45f51596

Change-Id: Id6da54fe3f1cd4ebba63de849a065ffcd53b261e
2017-12-18 22:27:57 +00:00
Treehugger Robot
b08567cbb6 Merge "releasetools: Fix the tag replacement for ro.build.vendor.fingerprint." 2017-12-18 22:18:14 +00:00
Treehugger Robot
d30b75190d Merge "Remove the support for BOARD_HAS_EXT4_RESERVED_BLOCKS." 2017-12-18 22:17:46 +00:00
Tao Bao
8bd79a118d Merge "releasetools: Use delta_generator to verify payload signatures." am: e58d385df1 am: cbece24e6e
am: e6f267c4f3

Change-Id: I166bf85dadeda1f1c719e8d09160d74a3c978004
2017-12-15 23:52:17 +00:00
Tao Bao
e6f267c4f3 Merge "releasetools: Use delta_generator to verify payload signatures." am: e58d385df1
am: cbece24e6e

Change-Id: Id7dff799f84acc58008544b48e8b79d9cc2a1c21
2017-12-15 23:49:43 +00:00
Treehugger Robot
e58d385df1 Merge "releasetools: Use delta_generator to verify payload signatures." 2017-12-15 23:38:12 +00:00
Tao Bao
5029b5f2e3 Merge "releasetools: Remove the support for generating verify package." am: e2ffc8b887 am: 12fafaccc0
am: b1cc1ed1a7

Change-Id: I8a634d3f14c9869c4f1bbfe1499d961a60e64637
2017-12-15 22:13:21 +00:00
Tao Bao
b1cc1ed1a7 Merge "releasetools: Remove the support for generating verify package." am: e2ffc8b887
am: 12fafaccc0

Change-Id: I06cf6990379e5e92c33a151bdc6a96ca6fbb7528
2017-12-15 22:08:56 +00:00
Tao Bao
750385e455 releasetools: Use delta_generator to verify payload signatures.
We used to take a hard approach by parsing the payload with Python
script. This can be done by calling deleta_generator directly, which
also avoids the dependency on protobuf.

- Passing case
$ ./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...
[1215/122842:INFO:generate_delta_main.cc(171)] Verifying signed payload.
[1215/122845:INFO:payload_verifier.cc(93)] signature blob size = 264
[1215/122845:INFO:payload_verifier.cc(112)] Verified correct signature 1 out of 1 signatures.
[1215/122845:INFO:payload_verifier.cc(93)] signature blob size = 264
[1215/122845:INFO:payload_verifier.cc(112)] Verified correct signature 1 out of 1 signatures.
[1215/122845:INFO:generate_delta_main.cc(181)] Done verifying signed payload.

Payload signatures VERIFIED

$ echo $?
0

- Failing case
Sign the whole package file with a different key, but leaving payload entries intact.

$ ./build/make/tools/releasetools/check_ota_package_signature.py \
    testkey2.x509.pem \
    marlin-ota-mismatching.zip
Package: marlin-ota-mismatching.zip
Certificate: testkey2.x509.pem
  ...
Whole package signature VERIFIED

Verifying A/B OTA payload signatures...
[1215/123054:INFO:generate_delta_main.cc(171)] Verifying signed payload.
[1215/123056:INFO:payload_verifier.cc(93)] signature blob size = 264
[1215/123056:ERROR:payload_verifier.cc(118)] None of the 1 signatures is correct. Expected:
[1215/123056:INFO:utils.cc(444)] Logging array of length: 256
[1215/123056:INFO:utils.cc(461)] 0x00000000 : 00 01 ff ff ff ff ff ff ff ff ff ff ff ff ff ff
  ...
[1215/123056:ERROR:payload_verifier.cc(121)] But found decrypted hashes:
[1215/123056:INFO:utils.cc(444)] Logging array of length: 256
[1215/123056:INFO:utils.cc(461)] 0x00000000 : 52 68 78 36 f6 9e cd 2d 5e 9f 31 d5 26 03 c9 aa
  ...
[1215/123056:ERROR:payload_signer.cc(333)] PayloadVerifier::VerifySignature( signature_blob, public_key_path, payload_hash) failed.
[1215/123056:INFO:generate_delta_main.cc(177)] VerifySignedPayload failed

    ERROR: Failed to verify payload with delta_generator: marlin-ota-mismatching.zip

$ echo $?
1

Bug: 65261072
Test: See above.
Change-Id: Id2e065655ec49b80dd2b13c6a859f41913be055b
2017-12-15 12:45:09 -08:00
Tao Bao
0c6a414fff releasetools: Remove the support for generating verify package.
We used to have "--gen_verify" that would generate a verify package for
non-A/B devices. Since a) we don't have active users; b) it works with
non-A/B only; c) we have better alternatives (e.g. using fastboot to
compute the partition checksum), this CL removes the support.

Test: `m dist`
Change-Id: Ib4a2c8c2a0394b54e66c106089aa52a0b900f034
2017-12-15 10:20:52 -08:00
Tao Bao
386bec6f65 Merge "releasetools: Add common.ZipDelete()." am: 23f7ea9e70 am: 2bc1b967c1
am: 30e4e2d154

Change-Id: I2f11543a64aba731335756ae3cf7142d21e3ae76
2017-12-15 16:48:30 +00:00
Tao Bao
30e4e2d154 Merge "releasetools: Add common.ZipDelete()." am: 23f7ea9e70
am: 2bc1b967c1

Change-Id: I83f428a689f970b6df5ee332115a8f5ee51b4fd1
2017-12-15 16:45:25 +00:00
Tao Bao
23f7ea9e70 Merge "releasetools: Add common.ZipDelete()." 2017-12-15 16:36:55 +00:00
Tao Bao
89d7ab23e8 releasetools: Add common.ZipDelete().
We have been shelling out to 'zip -d' to delete existing ZIP entries in
add_img_to_target_files.py. This CL moves the function into common.py,
and calls that for the similar work in ota_from_target_files.py. This CL
also adds unittests for the newly added function.

Test: `m dist`
Test: python -m unittest test_common
Test: ota_from_target_files.py generates identical packages w/ and w/o
      the CL (so we know the streaming property computation is intact).
Test: Run 'add_img_to_target_files.py -a' that triggers a call to
      ReplaceUpdatedFiles().
Change-Id: Icaa6c3ea3ee2166023f78fa79275295f837ea842
2017-12-14 17:17:04 -08:00
Tao Bao
3491da7bbd Merge "releasetools: Remove '-w' from ota_from_target_files options." am: 78b5724622 am: 8baa6d4dcd
am: 4e71a6caff

Change-Id: I06e4cab17324744d5c35fdb0a2177f633c7229a5
2017-12-14 22:33:03 +00:00
Tao Bao
4e71a6caff Merge "releasetools: Remove '-w' from ota_from_target_files options." am: 78b5724622
am: 8baa6d4dcd

Change-Id: Ifb3e88d45e985cb20ef8b8cf763bb3c2b834ac0c
2017-12-14 22:28:22 +00:00
Treehugger Robot
78b5724622 Merge "releasetools: Remove '-w' from ota_from_target_files options." 2017-12-14 22:18:56 +00:00
Przemyslaw Szczepaniak
6686e51b75 Merge "Add PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION" 2017-12-13 10:15:46 +00:00
Colin Cross
426ecd0f60 Merge "Replace build/tools with build/make/tools" am: 973301af79 am: e6dc6b2026
am: eb6c8444a6

Change-Id: I14d033658d219e81790ab1e730b7e477c70f4a13
2017-12-13 03:03:47 +00:00
Colin Cross
eb6c8444a6 Merge "Replace build/tools with build/make/tools" am: 973301af79
am: e6dc6b2026

Change-Id: Ie3eb9e2b411603f95f91cac79ebe56eb78423da3
2017-12-13 02:49:40 +00:00
Treehugger Robot
973301af79 Merge "Replace build/tools with build/make/tools" 2017-12-13 02:34:42 +00:00
Przemyslaw Szczepaniak
e554015b3a Add PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION
Exposed as ro.build.version.min_supported_target_sdk build_property

Test: make
Bug: 63926630
Change-Id: I8084fd4c54d9c2fb5e2683430e2b3aaf4c5f4a7a
2017-12-11 10:45:45 +00:00
Tao Bao
a7054eede1 releasetools: Fix the tag replacement for ro.build.vendor.fingerprint.
For devices using derived fingerprint (i.e. /system/build.prop doesn't
contain ro.build.fingerprint, but has ro.build.thumbprint instead), the
current code (in android.os.Build) doesn't have a matching logic to do
the same for ro.vendor.build.fingerprint. This means we will see
ro.build.thumbprint in /system/build.prop, while there's no matching
ro.vendor.build.thumbprint in /vendor/build.prop.

From signing script point of view, it should just apply the tag
replacement (e.g. test-keys -> release-keys) for whatever it sees when
signing a target_files.zip.

This CL also adds unit tests for EditTags() and RewriteProps().

Fixes: 27950003
Test: Use 'sign_target_files_apks.py' to sign a target that uses derived
      fingerprint and vendor partition. Check VENDOR/build.prop.
Test: python -m unittest test_sign_target_files_apks
Change-Id: I09019da970840cd82f54b68a32b4e94984bc1d8d
2017-12-08 15:19:47 -08:00
Jaegeuk Kim
6149ea8637 Merge "core, release: add sload.f2fs for otatools.zip" am: 10c9f5d9d3 am: a5a2f10d79
am: cc1d0c982e

Change-Id: I6a40d04c8935627f75ccf13b467bc96e63bfb2ee
2017-12-08 17:00:37 +00:00
Tao Bao
d4349f2106 build_image: Factor out CheckHeadroom() and add tests.
The test is mostly trivial, but it ensures the result parsing from
actual calls to mke2fs.

Test: python -m unittest test_build_image
Test: `m dist` on aosp_marlin-userdebug (w/ and w/o defining
      PRODUCT_SYSTEM_HEADROOM respectively).
Change-Id: I8b9964213950e76f6d7d5518414a1bab888b4706
2017-12-07 23:39:56 -08:00
Jaegeuk Kim
cc1d0c982e Merge "core, release: add sload.f2fs for otatools.zip" am: 10c9f5d9d3
am: a5a2f10d79

Change-Id: Icbca3310a938e2c48d4e82c2dd1454fec2a05c92
2017-12-08 01:13:43 +00:00
Elliott Hughes
ef40ea28a6 Merge "Explain why BuildImage failed." am: 9a33b96103 am: 76eb8e10ee
am: 20742517b4

Change-Id: Icee1c13e2dc8980ee697395b51e758c69e4b3cdf
2017-12-08 01:01:26 +00:00
Jaegeuk Kim
10c9f5d9d3 Merge "core, release: add sload.f2fs for otatools.zip" 2017-12-08 00:57:42 +00:00
Colin Cross
baae1f3054 Merge "Add java modules to soong_to_convert.txt" am: fedcf41cc3 am: 2ea0ecdbfe
am: f2b5f371ff

Change-Id: I2598404303edb51e31aa45a864c657e08513ba29
2017-12-08 00:30:39 +00:00
Tao Bao
79d52f8798 Remove the support for BOARD_HAS_EXT4_RESERVED_BLOCKS.
This is only used in file-based OTA, where we may reserve space on
/system partition. With the deprecation of file-based OTA since O, the
code has become obsolete.

Test: `m dist`
Change-Id: I2bd686b292f93b566fe28a2bcd74c564ffc75dac
2017-12-07 14:36:21 -08:00
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