Commit Graph

3951 Commits

Author SHA1 Message Date
Tao Bao aeb3125ac3 Fix the broken script in AssertFingerprintOrThumbprint.
am: 9c6ab6c49b

Change-Id: I2259869457587dda3a1b3ed54d77e5a1934c8436
2017-06-05 23:18:46 +00:00
Tao Bao 9c6ab6c49b 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
(cherry picked from commit d2d01e519e)
2017-06-05 13:20:42 -07:00
Tao Bao a1980abe1f Merge "DO NOT MERGE Revert "Revert "releasetools: Support OTAs that have OEM properties changes.""" into cw-f-dev
am: fccf4ec06e

Change-Id: If7d5b3cd4de5f558275453d0d4a599995390a4a0
2017-06-02 22:50:15 +00:00
Tao Bao fccf4ec06e Merge "DO NOT MERGE Revert "Revert "releasetools: Support OTAs that have OEM properties changes.""" into cw-f-dev 2017-06-02 22:42:27 +00:00
Julius D'souza 92aa9636ad Merge "DO NOT MERGE: Add the option to reserve headroom for partition images. This is useful for devices with low disk space with different build variants." into cw-f-dev
am: 1590301a9b

Change-Id: I85bbf6b85c42ff3e9e69565812f8a2b8a0f41833
2017-06-02 03:14:54 +00:00
Tao Bao 7fc951ca6a DO NOT MERGE Revert "Revert "releasetools: Support OTAs that have OEM properties changes.""
This CL fixes the bug in [1] (copy-paste error) and reenables it.

We need to handle a special case that an OTA goes from a source build
without OEM properties to a target build with those properties (or vice
versa). Add support in OTA scripts to deal the case properly, by a)
using two oem_props variables to handle source and target builds
respectively; b) adjusting the fingerprint/thumbprint assertions to
allow a mix of both.

[1] commit c086370440

Bug: 62252466
Change-Id: I98118d77d5a0ff694fa1ee33602b5ee5e048599b
(cherry picked from commit eee30d97dde42416a1762c161ed7217d4e7ebf2c6)
2017-06-01 14:59:46 -07:00
Julius D'souza af6d68e80d DO NOT MERGE: Add the option to reserve headroom for
partition images. This is useful for devices with low
disk space with different build variants.

This is a manual cherry-pick from aosp-master.

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

Change-Id: I048b45e4b7b68ed2e855ea852b09ee1fdc6ad35d
2017-05-15 13:36:07 -07:00
Tao Bao 4b066f1dcc releasetools: Add support for --override_timestamp. am: 9f884e6c55 am: 9ee7071553 am: d5de271e01
am: 839cdc66b1

Change-Id: Ibbe218523096ec9c783ea4062a0cce0208851f95
2017-03-16 23:33:44 +00:00
Tao Bao 839cdc66b1 releasetools: Add support for --override_timestamp. am: 9f884e6c55 am: 9ee7071553
am: d5de271e01

Change-Id: Ibb5be92d09cb02181ec92d939f5851d26f1df345
2017-03-16 23:26:44 +00:00
Tao Bao d5de271e01 releasetools: Add support for --override_timestamp. am: 9f884e6c55
am: 9ee7071553

Change-Id: I58f6108d8d620d39d673e2be9489cb13b50fbbb0
2017-03-16 23:24:13 +00:00
Tao Bao 9ee7071553 releasetools: Add support for --override_timestamp.
am: 9f884e6c55

Change-Id: Ie17ff6bffa91d16bbb4a3de123fc8aa97a35d266
2017-03-16 23:21:13 +00:00
Tao Bao aaabaf74d6 Merge "releasetools: Support generating downgrade A/B OTAs." into nyc-dev am: 5a4508bcef am: e7847765a6 am: a7dcbfb2d8
am: 00f2147e70

Change-Id: Ic7b779c390f9611d31d644b0dbf0914521a479ca
2017-03-16 18:35:24 +00:00
Tao Bao 00f2147e70 Merge "releasetools: Support generating downgrade A/B OTAs." into nyc-dev am: 5a4508bcef am: e7847765a6
am: a7dcbfb2d8

Change-Id: I1958c8e75f83812ed493221fdf2fb74ee406becb
2017-03-16 18:30:53 +00:00
Tao Bao 9f884e6c55 releasetools: Add support for --override_timestamp.
We use the timestamps in builds to determine a downgrade, which might
not be always the truth. For examples, two builds cut from different
branches may carry timestamps in a reverse order. An incremental package
won't be able to be pushed nor applied, based on the timestamp
comparison.

We used to handle such a case with manual work, by setting the
post-timestamp to (pre-timestamp + 1) in the package metadata. This CL
automates the process by adding a new flag --override_timestamp.

Note that it doesn't change anything in the installed image, but only
affects the assertions for pushing / installing the package.

With the change in this CL:
 - If it's a downgrade without any extra flag, fail the package
   generation (we only print warnings prior to this CL);
 - If it's a downgrade with --downgrade flag, generate a downgrade
   package with forced data wipe (same as before);
 - If it's a downgrade with --override_timestamp, generate a normal
   incremental with hacked timestamp (pre-timestamp + 1) (new in this CL
   to avoid the manual change);
 - If it's not a downgrade but with any of the above two flags specified,
   fail the package generation.

Bug: 33744169
Test: Generate an incremental from builds with reversed timestamps.
Change-Id: I8b187d32708b4a7c3e20f8c6adb8f9527b73b965
Merged-In: I8b187d32708b4a7c3e20f8c6adb8f9527b73b965
(cherry picked from commit 3e6161a3b3)
2017-03-16 11:26:06 -07:00
Tao Bao a7dcbfb2d8 Merge "releasetools: Support generating downgrade A/B OTAs." into nyc-dev am: 5a4508bcef
am: e7847765a6

Change-Id: Icb06ee24b3c29ff095b127a4148b945e886859ac
2017-03-16 18:25:54 +00:00
Tao Bao e7847765a6 Merge "releasetools: Support generating downgrade A/B OTAs." into nyc-dev
am: 5a4508bcef

Change-Id: If09ef383865b95b7dd65522d7c369b98144c5520
2017-03-16 18:22:54 +00:00
Tao Bao 99c17252ac releasetools: Support generating downgrade A/B OTAs.
We already support generating downgrade OTAs for non-A/B devices (with
mandatory data wipe), but we have missed the --downgrade flag in A/B OTA
path.

This CL factors out the function that writes the downgrade metadata, and
fixes the path for generating A/B OTAs.

Bug: 35094540
Bug: 36183651
Test: Generate incrementals with --downgrade for A/B and non-A/B OTAs.
Change-Id: I30b9bf83e69e8aba3be666507681b555db6ab743
Merged-In: I30b9bf83e69e8aba3be666507681b555db6ab743
(cherry picked from commit b31892e5de)
2017-03-16 16:47:10 +00:00
Tao Bao 869793b198 Revert "Revert "releasetools: Allow using futility-host to sign old TF.zip."" am: 77620b5a45 am: 9eea2cde67 am: 8fa3351890
am: dce7c28f7c

Change-Id: I502e7ac469acbfb6802c7fb91e37ec6d716d4147
2017-02-27 00:54:40 +00:00
Tao Bao dce7c28f7c Revert "Revert "releasetools: Allow using futility-host to sign old TF.zip."" am: 77620b5a45 am: 9eea2cde67
am: 8fa3351890

Change-Id: I8b37357d63c00627713ae7597157d8d2aa90fcb3
2017-02-27 00:51:38 +00:00
Tao Bao 8fa3351890 Revert "Revert "releasetools: Allow using futility-host to sign old TF.zip."" am: 77620b5a45
am: 9eea2cde67

Change-Id: Ib5c77170d06bfe4f2289d2565e9e56b8b3c0b080
2017-02-27 00:48:09 +00:00
Tao Bao 9eea2cde67 Revert "Revert "releasetools: Allow using futility-host to sign old TF.zip.""
am: 77620b5a45

Change-Id: Id9071f867b430c74231003be3b40b43aa4f72141
2017-02-27 00:44:38 +00:00
Tao Bao 77620b5a45 Revert "Revert "releasetools: Allow using futility-host to sign old TF.zip.""
This reverts commit d6145b6a16.

The cause of the earlier breakage has been identified and fixed by
commit 4b577413ff.

Bug: 35467608
Test: lunch ryu-userdebug; m dist otatools-package
(cherry picked from commit 4f30f7cfa1)
2017-02-25 08:38:51 -08:00
Alain Vongsouvanh 4d57163b24 DO NOT MERGE releasetools: allow for multiple OEM property values.
am: 1c50b8154d

Change-Id: Ibfc4cfb6e2b60687eac9e9475f86d904444f071a
2017-02-23 22:53:27 +00:00
Alain Vongsouvanh 1c50b8154d DO NOT MERGE releasetools: allow for multiple OEM property values.
This CL changes the --oem_settings flag to allow a comma seperated list of
property files. All property values will be used when asserting properties such
as ro.product.name.

For example, if two property files are provided with ro.product.name values of
"sprout" and "sprout_a", the resulting otapackage will check that the device's
ro.product.name property matches at least one of them.

Bug: 34191373
Test: manual

(cherry-picked and adapted from AOSP commit 7f804ba71f)

Change-Id: I954673511be8f0929982235cc9cbfbd85a9ee1f4
2017-02-22 02:00:13 +00:00
Tao Bao 55f185e0a4 Merge "Revert "releasetools: Allow using futility-host to sign old TF.zip."" into nyc-dev am: b0df1ef7ac am: 983c979c25 am: bd6d03ab18
am: e64f52ebcd

Change-Id: I5ccd6ba60e5e9eb3e0875e99630db583a178a569
2017-02-21 20:37:24 +00:00
Tao Bao e64f52ebcd Merge "Revert "releasetools: Allow using futility-host to sign old TF.zip."" into nyc-dev am: b0df1ef7ac am: 983c979c25
am: bd6d03ab18

Change-Id: I488b164ae8c3a93858a293e2a538ff6b8742736c
2017-02-21 20:35:25 +00:00
Tao Bao bd6d03ab18 Merge "Revert "releasetools: Allow using futility-host to sign old TF.zip."" into nyc-dev am: b0df1ef7ac
am: 983c979c25

Change-Id: I938ee86611ea8c452c07324e2f3c6a9b0180cb7e
2017-02-21 20:33:25 +00:00
Tao Bao 983c979c25 Merge "Revert "releasetools: Allow using futility-host to sign old TF.zip."" into nyc-dev
am: b0df1ef7ac

Change-Id: I3924b44e75aa0f8f18129212dd80fd843f6a6a47
2017-02-21 20:31:25 +00:00
Tao Bao d6145b6a16 Revert "releasetools: Allow using futility-host to sign old TF.zip."
Broke ryu targets.

This reverts commit 31a0de00a4.

Change-Id: I3ffcdc604a1cb92c86c574b5cd358d0148430d55
2017-02-21 20:27:27 +00:00
Tao Bao ea88a3f3fa releasetools: Allow using futility-host to sign old TF.zip. am: 31a0de00a4 am: a9bdf8716f am: ae2f5abf06
am: 79d719b313

Change-Id: Ib858be8c430acf21d6aa175481ee68bb3e477caa
2017-02-21 17:50:18 +00:00
Tao Bao 79d719b313 releasetools: Allow using futility-host to sign old TF.zip. am: 31a0de00a4 am: a9bdf8716f
am: ae2f5abf06

Change-Id: I514c69dca1aede0fe047682dab9b11e7263d7634
2017-02-21 17:48:16 +00:00
Tao Bao ae2f5abf06 releasetools: Allow using futility-host to sign old TF.zip. am: 31a0de00a4
am: a9bdf8716f

Change-Id: I411b26baf0cd7d74ec6c8c80a12f0499d017a360
2017-02-21 17:46:45 +00:00
Tao Bao a9bdf8716f releasetools: Allow using futility-host to sign old TF.zip.
am: 31a0de00a4

Change-Id: I46041e6e5e37c451f8f23dca773850c025aa18b2
2017-02-21 17:45:15 +00:00
Tao Bao 31a0de00a4 releasetools: Allow using futility-host to sign old TF.zip.
Commit e98fb7a8d3 switched to using
futility-host instead of the prebuilt futility. This CL adds support to
handle signing old TF.zip that still says "futility=prebuilt/..." in
META/misc_info.txt.

Bug: 35467608
Test: Generate otatools.zip and sign an old ryu TF.zip.
Change-Id: I48a9cc918c7afce361e1ec9bc4f85f74fa92566e
(cherry picked from commit 4f104d1b94)
2017-02-17 23:36:00 -08:00
Patrick Tjin 37a73e0f09 build_image: add support for specifying number of inodes [DO NOT MERGE]
Add support for specifying number of inodes when creating
system, vendor, oem partitions.  These are all read-only
and have no use for extra inodes.  Removing extra inodes
saves a lot of space.

Bug: 32246383
Bug: 33252070
Bug: 33428604
Change-Id: I13f1d4614b64a4abc752c42a1c65d3d151481c21
2017-01-05 11:19:43 -08:00
Tao Bao 3014c885b2 Build recovery-two-step.img for two-step OTAs. am: 47ec5ab561
am: eb9de30596

Change-Id: Idd4b559d9d5f16b6e401ec6177036be1be9cb0d6
2016-12-02 16:53:04 +00:00
Tao Bao eb9de30596 Build recovery-two-step.img for two-step OTAs.
am: 47ec5ab561

Change-Id: I5288993e010fca9abab66a6aece45a48d1844d43
2016-12-02 16:46:33 +00:00
Tao Bao 47ec5ab561 Build recovery-two-step.img for two-step OTAs.
In two-step OTAs, we write recovery image to /boot as the first step so
that we can reboot from there and install a new recovery image to
/recovery. However, bootloader will show "Your device is corrupt"
message when booting /boot with the recovery image. Because the recovery
image encodes the path of "/recovery" as part of the signature metadata,
which fails the verified boot.

This CL generates a special "recovery-two-step.img" in addition to the
regular recovery.img. This image encodes "/boot" when being signed,
which will be flashed to /boot at stage 1/3 in a two-step OTA.

Here are the desired changes:

- 'IMAGES/recovery-two-step.img' exists in target_files.zip for non-A/B
targets (e.g. bullhead). The image should not exist for targets that
don't have a recovery partition (e.g. A/B devices like sailfish).

- <device>-img.zip should not contain 'recovery-two-step.img'.

- Nothing should change when building non-two-step OTAs. For two-step
OTAs, 'recovery-two-step.img' should be included in the OTA package;
'updater-script' should flash this image to /boot at stage 1/3.

- When building a two-step OTA with an input TF.zip that doesn't have
  IMAGES/recovery-two-step.img, it should use the existing
  IMAGES/recovery.img instead.

Bug: 32986477
Test: Tested the steps above on bullhead and sailfish.
Change-Id: I34e6c599bcf2011d4cd5c926999418b3975d6d0f
(cherry picked from commit d42e97ebb4)
2016-12-01 17:55:44 -08:00
Sami Tolvanen 628e032773 DO NOT MERGE: build_image: add padding to match partition size
am: 9a675c94d3

Change-Id: I6cc9b531eb3494146355c7cc50e7e4cb0bf4a6b4
2016-11-20 06:26:56 +00:00
Zheng Zhang 28b96d1470 Merge "DO NOT MERGE: build_image: add padding to match partition size" into cw-f-dev 2016-11-20 06:22:17 +00:00
Tao Bao 02dd0ab453 releasetools: Use java_path in sign_target_files_apks.py. am: cd4f7c96c0 am: 6414a94c50 am: 4722fc1734
am: e6a27e7e69

Change-Id: I3695dab4d258a3a97163248021f5e65caa0b5527
2016-11-16 20:21:51 +00:00
Tao Bao e6a27e7e69 releasetools: Use java_path in sign_target_files_apks.py. am: cd4f7c96c0 am: 6414a94c50
am: 4722fc1734

Change-Id: Ia393a720694b21eb9ebcda0361630605e792470f
2016-11-16 20:14:20 +00:00
Tao Bao 4722fc1734 releasetools: Use java_path in sign_target_files_apks.py. am: cd4f7c96c0
am: 6414a94c50

Change-Id: I6cf1cd53ca96b30df9a2621c12cbcbe05f99297c
2016-11-16 20:07:20 +00:00
Tao Bao 6414a94c50 releasetools: Use java_path in sign_target_files_apks.py.
am: cd4f7c96c0

Change-Id: I21cf5519a51e9a9ebb86c98ef9a50e2d7e86b9e5
2016-11-16 19:59:19 +00:00
Sami Tolvanen 9a675c94d3 DO NOT MERGE: build_image: add padding to match partition size
For some partition sizes, we currently build an image that's 1-2
blocks smaller than the actual partition, which causes fs_mgr to
not find metadata. This change adds padding to FEC metadata that
correctly positions the metadata header at the end.

Bug: 28865197
Bug: 32789520
Change-Id: Ie0e044715a9c5ae8ba395e7d2ff9fbd7cffc0b4c
(cherrypicked from commit 433905f50e)
2016-11-10 18:18:09 +00:00
Tao Bao cd4f7c96c0 releasetools: Use java_path in sign_target_files_apks.py.
Prior to this CL, it was calling the hard-coded "java" although it was
accepting a "--java_path" option.

Also switch OPTIONS.java_args from string to list. Otherwise it won't
work when providing multiple args.

Bug: 32737832
Test: Specify "--java_path=" and "--java_args" when invoking
      sign_target_files_apks.py with "-v". Check the commands being
      called.
Change-Id: Id7ef98e778646d532027434de7fba9b7a104dbd0

(cherry picked from commit e95540e060)
2016-11-09 17:05:28 -08:00
Tao Bao b4cd33fac9 releasetools: Make BBOTA incremental generation repeatable.
set() doesn't keep elements according to the order of insertion. So
Transfers managed with set() in intermediate steps may not appear in the
same order across runs. This leads to slightly different output packages
when generating the same incremental OTA.

This CL fixes the issue by replacing set() with OrderedDict() in
blockimgdiff.GenerateDigraph() and blockimgdiff.FindVertexSequence().

It also adds a testcase that ensures blockimgdiff.GenerateDigraph()
preserves the insertion order for Transfer.goes_after set.

Bug: 32220816
Test: ota_from_target_files.py gives identical package when running
multiple times.

Change-Id: I56d551e5ca926993ab46896e33c80e0ce42e506a
(cherry picked from commit 3348228423)
2016-11-06 00:37:29 -07:00
Sasha Levitskiy c63565970c build: tools: Add json collection of installed files with hashes.
am: 3c97fa78cd

Change-Id: I5eb12808bbb82a4b9aeaa76b32d971ee4d2643ba
2016-10-27 20:56:44 +00:00
Alexander Levitskiy 343d72fac8 Merge "build: tools: Add json collection of installed files with hashes." into cw-f-dev 2016-10-27 20:51:15 +00:00
Tao Bao 53a1acf53b releasetools: Support verity signer args. am: c7814837a0 am: 8a6d94c9aa
am: b31f486d75

Change-Id: I871181398a41da89f1851a0b9a5599de23f6100e
2016-10-26 22:22:58 +00:00