Commit Graph

1759 Commits

Author SHA1 Message Date
Tao Bao 5db3c58919 Merge "releasetools: Enable a few tests in OtaFromTargetFilesTest." am: 56215ba930
am: dc0ad08e49

Change-Id: I614c6d54d93cf5e3fb6b603b8640f5652c4dd8d3
2019-04-16 07:27:26 -07:00
Tao Bao 69909c96ba releasetools: Enable a few tests in OtaFromTargetFilesTest.
They used to be disabled due to the assertion of search_path in setUp()
function, which is not a prerequisite for most of the tests.

Bug: 112080715
Test: `atest releasetools_test`
Test: TreeHugger
Change-Id: I3cbaf42aa09dba0b87a64e11d97de9b3f7af7a47
2019-04-15 07:33:32 -07:00
Tao Bao 61a4e5bb67 Merge "relesetools: Enable releasetools_test in presubmit." am: 2bfc94ebc6
am: 4a5539cb99

Change-Id: Ic6ab973716fbdafec6673ab6a0082084b78b6dd9
2019-04-14 08:26:22 -07:00
Tao Bao 2bfc94ebc6 Merge "relesetools: Enable releasetools_test in presubmit." 2019-04-14 15:09:19 +00:00
Tao Bao d8cdbb7234 Merge "relesetools: Support running all the unittests with atest." am: 2bb1380ee5
am: 74575ccf97

Change-Id: Ib028768aca6a9dda082616c7fb6a5f23ef8e8d11
2019-04-12 20:11:29 -07:00
Yifan Hong 5c53266156 Merge "FileImage: make thread-safe" am: c7b0df0295
am: c9ab0da8d6

Change-Id: I8c755e464d423551bd67829daa28136494bf0697
2019-04-12 20:10:27 -07:00
Tao Bao 2bb1380ee5 Merge "relesetools: Support running all the unittests with atest." 2019-04-13 01:50:09 +00:00
Yifan Hong 55988c4677 FileImage: make thread-safe
FileImage needs to be thread-safe because multiple
threads gets data from it when an incremental OTA
package is created.

Test: apply incremental OTA on cuttlefish
Bug: 113175337
Change-Id: I31637fce0fbd66f3fa6c5c478da09bae65a52229
2019-04-12 15:38:48 -07:00
Tao Bao 82490d3de1 relesetools: Enable releasetools_test in presubmit.
About half of the testcases rely on external tools (i.e. the ones in
`otatools.zip`, which are external to releasetools module, but still
built by Android). It's WAI as releasetools scripts are mostly for
gluing purpose.

However, the current support in Soong doesn't allow packing the helper
modules as part of the built releasetools_test. This CL adds a decorator
that allows declaring external dependencies in testcases, which will be
skipped while running in presubmit. It doesn't affect local invocation
of `atest releasetools_test`.

Fixes: 112080715
Test: `atest releasetools_test`
Test: TreeHugger; check that releasetools_test is invoked (and test
      passes).
Change-Id: I8fdeb6549023cf5ddeb79d610c7c37cf9f13d3cc
2019-04-12 15:26:35 -07:00
Tao Bao 30e31142ce relesetools: Support running all the unittests with atest.
All the unittests will be built into releasetools_test. One can run the
tests with `atest releasetools_test` or the traditional way
`test_utils.py`. The atest way is recommended, which additionally builds
the required tools.

With the current support in Soong, we can't pack the built tools into
releasetools_test yet. So running `releasetools_test` alone in clound
would fail. Follow-up CLs will address the issue in order to deploy the
tests with TEST_MAPPING.

Bug: 112080715
Test: `atest releasetools_test`
Change-Id: Ica95517a5ab326f4e58fc57c6c2c276cfe882f3c
2019-04-12 15:26:32 -07:00
Yifan Hong d3535bf3da Merge "Allow generating OTA package from non-sparse images." am: fc6948b588
am: a5228f33ef

Change-Id: Iecf0354d30534406799ca008ded3186c2eaccadf
2019-04-12 10:42:33 -07:00
Yifan Hong 8a66a71b06 Allow generating OTA package from non-sparse images.
Test: build OTA package in cuttlefish

Bug: 120041578
Change-Id: I246c38e08376c837b7f126aa19cb8c1d73ed1e26
2019-04-11 14:38:21 -07:00
Tao Bao b31763217c Merge "releasetools: Remove the name restriction in common.GetSparseImage." am: 33b8923ded
am: f84391e27c

Change-Id: If8c1bf239134b58492abe9c063243ef165893c04
2019-04-11 11:12:24 -07:00
Tao Bao 33b8923ded Merge "releasetools: Remove the name restriction in common.GetSparseImage." 2019-04-11 17:51:43 +00:00
Yifan Hong f15b77cfe7 Merge "Reland "Only assert-max-image-size for static partitions."" am: d72873dc41
am: d70f1c637a

Change-Id: I204a6cdeee52ebd8643a223f8bb6f312037d159a
2019-04-10 13:48:34 -07:00
Dan Willemsen b801fa66ad Merge "Stop using build/target -> build/make/target symlink" am: e3ef041244
am: db1e6e9cbc

Change-Id: I3900e2c73b2379a9b4d36576f3e9d02bd4dd24b7
2019-04-10 13:46:36 -07:00
Treehugger Robot d72873dc41 Merge "Reland "Only assert-max-image-size for static partitions."" 2019-04-10 20:09:00 +00:00
Treehugger Robot e3ef041244 Merge "Stop using build/target -> build/make/target symlink" 2019-04-10 19:17:25 +00:00
Yifan Hong 8dddeb057f Merge "Fix DataImage.ReadRangeSet()" am: 3f8c09f8a5
am: 43de6ab1ec

Change-Id: Ia5c3b2b7c93994d1c7c3dc829d9a9a0dce5048f4
2019-04-10 11:17:16 -07:00
Yifan Hong 3f8c09f8a5 Merge "Fix DataImage.ReadRangeSet()" 2019-04-10 17:20:06 +00:00
Tao Bao b2de7d97de releasetools: Remove the name restriction in common.GetSparseImage.
The function used to be serving system and vendor partitions only (as
they were the only partitions using sparse image at the point). The code
itself doesn't rely on anything specific to system/vendor.

Test: python -m unittest test_common
Change-Id: Ia4ecdeedb262f3d9db082128eaf9bab299983333
2019-04-10 10:11:34 -07:00
Tianjie Xu ce37d425d7 Merge "Pass the correct signature size to payload generator" am: 33edbc98c8
am: e74a7b850d

Change-Id: Ifedbab6f1ff8438a11b2e6f342061ef1503cc5f1
2019-04-09 23:12:33 -07:00
Dan Willemsen 0ab1be6fe2 Stop using build/target -> build/make/target symlink
Instead, fully specify build/make/target/... everywhere

Test: treehugger
Change-Id: Idf89b2e6a0b777adbfb6370ea34f35faee6d4965
2019-04-09 21:35:37 -07:00
xunchang 376cc7c452 Pass the correct signature size to payload generator
The signature size will be 512 bytes when signing the payload
with 4096 bits key. This cl determines the key size with
"openssl rsa -modulus"

The new key in testdata is generated by
"openssl genrsa -out testkey 4096"

Bug: 129163830
Test: generate and verify an OTA package
Change-Id: I6662b0a0c553dc0fd84711312a1256b887e332fd
2019-04-09 17:41:00 -07:00
Yifan Hong 6f3eaeb84d Fix DataImage.ReadRangeSet()
It returns a list of one generator object, not a list
of strings.

Test: test_blockimgdiff
Change-Id: I8962c539c2ce3fae90d428b38c4b0e52c5a2cdad
2019-04-09 17:01:53 -07:00
Yifan Hong 8c3dce0c56 Reland "Only assert-max-image-size for static partitions."
This reverts commit 6e099095d1.

Reason for revert: reland the CL

Bug: 122377935
Test: build blueline_mainline

Change-Id: Iee594b64e687decff186c0fa60f82b88608febe9
2019-04-09 10:56:34 -07:00
Florian Mayer a1bfa46cfa Merge "Revert "Only assert-max-image-size for static partitions."" am: 1d26ca95c3
am: 3db0c17630

Change-Id: I5fb9b3f57d7e86fc5644dd059986082ecb382612
2019-04-09 07:20:48 -07:00
Florian Mayer 1d26ca95c3 Merge "Revert "Only assert-max-image-size for static partitions."" 2019-04-09 13:21:23 +00:00
Florian Mayer 6e099095d1 Revert "Only assert-max-image-size for static partitions."
This reverts commit 67e4336912.

Reason for revert: Broke master

Change-Id: I8a5054a42f145881437e2cb5b372f276bfdaa3d2
2019-04-09 09:54:59 +00:00
Yifan Hong 201daffa9a Merge changes from topic "dap_size_check" am: 3c4889fc79
am: 27128f4b10

Change-Id: I3bdebdef8a8bcef7c841967ff9562342ed33a60c
2019-04-08 22:19:03 -07:00
Treehugger Robot 3c4889fc79 Merge changes from topic "dap_size_check"
* changes:
  Only assert-max-image-size for static partitions.
  sparse_img.py --get_partition_size return size of partition
  Revert "Fix dynamic partition size check for devices with recovery"
2019-04-09 02:17:36 +00:00
Yifan Hong ad44636f8b Merge "Build non-sparse super image if necessary." am: 405d3a4ade
am: 28c875581c

Change-Id: Ide57dcc7df9429fe21be750081ce0a7ffda5f589
2019-04-04 16:36:18 -07:00
Yifan Hong 67e4336912 Only assert-max-image-size for static partitions.
assert-max-image-size doesn't make sense for
dynamic partitions, as build_image.py always find the
right size for the output image. Hence:

- build_image.py no longer need to write generated_*_info.txt
  (which contains the size of the image).
- assert-max-image-size on the static BOARD_*IMAGE_PARTITION_SIZE. If
  a partition is dynamic, that variable isn't set, and
  assert-max-image-size becomes a no-op. If the partition is static,
  assert-max-image-size checks the static partition size as it used
  to be.
- Fix read-size-of-partitions to use the size of the partition by
  reading the image directly (instead of using generated_*_info.txt).

For devices without AVB, with DAP enabled, and does not have
RESERVED_SIZE for partitions, because of right sizing, the original
code always warns about approaching size limits. Since such checks
doesn't make sense for dynamic partitions, remove them.

Test: builds on device with dynamic partitions
Test: builds on cuttlefish with DAP enabled (without AVB), no
      more size limit warnings:
WARNING: out/target/product/vsoc_x86/vendor.img approaching size limit (X now; limit X)

Fixes: 122377935
Change-Id: I75e1b8322197cb18cf397d02aefd49d777bb6405
2019-04-04 15:09:51 -07:00
Yifan Hong 7ad83b634e sparse_img.py --get_partition_size return size of partition
Also, move code from build_super_image.py to sparse_img.py.

Test: sparse_img.py on sparse and non-sparse images
Bug: 122377935
Change-Id: Ie91fdfdbb54298ea27eb20d1b5363aeb1470356e
2019-04-04 12:59:00 -07:00
Yifan Hong cb35bd9e51 Build non-sparse super image if necessary.
If TARGET_USERIMAGES_SPARSE_EXT_DISABLED is set, don't provide
--sparse to lpmake, so that a non-sparse super image is built.

Test: build with the flag set.
Fixes: 120041578
Change-Id: I5a26e4c793b0e2ddc89e9c38c8828ac21044e78a
2019-04-03 10:58:25 -07:00
Tao Bao 4117d7df6f Merge "releasetools: Update the embedded AVB pubkey in an APEX." am: 289fa3cea3 am: a24aecb821
am: 013c86f4fc

Change-Id: I137507e29b5f734e3657664ee900e11da672db95
2019-04-02 11:06:39 -07:00
Tao Bao 289fa3cea3 Merge "releasetools: Update the embedded AVB pubkey in an APEX." 2019-04-02 16:56:45 +00:00
Bill Peckham f4f3007461 Merge "Add support merging system and other for the non-A/B configuration." am: 5f4186b000 am: a635376ce1
am: ec4b69a7d6

Change-Id: I3785bd7da43f028e61110bd3780930f5098c1c5a
2019-04-02 06:35:21 -07:00
Tao Bao 9c0f443264 releasetools: Update the embedded AVB pubkey in an APEX.
APEX keys are now embedded in the APEX [1].

[1] https://android-review.googlesource.com/c/platform/system/apex/+/936942

Fixes: 128297564
Test: Run sign_target_files_apks.py on a target_files.zip built with the
      CL above.
Change-Id: I219cc3e6ce6f652537fcc37322c8902f295c1447
2019-04-01 21:30:07 -07:00
Bill Peckham 364c1ccaa5 Add support merging system and other for the non-A/B configuration.
For non-A/B, you must supply the --system-item-list, --other-item-list, and
--system-misc-info-keys parameters approrpriate for merging two partial target
files. Additionally, you must supply the --rebuild-recovery option to correctly
generate the filesystem config and file contexts. With all of these parameters,
the script will generate a merged target files containing the correct recovery
files.

Also fix the --keep-tmp option to be consistent with the other options.

Bug: 122813742
Test: verify that merged target image boots and can perform OTA.
Change-Id: I5a942ac0cd9924fec419a686794a2340304594c8
2019-04-01 14:55:33 -07:00
Daniel Norman b2852ae287 Merge "Adds some tests for merge_target_files." am: 482e67f4ee am: d8414c71b8
am: 1abb3e3371

Change-Id: Ifd603539b53807c347ccb93e2306d4d989693bd5
2019-03-28 21:39:10 -07:00
Daniel Norman 6d82fa3961 Adds some tests for merge_target_files.
Test: python -m unittest test_merge_target_files
Bug: 129262038
Change-Id: Ibcb3b384b81ceaa1924a6cd402a8880bd3cfbba6
2019-03-28 14:43:30 -07:00
Tao Bao f1a39e9170 Merge "releasetools: Remove the sanity check on APEX payload key names." am: c292edc22c am: ea673330bd
am: bce744ef67

Change-Id: I26cf08f34a974eaef13e55af3b590892df713d06
2019-03-27 09:05:58 -07:00
Tao Bao c292edc22c Merge "releasetools: Remove the sanity check on APEX payload key names." 2019-03-27 15:44:29 +00:00
Tao Bao d602409b5d Merge "releasetools: Re-enable verifying AVB-signed images." am: 5ed75d74e3 am: 26b2664dce
am: 06ee461ac2

Change-Id: I9a9e2a6bca07247f43311c7bf95d67f137093c58
2019-03-26 20:50:41 -07:00
Tao Bao 5ed75d74e3 Merge "releasetools: Re-enable verifying AVB-signed images." 2019-03-27 03:20:13 +00:00
Tao Bao 6d9e3da5f9 releasetools: Remove the sanity check on APEX payload key names.
Unlike container keys/certs, we'll always carry full names for APEX
payload signing keys.

Test: Run sign_target_files_apks.py on a target_files.zip with
      mismatching payload signing keys (e.g. shim apexes).
Test: `python -m unittest test_sign_target_files_apks`
Change-Id: Ifa329478f43b4f5ae665821564dbc14af7841330
2019-03-26 13:05:46 -07:00
Tao Bao a81d429928 releasetools: Re-enable verifying AVB-signed images.
This reverts commit 9788b4ed31. All the
blocking issues have been addressed.

Fixes: 120517892
Test: Run validate_target_files.py on crosshatch signed
      target_files.zip.
Change-Id: I95de241e159998e002dedddafea65953b1a1b263
2019-03-26 12:13:37 -07:00
Daniel Norman de01f0fdfe Merge "Merges dynamic partition misc_info.txt keys from both system and other." am: c21a8448d1 am: 081eedce39
am: d857025380

Change-Id: I9d788369617dbca5df4bbaf24fbcc9b505d0e18e
2019-03-25 16:35:11 -07:00
Daniel Norman c21a8448d1 Merge "Merges dynamic partition misc_info.txt keys from both system and other." 2019-03-25 23:15:09 +00:00