Commit graph

6217 commits

Author SHA1 Message Date
Yifan Hong
50db54519e Allow generating OTA package from non-sparse images.
Test: build OTA package in cuttlefish

Bug: 120041578
Bug: 113175337
Change-Id: I246c38e08376c837b7f126aa19cb8c1d73ed1e26
Merged-In: I246c38e08376c837b7f126aa19cb8c1d73ed1e26
2019-04-12 10:48:29 -07:00
Yifan Hong
508850e298 Fix DataImage.ReadRangeSet()
It returns a list of one generator object, not a list
of strings.

Test: test_blockimgdiff
Bug: 113175337

Change-Id: I8962c539c2ce3fae90d428b38c4b0e52c5a2cdad
Merged-In: I8962c539c2ce3fae90d428b38c4b0e52c5a2cdad
2019-04-12 10:48:21 -07:00
Tao Bao
222bba6253 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
Bug: 113175337

Change-Id: Ia4ecdeedb262f3d9db082128eaf9bab299983333
Merged-In: Ia4ecdeedb262f3d9db082128eaf9bab299983333
2019-04-12 10:47:53 -07:00
TreeHugger Robot
f9dca5e1d8 Merge "Convert oemaids_headers / passwd / group to Soong" into qt-dev 2019-04-12 16:06:59 +00:00
Tianjie Xu
cd797a289f Merge "Pass the correct signature size to payload generator" into qt-dev 2019-04-12 01:21:45 +00:00
Dan Willemsen
b9d45c7d47 Convert oemaids_headers / passwd / group to Soong
Bug: 118089258
Test: m oemaids_header_gen oemaids_headers passwd group
Change-Id: Ie3b92a499b44391e0692da5d9ad067089a62aabb
Merged-In: Ie3b92a499b44391e0692da5d9ad067089a62aabb
(cherry picked from commit d32e6d1314)
2019-04-11 16:41:22 -07:00
TreeHugger Robot
c028b0e155 Merge "docker: update sha256sum for repo version 1.25" into qt-dev 2019-04-11 21:52:23 +00:00
xunchang
3c5de18f5d 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
(cherry picked from commit 376cc7c452)
2019-04-11 21:04:28 +00:00
Pavel Salomatov
a77dea9865 docker: update sha256sum for repo version 1.25
Fixes: 130366091
Change-Id: Iaec4b2429c61aa2d804e56a88cf66ae543a29805
Merged-In: Iaec4b2429c61aa2d804e56a88cf66ae543a29805
(cherry picked from commit 4a7f6daa85)
2019-04-11 13:38:05 -07:00
Yifan Hong
0d8e89b5f8 Reland "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)

This reverts commit 6e099095d1.

Reason for revert: reland the CL

Bug: 122377935
Test: build blueline_mainline

Change-Id: Iee594b64e687decff186c0fa60f82b88608febe9
Merged-In: Iee594b64e687decff186c0fa60f82b88608febe9
2019-04-11 10:12:27 -07:00
Yifan Hong
cf9f9bedb8 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
Merged-In: Ie91fdfdbb54298ea27eb20d1b5363aeb1470356e
2019-04-11 10:12:27 -07:00
Yifan Hong
c3664703f8 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.
Bug: 120041578
Change-Id: I5a26e4c793b0e2ddc89e9c38c8828ac21044e78a
Merged-In: I5a26e4c793b0e2ddc89e9c38c8828ac21044e78a
2019-04-04 16:36: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
a24aecb821 Merge "releasetools: Update the embedded AVB pubkey in an APEX."
am: 289fa3cea3

Change-Id: Iaf4497f41f38fff7bf646f923f61b7a8199e5cfc
2019-04-02 10:22:53 -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
Bill Peckham
a635376ce1 Merge "Add support merging system and other for the non-A/B configuration."
am: 5f4186b000

Change-Id: I347d05f8a60c5f63ba591aed8d16b078bfdfb840
2019-04-02 06:24:25 -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
d8414c71b8 Merge "Adds some tests for merge_target_files."
am: 482e67f4ee

Change-Id: I246a1e6f2afceb42a5aca56b46291fbd37860ac5
2019-03-28 21:30:49 -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
ea673330bd Merge "releasetools: Remove the sanity check on APEX payload key names."
am: c292edc22c

Change-Id: I3ff4de4afde65971f9967db73a6373107517c8fa
2019-03-27 08:51:33 -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
26b2664dce Merge "releasetools: Re-enable verifying AVB-signed images."
am: 5ed75d74e3

Change-Id: I45ff35f4b64967f5dd0c539b5abf535ab648408a
2019-03-26 20:36:22 -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
081eedce39 Merge "Merges dynamic partition misc_info.txt keys from both system and other."
am: c21a8448d1

Change-Id: I91afb67ab90b8a6f0c54138b299481403e4b1c2d
2019-03-25 16:26:53 -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
Anton Hansson
db064f1f1a Merge "Put DEVICE/PRODUCT overlays in different partitions" am: 94fa0e75cb am: fd946975d0
am: 691c979b62

Change-Id: I1e9c9b79b931229ed3142d1921d784a6bad7baed
2019-03-25 02:46:53 -07:00
Anton Hansson
fd946975d0 Merge "Put DEVICE/PRODUCT overlays in different partitions"
am: 94fa0e75cb

Change-Id: I490160177bd0084721212d832dff8c0d721e2e14
2019-03-25 02:32:55 -07:00
Anton Hansson
94fa0e75cb Merge "Put DEVICE/PRODUCT overlays in different partitions" 2019-03-25 09:25:47 +00:00
Tao Bao
1ece90be3b Merge changes I91bd3dce,I2e941fd9
am: 9a5093e5f9

Change-Id: Ic708931f9ef0ed9a23c8e7146013a7b8dea9e647
2019-03-24 10:44:21 -07:00
Tao Bao
ffc9a30946 releasetools: Fix alignment issue when signing APEXes.
Previously it was following a wrong order by doing `zipalign` after
calling SignApk, which effectively compromised the signature. This CL
corrects the logic, and follows the same flow as in build system:
 - Pack APEX file;
 - `zipalign -f 4096`;
 - Call SignApk to sign the container with `-a 4096` flag.

Bug: 129148142
Test: Run sign_target_files_apks.py on taimen target_files.zip. Boot the
      image after signing.
Change-Id: I91bd3dce4f45c1891c5e122212a699f4808618fa
(cherry picked from commit 0e06cb0a8b)
2019-03-23 10:27:43 -07:00
Tao Bao
0e06cb0a8b releasetools: Fix alignment issue when signing APEXes.
Previously it was following a wrong order by doing `zipalign` after
calling SignApk, which effectively compromised the signature. This CL
corrects the logic, and follows the same flow as in build system:
 - Pack APEX file;
 - `zipalign -f 4096`;
 - Call SignApk to sign the container with `-a 4096` flag.

Bug: 129148142
Test: Run sign_target_files_apks.py on taimen target_files.zip. Boot the
      image after signing.
Change-Id: I91bd3dce4f45c1891c5e122212a699f4808618fa
2019-03-22 23:25:12 -07:00
Daniel Norman
19b9fe9fdf Merges dynamic partition misc_info.txt keys from both system and other.
To build a complete list of the dynamic partitions and partitions
groups, we need to merge the contribution from the system and other
target files.

Bug: 127687287
Test: Running merge_target_files.py and observing partition lists are
merged as expected.
Change-Id: I5bb9bd0e3179d48c9bfacdb3aca8253158f61cf6
2019-03-22 14:46:01 -07:00
Tao Bao
1e4cbfaf5c releasetools: Fix an issue in handling PRESIGNED APEX keys.
For PRESIGNED APEXes, we should keep carrying the matching public keys
at /system/etc/security/apex.

Bug: 129148142
Test: Run sign_target_files_apks.py on a target_files.zip with presigned
      APEXes. Check the output zip.
Change-Id: I2e941fd9b10e99d2db9df1e5308cbbe8c760177b
(cherry picked from commit bf3fb024cd)
2019-03-22 14:11:24 -07:00
Tao Bao
bf3fb024cd releasetools: Fix an issue in handling PRESIGNED APEX keys.
For PRESIGNED APEXes, we should keep carrying the matching public keys
at /system/etc/security/apex.

Bug: 129148142
Test: Run sign_target_files_apks.py on a target_files.zip with presigned
      APEXes. Check the output zip.
Change-Id: I2e941fd9b10e99d2db9df1e5308cbbe8c760177b
2019-03-22 13:16:15 -07:00
Anton Hansson
cb8276fa93 Put DEVICE/PRODUCT overlays in different partitions
This change changes auto-generated RROs from DEVICE_PACKAGE_OVERLAYS
to be generated in the vendor partition, as opposed to /product where
they were generated in the past.

Note that PRODUCT_PACKAGE_OVERLAYS continue generating RRO packages
to /product, which means that a single app can be overlayed from
different partitions. These RROs have been given module and package
names based on their location.

Bug: 127758779
Test: verify noop on presubmit targets
Change-Id: I5cee70e28e3969e67b2d83eaf25d9c6e3a11102d
2019-03-22 13:25:20 +00:00
Tao Bao
bc3ebf453a Merge changes I662aab3d,I5e741c27 am: c62b9a2347 am: d2e70241f3
am: fe9988cd14

Change-Id: I134c5fcad0380c90d670a110f473f02700c15d65
2019-03-21 10:14:31 -07:00
Tao Bao
d2e70241f3 Merge changes I662aab3d,I5e741c27
am: c62b9a2347

Change-Id: Iae61ac00bce4c9189582c301afd562263311f0f7
2019-03-21 10:02:01 -07:00
Tao Bao
c62b9a2347 Merge changes I662aab3d,I5e741c27
* changes:
  Revert^2 "releasetools: check_target_files_signatures.py checks APEXes."
  releasetools: common.UnzipTemp() filters out non-matching patterns.
2019-03-21 16:38:04 +00:00
Logan Chien
4a8096ef45 Merge "Update check_elf_file.py for clang-r353983" am: 81589605fd am: 5d00745b0a
am: d5050f82e4

Change-Id: I7ca40fac3d66b2918a0c0b2e808bf5362ceb93a7
2019-03-21 01:29:09 -07:00
Logan Chien
5d00745b0a Merge "Update check_elf_file.py for clang-r353983"
am: 81589605fd

Change-Id: I0bdb631d5eeae4fd834efa5255ae472d76763935
2019-03-21 01:19:49 -07:00
Logan Chien
81589605fd Merge "Update check_elf_file.py for clang-r353983" 2019-03-21 08:05:16 +00:00
Vic Yang
5c38a6234d Merge changes from topic "vndk-no-vendor-variant" am: 30dda1da5e am: 38f68f7a2a
am: 1485ea8707

Change-Id: Ia7eaea708743f9f42f6fe605cb0edba7db36db4d
2019-03-20 21:58:12 -07:00