Commit Graph

6486 Commits

Author SHA1 Message Date
Dan Willemsen d32e6d1314 Convert oemaids_headers / passwd / group to Soong
Bug: 118089258
Test: m oemaids_header_gen oemaids_headers passwd group
Change-Id: Ie3b92a499b44391e0692da5d9ad067089a62aabb
2019-04-10 20:46:33 -07: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
Yifan Hong d70f1c637a Merge "Reland "Only assert-max-image-size for static partitions.""
am: d72873dc41

Change-Id: I3ee60fcbd5c4dd0b7915f9927e4cc3414d5efe49
2019-04-10 13:23:36 -07:00
Dan Willemsen db1e6e9cbc Merge "Stop using build/target -> build/make/target symlink"
am: e3ef041244

Change-Id: Ia2e596189bde8cda5de576a9b279163f80073a4d
2019-04-10 13:15:41 -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 43de6ab1ec Merge "Fix DataImage.ReadRangeSet()"
am: 3f8c09f8a5

Change-Id: If01f367cd3c244d01288d0eddb7bb17aec2b6c43
2019-04-10 11:14:12 -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
Tianjie Xu e74a7b850d Merge "Pass the correct signature size to payload generator"
am: 33edbc98c8

Change-Id: I8e1fca4e043a580f71ddb026365f41deb74bb55d
2019-04-09 23:07:21 -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 3db0c17630 Merge "Revert "Only assert-max-image-size for static partitions.""
am: 1d26ca95c3

Change-Id: I82d0e53f7a817f661b46556b2e59279e132119ad
2019-04-09 06:31:45 -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
Yifan Hong 27128f4b10 Merge changes from topic "dap_size_check"
am: 3c4889fc79

Change-Id: I58130717a9aaf1a70ecebb85eaf783e1d3d2f504
2019-04-08 21:20:02 -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 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
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 28c875581c Merge "Build non-sparse super image if necessary."
am: 405d3a4ade

Change-Id: I3b9c5489d9cdd60a57fc9093ff1083cba94075bf
2019-04-04 16:22:37 -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 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 5cc0abb02f releasetools: Update the comment on common.AVB_PARTITIONS.
Bug: 123611926
Test: TreeHugger
Change-Id: I501e0921ae75adec96bda38af5a538ecf7764a82
2019-03-21 10:32:45 -07: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
Bowgo Tsai dc80ab1bf0 Merge "Moving system_other key into product.img" am: 7e87c72fb0 am: 916e876f7a
am: 44446b2a50

Change-Id: Ic704ac1ee1b9e956753d5b67fb39046ac608d721
2019-03-20 21:45:30 -07:00
Vic Yang 38f68f7a2a Merge changes from topic "vndk-no-vendor-variant"
am: 30dda1da5e

Change-Id: I646d55e6195a24530bf22d1e7588b2dd99b27eba
2019-03-20 21:39:57 -07:00
Bowgo Tsai 916e876f7a Merge "Moving system_other key into product.img"
am: 7e87c72fb0

Change-Id: I29ba3d2056fca68a356cb26a8e17b29d415ed08e
2019-03-20 21:36:24 -07:00
Vic Yang 30dda1da5e Merge changes from topic "vndk-no-vendor-variant"
* changes:
  Add support for no-vendor-variant VNDK
  Add module-target-built-files function
2019-03-21 04:30:47 +00:00
Treehugger Robot 7e87c72fb0 Merge "Moving system_other key into product.img" 2019-03-21 04:26:21 +00:00
Tao Bao 359862db12 Revert^2 "releasetools: check_target_files_signatures.py checks APEXes."
This reverts commit 5516d37f41.

The previous issue in unzipping non-matching files has been addressed
with commit a49054ca2f2959f50f3188914ec0faebc90ebcbe. This CL rolls
forward to allow dumping container certifcates for APEXes.

Bug: 128848294
Test: Run check_target_files_signatures.py on target_files.zips w/ and
      w/o APEX files.
Change-Id: I662aab3d96fc40ac8e5e206e32b73ac763220b70
2019-03-20 12:40:34 -07:00
Tao Bao 0ff15de32a releasetools: common.UnzipTemp() filters out non-matching patterns.
common.UnzipTemp() calls `unzip` to do the unzipping, which will
complain if there's non-existent names in the given list. Prior to this
CL, callers had to do the work to remove non-existent entries. This CL
filters out the given patterns in common.UnzipTemp()/common.UnzipToDir()
to make callers' works easier.

Bug: 128848294
Test: `m dist` with aosp_taimen-userdebug (which calls
      ota_from_target_files.py on a target_files.zip that doesn't
      contain RADIO/*).
Test: `python -m unittest test_common.CommonZipTest`
Change-Id: I5e741c27ea8d0b8126c398a7e1b56a8deb4a3d7f
2019-03-20 12:38:09 -07:00
Vic Yang 51512c558c Add support for no-vendor-variant VNDK
When TARGET_VNDK_USE_CORE_VARIANT is set to true, the vendor variant of
VNDK libraries are by default not installed.  Instead, the core variant
will be used by vendor binaries at runtime.

To ensure the core variant of VNDK libraries are installed, we also add
a flag LOCAL_VNDK_DEPEND_ON_CORE_VARIANT to indicate that the vendor
variant module depends on the core variant module.  This flag should be
set by Soong for all VNDK libraries without the vendor variant
installed.  When the flag is set, the vendor variant binary is also
compared against the core variant binary to ensure they are
functionally identical.

As we are merging the two variants for some libraries, we need a new
link type to denote a module is usable as both native:vndk and
native:platform.  We add native:platform_vndk for this.

Bug: 119423884
Test: With the corresponding Soong change, build with
      TARGET_VNDK_USE_CORE_VARIANT set to true.
Test: Add a dummy VNDK library and a dummy vendor binary that depends
      on it.  Build with no-vendor-variant VNDK and check the core
      variant is installed.
Test: Add conditional compilation based on __ANDROID_VNDK__ in the
      dummy VNDK library and check build fails.

Change-Id: I40000f2728e8193212113c1ee950e9d697f2d40d
2019-03-20 10:23:04 -07:00
Anton Hansson 0a766e9afa Merge "Refactor generate_enforce_rro" am: bec4aa868a am: f5c74dd470
am: 5784c16fc4

Change-Id: I3d12f8a0f50429e8f54631bedec7e6caf667fb61
2019-03-20 09:23:38 -07:00
Anton Hansson f5c74dd470 Merge "Refactor generate_enforce_rro"
am: bec4aa868a

Change-Id: I1f616f8020f85df60b89cdc3d0f489e9111d0454
2019-03-20 09:10:12 -07:00
Anton Hansson bec4aa868a Merge "Refactor generate_enforce_rro" 2019-03-20 15:18:19 +00:00
Anton Hansson 3ef0773932 Merge "Rename DEVICE arg in common buildprops script" am: c371f19e89 am: a0ea5a17e8
am: 1ed2fafd6a

Change-Id: I0eec28ce7fbe8f29588993b1986b70cf52b0497e
2019-03-20 04:09:51 -07:00
Anton Hansson a0ea5a17e8 Merge "Rename DEVICE arg in common buildprops script"
am: c371f19e89

Change-Id: I24bd162fcfe728f3972eb4e3ce6d5df74ba8bf50
2019-03-20 03:28:08 -07:00
Anton Hansson c371f19e89 Merge "Rename DEVICE arg in common buildprops script" 2019-03-20 10:25:01 +00:00
Bowgo Tsai e4544b1c02 Moving system_other key into product.img
Currently system_other AVB public key is placed in system.img.
However, this makes it's harder to have a *generic* system.img
across different product configs. Moving the key to /product
partition to allow more product-specific AVB keys.

Device board config can add /product/etc/fstab.postinstall,
to mount system_other with this key in /product. It can specify
different mount options, file systems, verity settings, etc., in
this product-specific fstab as well.

Bug: 123611926
Test: `make productimage` checks the following is generated.
      $OUT/product/etc/security/avb/system_other.avbpubkey
      Also checks it's included in $OUT/installed-files-product.{json, txt}

Test: run the following command and checks that
      PRODUCT/etc/security/avb/system_other.avbpubkey is updated:
      ./build/tools/releasetools/sign_target_files_apks \
        --avb_system_other_algorithm SHA256_RSA2048 \
        --avb_system_other_key external/avb/test/data/testkey_rsa2048.pem \
        out/dist/*-target_files-*.zip signed-target_files.zip

Change-Id: I6804f29941bec54375d80bd68a5aedb5c23b842e
2019-03-20 16:18:11 +08:00
Logan Chien 99cdf5385d Update check_elf_file.py for clang-r353983
This commit updates how `check_elf_file.py` parses the symbol name
because the `llvm-readobj` (from clang-r353983) does not print "@" if
the symbol is not versioned.

See also. https://reviews.llvm.org/D56319

Bug: 128959554
Test: CHECK_ELF_FILES=true make check-elf-files
Change-Id: I0dee5e505225e57750a2c86cf0d25a151c218eb1
2019-03-20 15:24:00 +08:00
Daniel Norman 113142152b Merge "Validates the config lists used by the script." am: a4ab1d8490 am: 0e58857364
am: d181c2119a

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Change-Id: I4e57e46c93a56b7f6646764d021ebb42c19bf7f5
2019-03-18 10:26:09 -07:00
Anton Hansson 08231e1786 Refactor generate_enforce_rro
A few tweaks to make it easier to extend to generating RROs in
multiple partitions:
- deduce the module name inside generate_enforce_rro
- dedup rule definition
- tweak framework-res check to use source module name instead

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

A typical workflow is:

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

Test: For non retrofit, run:
      `m snod -j; m supernod -j`
Fixes: 128321505
Change-Id: Ib8c011cadb9c0cd334234aef39f19be6a48fee62
2019-03-13 11:15:21 -07:00
Chih-Hung Hsieh cc47729719 Accept the "file:(project:)?filePath" directive.
Test: checkowners.py some_owner_files
Bug: 126777637
Bug: 126761563
Change-Id: Iee03521681bc38fa28970a015058e1eba3c8b87a
2019-03-12 11:56:33 -07:00
Anton Hansson ef0b949be3 Rename DEVICE arg in common buildprops script
A followup change will make it not always equal TARGET_DEVICE,
so that name is unsuitable. Make its name follow the other product
variables.

Bug: 110206836
Test: presubmit
Change-Id: Icb1422ec5e7af658c5cc3070993c472e99805c6b
2019-03-12 18:03:23 +00:00
Daniel Norman b144b1f637 Merge "Adds support for optional config files to configure the merge." am: cf9509df01 am: f03c76d047
am: 186ae7abb2

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

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

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

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

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

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

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

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

Change-Id: I76c8f757efea6bb2ce8d0dc084083e5c8f6f6bc6
2019-03-07 11:04:35 -08:00
Tao Bao 28a11ef040 Merge "releasetools: Include retrofit info into package metadata." 2019-03-07 18:11:30 +00:00
Yifan Hong 158138cd68 Merge "Remove logical partitions from ab_partitions.txt in retrofit package." am: fa2e796ce2 am: 8c2ec2f061
am: e9923a31d9

Change-Id: Idc120e9ed67dad13518b1a7006ad6b3936e81478
2019-03-06 17:45:33 -08:00
Yifan Hong 8c2ec2f061 Merge "Remove logical partitions from ab_partitions.txt in retrofit package."
am: fa2e796ce2

Change-Id: I18cd55ca0fd440d0df97328695db425600ad1688
2019-03-06 17:29:07 -08:00
Treehugger Robot fa2e796ce2 Merge "Remove logical partitions from ab_partitions.txt in retrofit package." 2019-03-07 01:06:42 +00:00
Tao Bao 393eeb4918 releasetools: Include retrofit info into package metadata.
Fixes: 126754990
Test: Generate retrofit and non-retrofit OTAs. Check the package
      metadata entry.
Test: python -m unittest test_ota_from_target_files
Change-Id: I076a013a6224a2ffea8e0b8581890b66f847f165
2019-03-06 16:19:11 -08:00
Yifan Hong b433eba6a6 Remove logical partitions from ab_partitions.txt in retrofit package.
For retrofit updates:
ab_partitions -= dynamic_partition_list
ab_partitions += super_block_devices

For example,
if super_block_devices == ["system", "vendor", "odm"] and
   dynamic_partition_list == ["system", "vendor", "product"],
product partition needs to be removed from ab_partitions.txt
otherwise brillo_update_payload will generate a payload with
product partition in it.

Test: retrofit update that adds a partition
Fixes: 127425410

Change-Id: Id79a410cee3c611ac50d27f14282916aea34f938
2019-03-06 13:35:20 -08:00
Baligh Uddin b3517c0d18 Add ability to sign bundled APEX into device signing process.
Bug: 123716522
Change-Id: I58a8b03e5a636338317302f254403c88dec61f8c
2019-02-27 12:00:40 -08:00
Bill Peckham 3a21cc6a50 Merge "Extract common.UnzipToDir, invoke that from merge_target_files.py" am: a2f536f9fa am: 0ea998133c
am: 5f2ae4e685

Change-Id: Ife1cc6f0fdca99c27aed06b69d7d371e73b098e2
2019-02-25 22:25:12 -08:00
Bill Peckham 0ea998133c Merge "Extract common.UnzipToDir, invoke that from merge_target_files.py"
am: a2f536f9fa

Change-Id: I10fcfc3008d0699c92c53405d488c66571ef66ec
2019-02-25 15:55:39 -08:00
Bill Peckham d8c9c2d58f Merge "Convert common.RunAndWait method to raise an exception on subprocess failure." am: dd4e2e59aa am: ecd47a1991
am: 108afbcde6

Change-Id: Ic1b389d8114229aaa3d45ebdcdfb74f4ebad85b3
2019-02-22 20:52:42 -08:00
Bill Peckham 108afbcde6 Merge "Convert common.RunAndWait method to raise an exception on subprocess failure." am: dd4e2e59aa
am: ecd47a1991

Change-Id: Ie0609d3e09dcc060bb98b9b67d70a7128e6da420
2019-02-22 20:37:30 -08:00
Xin Li 1cc579adef Merge "DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master" into stage-aosp-master 2019-02-23 00:39:21 +00:00
Bill Peckham 8ff3fbdd08 Extract common.UnzipToDir, invoke that from merge_target_files.py
This change adds another utility function to common.py: UnzipToDir, which is
generally useful. Refactor merge_target_files.py to use it, and also refactor
other uses in common.py to use it.

Test: ota_from_target_files.py, validate_target_files.py, test_common.py
Bug: 124464492
Change-Id: Ia571070bceb7d3c8002304836bdf688485bf0dd9
2019-02-22 10:57:43 -08:00
Bill Peckham 889b0c6b09 Convert common.RunAndWait method to raise an exception on subprocess failure.
Then refactor the code in merge_target_files.py to adapt to this semantic
change. This makes the code more consistent with existing releasetools code,
and it's easier to follow.

Test: Failure cases (verify exception), success cases (merged target generated)
Bug: 124521133
Change-Id: I56f04e360d8ff8ffcd6245359cdeb79f4565a9c4
2019-02-21 19:02:07 -08:00
Xin Li 0e2ccf21c9 DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master
Bug: 120848293
Change-Id: Ic9e8ff5af22140dc6ef8ff87a09f9292f9d30dc5
2019-02-21 09:32:40 -08:00
Bill Peckham ab2f68f38a Merge "Include merge_target_files.py deps in otatools.zip, use common argv processing." am: 30ee35f908 am: a3c90f2ac7
am: 68ac3ecf15

Change-Id: I3d9a1179d05cdbf1261a30f70869ca32041b5f09
2019-02-20 20:27:02 -08:00
Bill Peckham 68ac3ecf15 Merge "Include merge_target_files.py deps in otatools.zip, use common argv processing." am: 30ee35f908
am: a3c90f2ac7

Change-Id: I61cb000759ffdf012ce570ba20f83d060164310c
2019-02-20 20:22:53 -08:00
Bill Peckham 30ee35f908 Merge "Include merge_target_files.py deps in otatools.zip, use common argv processing." 2019-02-21 04:13:23 +00:00
Tianjie Xu 28a8ca98d0 Merge "Check the completeness of original blocks during target files validation" am: ef7737f921 am: 1f80b12aa0
am: 9312c2acc0

Change-Id: I7e49152b65ca4a96339ad7e83527a8a537f66165
2019-02-20 20:06:53 -08:00
Tianjie Xu 9312c2acc0 Merge "Check the completeness of original blocks during target files validation" am: ef7737f921
am: 1f80b12aa0

Change-Id: Ieaa5d86aa24b220df42ac639408bcc659e2359fd
2019-02-20 19:58:07 -08:00
Tianjie Xu ef7737f921 Merge "Check the completeness of original blocks during target files validation" 2019-02-21 03:41:35 +00:00
Tianjie Xu 6e25835bd8 Merge "OTA: Add an option to dump the metadata in ota package" am: 65cd6be679 am: f95abe47e4
am: 7934f14849

Change-Id: Ie7a33e28c2edae1df1577969f0872b27751a2eba
2019-02-20 19:23:49 -08:00
Tianjie Xu 7934f14849 Merge "OTA: Add an option to dump the metadata in ota package" am: 65cd6be679
am: f95abe47e4

Change-Id: Id54d08210242dc9c6d5fccd7b6ed8d310564129b
2019-02-20 19:20:44 -08:00
Bill Peckham f753e15791 Include merge_target_files.py deps in otatools.zip, use common argv processing.
The merge_target_files.py script needs fc_sort and sefcontext_compile, so
include these tools into otatools.zip via core/Makefile.

Modify tools/releasetools/merge_target_files.py to use the otatools common argv
processing to take advantage of the '--path' option so that we add point the
'--path' option to an extracted otatools.zip package to gain access to fc_sort,
sefcontext_compile, and soong_zip (previously included in otatools.zip).

Bug: 123600124
Test: extract otatools.zip, use --path option to point to it, verify result
Change-Id: I7d84525981b8741c6bdbcac9984256920fc7f417
2019-02-21 00:50:54 +00:00
xunchang c0f77ee489 Check the completeness of original blocks during target files validation
The validate_target_files.py checks the 'incomplete' field of the range
in file_map. And range has already considered the shared blocks and
could be smaller in size than the original file range. Therefore, the
'incomplete' flag was set on the original range in common.py; and we
should switch to use the original range also during validation.

I also checked another flag usage in CanUseImgdiff(), and it has
explicitly rejected cases of shared blocks.

Bug: 124868891
Test: unit tests pass
Change-Id: I03959625d7b81fd83420db98f01d23f54064bcd2
2019-02-20 15:47:30 -08:00
xunchang 1cfe25155e OTA: Add an option to dump the metadata in ota package
Add a flag to write a copy of the metadata to a separate file. Therefore,
users can read the post build fingerprint without extracting the OTA package.

Bug: 124783265
Test: Check the dumped metadata file after generate A/B and non-A/B OTA.
Change-Id: I8918aec87bb81906ef0a7eee774178e9f689d91d
2019-02-20 15:32:09 -08:00
Tianjie Xu 8b8de7470e Merge "Add a flag to skip compatibility check" am: 79b52c9ce1 am: 2d97c96527
am: 0875e002aa

Change-Id: Ieaf6975f1ac2eb6d344b89334e8d040f8b24d769
2019-02-19 21:26:06 -08:00
Tianjie Xu 0875e002aa Merge "Add a flag to skip compatibility check" am: 79b52c9ce1
am: 2d97c96527

Change-Id: Iaac01a8fa0a37e623f32cc93416a6eafcf264ab2
2019-02-19 21:17:34 -08:00
xunchang abfa265f81 Add a flag to skip compatibility check
This serves as a workaround to skip the compatibility check for devices
with incompatible kernels.

Bug: 114240221
Test: generate and check the OTA package for wear device
Change-Id: I65b523a66648af7a77fc3ea79176764fe8ae8d02
2019-02-19 16:27:10 -08:00
Bowgo Tsai 9f09ae4223 Merge "Support verifying system_other" am: 01a05483ed am: f509e54bd0
am: a18a5fe46f

Change-Id: If1862045cbaf8ad207adad3d54733cb7dda693a9
2019-02-17 21:42:50 -08:00
Bowgo Tsai a18a5fe46f Merge "Support verifying system_other" am: 01a05483ed
am: f509e54bd0

Change-Id: I16f65c01659fa1664451a25395c340e55f0b39b5
2019-02-17 21:38:41 -08:00
Treehugger Robot 01a05483ed Merge "Support verifying system_other" 2019-02-18 05:21:27 +00:00
Bill Peckham 4a978d3ec1 Merge "Adding initial merge_target_files.py script to merge two target files packages." am: 194b1c8508 am: 7591615cb4
am: ad2967f980

Change-Id: I71ec7422e2e9ea20b491b15b38bf5cc3037b8c80
2019-02-15 17:53:31 -08:00
Bill Peckham ad2967f980 Merge "Adding initial merge_target_files.py script to merge two target files packages." am: 194b1c8508
am: 7591615cb4

Change-Id: I3c15c100c32999896bcfdb49827758b91b1b4f02
2019-02-15 17:49:20 -08:00
Bill Peckham 194b1c8508 Merge "Adding initial merge_target_files.py script to merge two target files packages." 2019-02-16 01:40:36 +00:00
Tom Cherry 527e194d18 Merge "Use fs_config_generator.py to generate fs_config_files/dirs directly" am: b21b108ddf am: b133ed8e18
am: 5fff1244be

Change-Id: I936cacfcdb8fdd8915a327ca73b16a326d24e0ff
2019-02-15 15:01:15 -08:00
Tom Cherry 5fff1244be Merge "Use fs_config_generator.py to generate fs_config_files/dirs directly" am: b21b108ddf
am: b133ed8e18

Change-Id: I9ce904fbe25fd4bfbf20e5775767f6f8dd5aa5d9
2019-02-15 14:56:05 -08:00
Bill Peckham e9eb5f96e0 Adding initial merge_target_files.py script to merge two target files packages.
This script takes as input two partial target files (one contains system bits,
and the other contains non-system, or other, bits). The script merges the
contents of the two partial target files packages to produce a complete target
files package.

Bug: 123430711
Test: Build two partial target files, merge, compare with full target files.
Test: Validate merged target files via validate_target_files.py.
Change-Id: Ic24acf43b86fc703fb4c970688b006291a1861f8
2019-02-15 13:25:16 -08:00
Tom Cherry 9d924f67d3 Use fs_config_generator.py to generate fs_config_files/dirs directly
We want to remove target specific host tools and since
fs_config_generate is compiled with a target specific header file, we
instead remove fs_config_generate entirely and allow python to build
the fs_config_files/dirs files directly from config.fs files and
parsed C headers.

Test: associated unit tests and new end to end test
Test: aosp_sailfish, aosp_crosshatch build produces valid fs_config files
Test: aosp_cf_x86_phone build correctly produces empty fs_config files
Change-Id: Idbc63ff56c0979e1e4c17721371de9d9d02dc8ff
2019-02-15 09:44:09 -08:00
Tom Cherry d33b3198c3 Merge "Error if $(TARGET_DEVICE_DIR)/android_filesystem_config.h exists" am: 506a796bd8 am: 201f5e5a3c
am: 560a8101af

Change-Id: Id84d05ed82fe10d21694823662e7ccc19519976e
2019-02-14 13:15:36 -08:00
Tom Cherry 560a8101af Merge "Error if $(TARGET_DEVICE_DIR)/android_filesystem_config.h exists" am: 506a796bd8
am: 201f5e5a3c

Change-Id: I8262d77366d1dabf552ba6286b7c4f4b7ecff601
2019-02-14 13:11:23 -08:00
Tom Cherry 1a9f8356fd Error if $(TARGET_DEVICE_DIR)/android_filesystem_config.h exists
This was deprecated along with TARGET_ANDROID_FILESYSTEM_CONFIG_H so
warn if it still exists.

Test: successful error if it exists, no error if it does not
Change-Id: I7dde3c88aaf7ecec23ffe018cbe8b42ebadb2bf8
2019-02-14 10:02:04 -08:00
Tom Cherry 0241c8e6e7 Merge "Fix failing test_fs_config_generator.py tests" am: f83ba4e8b1 am: cff9af302b
am: 43fa4a9985

Change-Id: Ifaaf914b18620f7ffeb975c5998b77c050a459d0
2019-02-13 21:10:45 -08:00
Tom Cherry 43fa4a9985 Merge "Fix failing test_fs_config_generator.py tests" am: f83ba4e8b1
am: cff9af302b

Change-Id: Idde025803213c7f952e326065647ae41d1b8350b
2019-02-13 20:58:38 -08:00
Tom Cherry f83ba4e8b1 Merge "Fix failing test_fs_config_generator.py tests" 2019-02-14 02:18:11 +00:00
Bill Peckham 6453fe1984 Merge "Skip some build steps if not building system image." am: 4a3c68bffa am: 8a4041a18e
am: 36b230c394

Change-Id: Idc9c8e73f2b8cbc178a42281dcdc03387ce67adc
2019-02-13 16:58:56 -08:00
Bill Peckham 36b230c394 Merge "Skip some build steps if not building system image." am: 4a3c68bffa
am: 8a4041a18e

Change-Id: I17249226965c48c599da4a6f932e4d63b0c7a5d0
2019-02-13 15:59:50 -08:00
Bill Peckham cc57de3256 Skip some build steps if not building system image.
tools/releasetools/add_img_to_target_files.py: This patch excludes the
inclusion of the system path into the target files if it does not exist (which
it will not if we are not building the system image).

Bug: 123430711
Test: Disable building system image, verify that target files builds without system.
Change-Id: Iaf964ede2b1df5ea4e004b572fd91187a366e75e
2019-02-13 22:57:14 +00:00
Tom Cherry 766adc9cbc Fix failing test_fs_config_generator.py tests
Also run pylint and yapf to fix the style issues.

Test: these same tests
Change-Id: I0a783f7a6f08a90f615d94e9d16da0f314b7813f
2019-02-13 14:34:42 -08:00
Tianjie Xu 34689e2412 Merge "Code improvement to adjusted the blocks size for care_map file" am: b8ac90803c am: 9cdba9ba97
am: 89527442c9

Change-Id: I560a1be990280565851b84c1558a7e5153b88eca
2019-02-13 12:37:38 -08:00
Tianjie Xu 89527442c9 Merge "Code improvement to adjusted the blocks size for care_map file" am: b8ac90803c
am: 9cdba9ba97

Change-Id: I67efdb6a6c8e186c706b35f0dc4984d2bafc7c99
2019-02-13 12:24:07 -08:00
Tianjie Xu b8ac90803c Merge "Code improvement to adjusted the blocks size for care_map file" 2019-02-13 19:49:48 +00:00
Shashikant Baviskar 16a73897c3 Code improvement to adjusted the blocks size for care_map file
Bug: 123931528
Test: python -m unittest test_add_img_to_target_files
Change-Id: I589bc9681bccfa07588cab94f53f69d637d6f0f9
2019-02-13 18:34:50 +00:00
Bowgo Tsai 45db7cefb3 Support verifying system_other
This commit extracts the AVB key used to sign system_other.img into
system.img, for init to verify system_other's AVB metadata.

The extracted key will locate in:
    /system/etc/security/avb/system_other.avbpubkey

Bug: 123611926
Test: build and checks the following is generated
      $OUT/system/etc/security/avb/system_other.avbpubkey

Change-Id: Icdc703ff5a0d50f8140bb652507b9b4cbc8a2118
2019-02-13 17:00:49 +08:00
Tom Cherry e43a7743f3 Merge "Remove TARGET_ANDROID_FILESYSTEM_CONFIG_H" am: 8bca10ade4 am: 1e29059140
am: 531ef2df70

Change-Id: Iab36b896d1854e4d35c01f086624db95b8933715
2019-02-12 13:46:43 -08:00
Tom Cherry 531ef2df70 Merge "Remove TARGET_ANDROID_FILESYSTEM_CONFIG_H" am: 8bca10ade4
am: 1e29059140

Change-Id: I1d7273bc93d8eab2903ad7478a033902162dd836
2019-02-12 13:42:10 -08:00
Tom Cherry 8bca10ade4 Merge "Remove TARGET_ANDROID_FILESYSTEM_CONFIG_H" 2019-02-12 21:10:41 +00:00
Steven Laver 1d44c50317 Merge "Allow properties to be derived from partition-specific properties" am: 0cf76f544b am: 4225bbcbbe
am: c1103c969e

Change-Id: Id00f6573b660dfa024056bacd3f13f97f6d50b8a
2019-02-12 09:00:33 -08:00
Steven Laver c1103c969e Merge "Allow properties to be derived from partition-specific properties" am: 0cf76f544b
am: 4225bbcbbe

Change-Id: I2730b6ecd3197806290e9540d6f2fc3a07f510d2
2019-02-12 08:56:18 -08:00
Steven Laver 9e73e82a12 Allow properties to be derived from partition-specific properties
This change allows ro.product.[brand|device|manufacturer|model|name] and
ro.build.fingerprint to be derived at boot time (and in the OTA
generation scripts) from partition-specific properties.

Test: booted system image, verified properties
Test: booted recovery image, verified properties
Test: unpacked OTA package, verified build fingerprint
Bug: 120123525
Change-Id: Iadd230a0577f35c7c37b0f911e91a5c2863ed1fe
2019-02-11 23:03:00 +00:00
Tom Cherry e0f3ed5cd0 Remove TARGET_ANDROID_FILESYSTEM_CONFIG_H
TARGET_FS_CONFIG_GEN has existed as the preferred mechanism for two
releases, so we finally deprecate TARGET_ANDROID_FILESYSTEM_CONFIG_H.

Test: build
Change-Id: I299a4d1d1d893ac16d6e6ce2ec4659bfcdc19095
2019-02-11 13:45:01 -08:00
Yifan Hong b44e4bba79 Merge "Add kernel info to compatibility.zip" am: 5cc9230914 am: b35937ca55
am: fe4f46caca

Change-Id: Ic789ae1626efb4d94d8c35457ed0caad56c01cb1
2019-01-31 11:31:09 -08:00
Yifan Hong fe4f46caca Merge "Add kernel info to compatibility.zip" am: 5cc9230914
am: b35937ca55

Change-Id: I396a27bddf635afba797816688bb31a6558d6881
2019-01-31 11:25:04 -08:00
Yifan Hong 5cc9230914 Merge "Add kernel info to compatibility.zip" 2019-01-31 19:06:19 +00:00
Bowgo Tsai a42850e7bd Merge "DAP: building system_other.img for retrofit devices" am: aa615a1b2d am: 2b51826211
am: 3ea7740946

Change-Id: Ib455de577ea0ec33fcb6bfffac13295429c2152b
2019-01-30 15:13:11 -08:00
Bowgo Tsai 3ea7740946 Merge "DAP: building system_other.img for retrofit devices" am: aa615a1b2d
am: 2b51826211

Change-Id: I9217850fa149493ddaf535b77ac7dc87b12b318e
2019-01-30 15:02:58 -08:00
Yifan Hong 770ab053b0 Add kernel info to compatibility.zip
Add kernel configs / version to verified_assembled_vendor_manifest.xml
so that the kernel of the incoming package can be checked against
the framework. Previously, the running kernel was used instead.

Bug: 111125947
Test: test_extract_kernel
Test: manual OTA on Pixel 3 from build:
      Android P (kernel version 4.9.96)
      to ToT build:
      device kernel version = (manually modified) framework requirement = latest,
      PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS = true

Change-Id: Id524a58e94bdb6bba348ca461c9d33614ce451a9
2019-01-30 13:28:03 -08:00
Bowgo Tsai 867ab6606e DAP: building system_other.img for retrofit devices
For dynamic partitions in retrofit devices, system partition will be
a logical partition but system_other is not. However, current
build system use the same settings (logical) for both system.img and
system_other.img, leading AVB unable to locate the footer from the end
of system_other partition.

This commit support building system_other.img with correct partition size
while building system.img as a dynamic image.

Bug: 123506156
Test: check there is "system_other_size=2952790016" in file
      $OUT/obj/PACKAGING/system_other_intermediates/system_other_image_info.txt
Test: build system_other.img, then
      `simg2img $OUT/system_other.img system_other.img.raw`, checks the
      raw image size.

Change-Id: I748320a7770c694d06f06f4a35bfceb622849aa8
2019-01-30 09:58:07 +08:00
Tom Cherry a7003a4737 Merge "Remove ro.expect.recovery_id" am: c683233b64 am: 2432b8116a
am: d81af0d11b

Change-Id: Ibaea15235670bc252ec8f3b7240f24c9064e41ea
2019-01-29 09:32:55 -08:00
Tom Cherry d81af0d11b Merge "Remove ro.expect.recovery_id" am: c683233b64
am: 2432b8116a

Change-Id: I42316425c3466278ff22b2e687c6fa45980cece1
2019-01-29 09:27:09 -08:00
Tom Cherry c683233b64 Merge "Remove ro.expect.recovery_id" 2019-01-29 17:07:51 +00:00
Yifan Hong 75b56f71b3 Merge "releasetools: Really allow removing partitions" am: 68e2dc2086 am: 230086552b
am: a442906386

Change-Id: I5f5b2ba26c726b0258ca96d6986bee5b71fb8bff
2019-01-29 00:07:12 -08:00
Yifan Hong 9de8d673d5 Merge "dynamic partition update order is deterministic." am: 47b53c4136 am: 983dd182c7
am: 52fb92e735

Change-Id: Ia4b31a6394c0a4f49bfcbfc1f4c19f4fc2838a1c
2019-01-28 23:05:00 -08:00
Yifan Hong a442906386 Merge "releasetools: Really allow removing partitions" am: 68e2dc2086
am: 230086552b

Change-Id: I3ec32b1ea0346d16775790b715fe6c13883c71e6
2019-01-28 22:45:03 -08:00
Yifan Hong 52fb92e735 Merge "dynamic partition update order is deterministic." am: 47b53c4136
am: 983dd182c7

Change-Id: I6c145d56d8b31da607361d2f7f9808cecbd36d7d
2019-01-28 22:18:33 -08:00
Yifan Hong bb2658d5e2 releasetools: Really allow removing partitions
- Add hashtree_info to EmptyImage so that BlockDifference.Compute()
can accept EmptyImage() as target image, which is the case when
a partition is removed.

- BlockDifference also checks source_info_dict to determine
whether a partition is dynamic. When a partition is removed,
its name does not appear in target_info_dict.

- Add tests to ensure DynamicPartitionDifference() still works.

Test: DynamicPartitionDifferenceTest
Test: test_blockimgdiff

Change-Id: Iadb1db075f5dc344db6d5ade358c83b01231e443
2019-01-28 11:10:48 -08:00
Tom Cherry 56ff89a90a Remove ro.expect.recovery_id
This is not used by anyone and the other half of the code to compare
against it is already functionally dead, so remove this.

Test: build
Change-Id: I44ed087cb7735bbc23e30b6c310c80eb3b7b6488
2019-01-28 10:56:37 -08:00
Yifan Hong 79997e5a18 dynamic partition update order is deterministic.
Use an OrderedDict.
Test: builds

Change-Id: Ic3782c1961f0c2a735540b054eb3cace720c50bd
2019-01-25 12:36:17 -08:00
Bowgo Tsai e0fed5fcfd Merge "Sign system_other.img with AVB" am: d2da2ce398 am: f58452cade
am: eaf3071e8d

Change-Id: I4c204fb6e8d38671fcc33a38fb9dc72cc2a5093d
2019-01-23 22:33:21 -08:00
Bowgo Tsai eaf3071e8d Merge "Sign system_other.img with AVB" am: d2da2ce398
am: f58452cade

Change-Id: I92200b8374ffb56568fb25d362b1327c587b4bbd
2019-01-23 21:55:03 -08:00
Treehugger Robot d2da2ce398 Merge "Sign system_other.img with AVB" 2019-01-24 05:31:37 +00:00
Yifan Hong 8246143b15 Merge "Really support removing / adding partitions." am: 2c0a7bc56d am: ebd97b08f5
am: 498fbce890

Change-Id: Id7da403abf85713dccb20790649e4beb1cb92b0e
2019-01-23 17:10:35 -08:00
Yifan Hong 498fbce890 Merge "Really support removing / adding partitions." am: 2c0a7bc56d
am: ebd97b08f5

Change-Id: I004a23f429e434e1b7c14e7ef84959ef4ff8e779
2019-01-23 17:05:16 -08:00
Yifan Hong 2c0a7bc56d Merge "Really support removing / adding partitions." 2019-01-24 00:51:32 +00:00
Hridya Valsaraju fd919808af Merge "Support including DTB image" am: 2463c3ab2a am: 0322d59b4b
am: 5c672336d9

Change-Id: If6bc1d216af259853acedd18ecf33c8a341fcbc0
2019-01-23 13:36:05 -08:00
Hridya Valsaraju 5c672336d9 Merge "Support including DTB image" am: 2463c3ab2a
am: 0322d59b4b

Change-Id: Id7dfd3b1c45026a04be228fcb7901bc72f8397d7
2019-01-23 13:30:21 -08:00
Treehugger Robot 2463c3ab2a Merge "Support including DTB image" 2019-01-23 20:56:55 +00:00
Hridya Valsaraju 9683b2f136 Support including DTB image
Bug: 111136242
Test: When BOARD_PREBUILT_DTB_DIR is set correctly,
generated $OUT/boot.img contains the DTB image.

Change-Id: I282e31b04cc60383377b9e9b54f8fe64a8140242
2019-01-23 09:14:55 -08:00
Bowgo Tsai 1e04bf7260 Sign system_other.img with AVB
Support signing system_other.img but shouldn't include it into the
top-level vbmeta.img. system_other verifiation will not be included
in /vbmeta chains and will be done separately.

Bug: 112103720
Test: avbtool info_image --image $OUT/system_other.img
Test: avbtool info_image --image $OUT/vbmeta.img, checks 'system_other' is NOT included.
Test: Checks $OUT/obj/PACKAGING/system_other_intermediates/system_other_image_info.txt
      See the following:
        avb_system_other_hashtree_enable=true
        avb_system_other_add_hashtree_footer_args=--rollback_index 1551744000
        avb_system_other_key_path=external/avb/test/data/testkey_rsa4096.pem
        avb_system_other_algorithm=SHA256_RSA4096

Change-Id: Ia152aaab1387dcf556a42222adb39ea76881263a
2019-01-23 15:17:41 +00:00
Logan Chien 63b91d92da Merge "Add prebuilt ELF binaries checker" am: f42823aa7c am: 84722816db
am: b6e0c786d3

Change-Id: I118a2ae4f4feaf7cad0f6a12fa51fd888f60eddc
2019-01-22 23:40:27 -08:00
Logan Chien b6e0c786d3 Merge "Add prebuilt ELF binaries checker" am: f42823aa7c
am: 84722816db

Change-Id: Idce0bddf2c525dcd676972977fd674e4122a0c8e
2019-01-22 23:34:21 -08:00
Logan Chien 0e53d887d6 Add prebuilt ELF binaries checker
This commit introduces a prebuilt ELF binaries checker.  The checker
will check:

1. Whether all DT_NEEDED shared libraries are specified in
   `shared_libs` (Android.bp) or `LOCAL_SHARED_LIBRARIES` (Android.mk).

2. Whether all undefined symbols in the prebuilt binary can be resolved
   to defined symbols exported by its dependencies.

This ensures that prebuilt binaries won't silently become ABI
incompatible.

To check the prebuilt binaries, all of the dependencies must be
specified in `shared_libs` (Android.bp) or `LOCAL_SHARED_LIBRARIES`
(Android.mk).

If your prebuilt binaries cannot be checked for some reason, you may add
the following property to Android.bp:

    check_elf_files: false,

Or, add the following setting to Android.mk:

    LOCAL_CHECK_ELF_FILES := false

Bug: 119084334
Test: CHECK_ELF_FILES=true make check-elf-files
Change-Id: I523d3083f22fd4053c096d26f61f8375800281c8
2019-01-21 21:35:01 +08:00
Yifan Hong 45433e44dd Really support removing / adding partitions.
- When removing a partition, BlockDifference() object
will have tgt=EmptyImage(). Fix the asserts accordingly.
Also, BlockDifference object now allow tgt=None case.

- When adding a partition, BlockDifference() object
will have src=None. Fix the asserts accordingly.

Also, add unit tests to DynamicPartitionsDifference.

Test: create incremental OTA
Test: test_common.DynamicPartitionsDifferenceTest
Bug: 111801737

Change-Id: I3a35378ecf93111b8f44545cff6ae9696b6b4851
2019-01-18 17:09:33 -08:00
Mark Salyzyn 2377996a50 Merge "build_image: Increase spare inodes to 12." am: aa58210dd0 am: fb37e0b6a2
am: 68fed3ce30

Change-Id: I4973b32d8799202eaee16075cab69c48dde4feca
2019-01-17 18:33:29 -08:00
Mark Salyzyn 68fed3ce30 Merge "build_image: Increase spare inodes to 12." am: aa58210dd0
am: fb37e0b6a2

Change-Id: If15f0120fd63197b510095492c51b11c48b0bcd1
2019-01-17 18:24:20 -08:00
Mark Salyzyn 60fa99d491 build_image: Increase spare inodes to 12.
Test: builds device with DAP
Change-Id: I816a7da54bbe23d4eb1140ac0d101c0fee175f0a
2019-01-17 11:30:12 -08:00
Tianjie Xu 42244aac19 Merge "blockimgdiff: selectively convert 'diff' commands to 'new' to reduce stash size" am: ffc87ac0a7 am: 4046b8f741
am: e8be9168fe

Change-Id: Iaf05286b871685bbaa6194c810b528198692a97d
2019-01-17 09:31:06 -08:00
Tianjie Xu e8be9168fe Merge "blockimgdiff: selectively convert 'diff' commands to 'new' to reduce stash size" am: ffc87ac0a7
am: 4046b8f741

Change-Id: If6ad6cc16e5758f48ed79c3291e77c2321bd5a86
2019-01-17 09:22:55 -08:00
xunchang b6105dcba3 blockimgdiff: selectively convert 'diff' commands to 'new' to reduce stash size
We cannot simultaneously stash more blocks than the size limit imposed by
the cache size. As a result, some 'diff' commands will be inevitably
converted to new. We used to do this conversion blindly when iterating
through the transfer list. This leads to an unintended large package.

In order to choose the right transfers to convert, we calculate the size
of the compressed data, and build a heuristic about the package size
increase to remove each stash blocks. After the process, the given
package size for the watch device further reduces from 186M->155M.

In some rare cases, the removed stashed blocks don't directly contribute
to the maximum simultaneously stashed size. For example,
stash A: 10 blocks
stash B: 5 blocks
free B: 5 blocks  <-- stash B has been freed before we reach max stashed blocks
stash C: 10 blocks

Converting these blocks lead to an uncertain result. On one hand, patches
are generally smaller than the new data; while on the other hand, the
regenerated graph may have fewer order violation and thus give some size
reduction. But these cases are rare and it seems an overkill to consider all
possible scenarios here.

Bug: 120561199
Test: build non-A/B incrementals and check the size
(p.s. it can be tested on all target files with customed cache threshold)
Change-Id: I599420a91b80f1a1d83d22ee1b336b699050cfb4
2019-01-16 12:59:13 -08:00
Yifan Hong 9780b8c1e4 Merge "Generate OTA for non-A/B devices with dynamic partitions" am: 885787f4d3 am: 4b0f34da5d
am: 7f7e2635cb

Change-Id: I5eb4228d4545f056772e1be5827a4df2ce49c2e4
2019-01-16 11:04:05 -08:00
Mark Salyzyn 33e3c26cfd Merge "build_image: right-sizing at least some spare inode" am: f2f1854ca4 am: f92eb52866
am: 34c0af7a11

Change-Id: Ia5322176bd51b8728dc1a724327616a243de8670
2019-01-16 11:01:37 -08:00
Yifan Hong 7f7e2635cb Merge "Generate OTA for non-A/B devices with dynamic partitions" am: 885787f4d3
am: 4b0f34da5d

Change-Id: I76ad575bf821f693b2879af5926ffd8abe73fc7e
2019-01-16 10:58:14 -08:00
Mark Salyzyn 34c0af7a11 Merge "build_image: right-sizing at least some spare inode" am: f2f1854ca4
am: f92eb52866

Change-Id: I80f5a8b6b53a043ff8e2b1ac0717dd19b43ea981
2019-01-16 10:56:25 -08:00
Yifan Hong 885787f4d3 Merge "Generate OTA for non-A/B devices with dynamic partitions" 2019-01-16 18:42:58 +00:00
Mark Salyzyn c25b2bf458 build_image: right-sizing at least some spare inode
To address problems creating real tiny filesystem placeholders,
make sure extra spare inodes margin is greater than 0.
For initial estimate we add 4% of total we request at least 8.
For second pass estimate we add 0.2% of total we request at least 1.

We bumped up the margin for zie on the second pass to 0.3% as the
value was too close on one of the builds.

Test: build
Bug: 122328872
Change-Id: I41707bb6fcc8bbfbdda143a9ce62446cad9c1533
2019-01-16 09:54:31 -08:00
Yifan Hong 10c530d20a Generate OTA for non-A/B devices with dynamic partitions
Test: sideload full OTA on cuttlefish
Test: sideload incremental OTA on cuttlefish (that grows
      system, shrinks vendor, and move vendor to group foo)

Bug: 111801737

Change-Id: Ie8a267a90b4df9e9e0a2fbcc1b582ab2e353df52
2019-01-15 16:04:12 -08:00
Mark Salyzyn 588919f1df Merge changes I6457933a,I955aa0fa am: db3c8985be am: 1a34e1ed7e
am: 512ef0475a

Change-Id: I4a6d1a5abbfd002f6cbefc28c1fef1a6a1aaa4bd
2019-01-15 12:51:04 -08:00
Mark Salyzyn 512ef0475a Merge changes I6457933a,I955aa0fa am: db3c8985be
am: 1a34e1ed7e

Change-Id: I616c7b3642ea5a29cc23f3f3fa4959cc81960e79
2019-01-15 12:45:47 -08:00
Mark Salyzyn db3c8985be Merge changes I6457933a,I955aa0fa
* changes:
  Revert "Relax inode usage estimation slack for DAP right sizing"
  Revert "Increase slack for inode estimation algorithm"
2019-01-15 20:33:50 +00:00
Tao Bao acb85e8001 Merge "releasetools: OutputFile stages files under input dir." am: 3ab0ca72b5 am: 0d0458a74a
am: aeaabad880

Change-Id: Ic21f09f8132490c2f87d19668a5b87048e748f2e
2019-01-14 13:00:27 -08:00
Tao Bao aeaabad880 Merge "releasetools: OutputFile stages files under input dir." am: 3ab0ca72b5
am: 0d0458a74a

Change-Id: Icba69dddf0b7a85d9ccd32179164b45be4034c8c
2019-01-14 12:09:54 -08:00
Mark Salyzyn 9f23b89273 Revert "Relax inode usage estimation slack for DAP right sizing"
This reverts commit bd17fab260.

Test: build
Bug: 122328872
Change-Id: I6457933a0dc51827bd86d9c55b02a65999612bcc
2019-01-14 09:44:40 -08:00
Hridya Valsaraju 9aa42f1721 Revert "Increase slack for inode estimation algorithm"
This reverts commit e8e7958c13.

Test: build
Bug: 122328872
Change-Id: I955aa0fa489ab62ec1643127d106925dcb9675ca
2019-01-14 09:44:26 -08:00
Tao Bao 93e7ebe779 releasetools: OutputFile stages files under input dir.
We used to create the intermediate output file as a tempfile, when
adding images to a given zip file. This CL changes OutputFile to write
intermediate files under the given input dir (i.e. OPTIONS.input_tmp
that holds the unzipped files), if the final destination is a zip
archive. This allows image building codes finding the generated images
at consistent locations. The intermediate files will be cleaned up as
part of OPTIONS.input_tmp.

Bug: 122608028
Test: `m dist`
Test: Delete OTA/super*.img from a target_files.zip. Run
      `add_img_to_target_files.py -a` that re-generates split super
      images.
Change-Id: I97903a59fcc0ca5e43bb9b07c3a0b25e9baa92f9
2019-01-13 23:49:25 -08:00
Tao Bao 3de7a10e2f Merge "releasetools: Skip copying split super images while signing." am: 774c0f92bf am: 2db2039202
am: f2cc65ba23

Change-Id: Ide56072bf73d8ada477aa5c03d30bf4a6d915e57
2019-01-11 16:25:18 -08:00
Tao Bao ee3d514cf0 Merge "releasetools: Update OWNERS." am: dd95cf51fa am: f37455e064
am: 7e0da84aa7

Change-Id: Ib5256c1274255cf1545d13994a3e1795e1d8428c
2019-01-11 16:15:49 -08:00
Tao Bao f2cc65ba23 Merge "releasetools: Skip copying split super images while signing." am: 774c0f92bf
am: 2db2039202

Change-Id: Ie73f72e7c7eb460156a160361c385aa6c881658e
2019-01-11 15:51:22 -08:00
Tao Bao 7e0da84aa7 Merge "releasetools: Update OWNERS." am: dd95cf51fa
am: f37455e064

Change-Id: Iaed31f353af02242c94ddc98a0d34deb963bb795
2019-01-11 15:48:47 -08:00
Tao Bao 774c0f92bf Merge "releasetools: Skip copying split super images while signing." 2019-01-11 23:18:49 +00:00
Tao Bao 33bf268e0b releasetools: Skip copying split super images while signing.
Bug: 122608028
Test: Run sign_target_files_apks.py on a target-files zip that has split
      super images (e.g. OTA/super_system.img).
Change-Id: Iaf7263790961a897ea3f339f5af6b18cf253b946
2019-01-11 12:39:31 -08:00
Tao Bao 4b2306b41c releasetools: Update OWNERS.
Test: N/A
Change-Id: I0c6ac3cd04cc6034787d4b8b90fbd61349c54655
2019-01-11 12:28:09 -08:00
Mark Salyzyn 7f38ceeb3f Merge changes Ic8ef968e,I6665bd6f am: e093534aba am: 2907f67255
am: 1708ff6094

Change-Id: If603ecc6567ba68dbbce38903a155bf673e17968
2019-01-11 10:06:00 -08:00
Mark Salyzyn 1708ff6094 Merge changes Ic8ef968e,I6665bd6f am: e093534aba
am: 2907f67255

Change-Id: Ib8b338c892acea4842d1f88df442de134f5a1d43
2019-01-11 09:45:53 -08:00
Mark Salyzyn 9f0b91de8b Merge "build_image: hard code set inode size to 256" am: 546550e095 am: a575edb5d9
am: 004b41040d

Change-Id: I6c1fd55a024362e71fbd2f84bf7d42e274eeb9da
2019-01-10 18:33:08 -08:00
Mark Salyzyn 004b41040d Merge "build_image: hard code set inode size to 256" am: 546550e095
am: a575edb5d9

Change-Id: I78681e0db634f2e459cb3e43e7cc174cd7bcc9e4
2019-01-10 18:23:08 -08:00
Mark Salyzyn 6541d0a80e build_image: support non-sparse right-sized images
Allow right-size to support images that are not sparse.
This is in support of cuttlefish.

Test: build
Bug: 122328872
Change-Id: Ic8ef968e750203dffde7044bc6dfc71c1e283158
2019-01-10 14:49:34 -08:00
Mark Salyzyn 60a716fe8c build_image: right-sizing add .2% margin for space and inodes
To address flakiness in image creation, add a .2% margin of safety
for both inodes and space for ext filesystems.

Test: build
Bug: 122328872
Change-Id: I6665bd6fe642291b825dba58dfd09cc55628230f
2019-01-10 14:49:24 -08:00
Mark Salyzyn c777eaa779 build_image: hard code set inode size to 256
inode-size will jump around based on filesystem size, however
readonly Android system partitions have a specific pattern of
xattr associated with sepolicy and 256 is the most efficient at
absorbing the content.

Test: manual
Bug: 122328872
Change-Id: I06dd6a503067ab6477293b386d56a89dd86b0e83
2019-01-10 14:49:12 -08:00
Dan Willemsen 36beb0cb85 Merge "Add BUILD_USERNAME and BUILD_HOSTNAME" am: 1b8939b946 am: c2230d4684
am: 1a22c2a7e3

Change-Id: Ic8c8fba31e14c5accc9b4b401352e368e620550b
2019-01-10 13:52:32 -08:00
Dan Willemsen 1a22c2a7e3 Merge "Add BUILD_USERNAME and BUILD_HOSTNAME" am: 1b8939b946
am: c2230d4684

Change-Id: I0f4a7b51027d0696f2b6184eec0db3908a7db6a6
2019-01-10 13:47:26 -08:00
Treehugger Robot 1b8939b946 Merge "Add BUILD_USERNAME and BUILD_HOSTNAME" 2019-01-10 21:29:47 +00:00
Tao Bao 183e47ef1a Merge "Don't build retrofit OTA package if vendor.img is unavailable." am: 9f1eda65e6 am: 831fd23482
am: c3a4322c20

Change-Id: I69525f569e7c1c2753f1f7006ab599a3532a7eed
2019-01-07 17:18:23 -08:00
Tao Bao c3a4322c20 Merge "Don't build retrofit OTA package if vendor.img is unavailable." am: 9f1eda65e6
am: 831fd23482

Change-Id: I3a45c14559c8579b580d8e9a53907a49897544f3
2019-01-07 17:07:56 -08:00
Tao Bao 519d18286e Don't build retrofit OTA package if vendor.img is unavailable.
We used to build retrofit full OTA package as long as
PRODUCT_RETROFIT_DYNAMIC_PARTITIONS is true. This doesn't work with AOSP
targets that have the flag set but without any available vendor image.

This CL detects such a condition and uses a separate flag to guard the
retrofit OTA building as well as the split super images generation.

Bug: 120852744
Test: `m -j dist` on blueline (w/ vendor images) and aosp_blueline (w/o
      vendor images).
Change-Id: I65726f24f8fc546be6802941a6a06590a3804c16
2019-01-07 12:22:48 -08:00
Dan Willemsen 7dd69f1b3a Merge "Remove more Android.mk files from build/make" am: ebe0b7a1c9 am: 2c99074cbe
am: b877b02724

Change-Id: I0540e99bfee84e2336ac454765f0295139711f38
2019-01-07 10:00:01 -08:00
Dan Willemsen b877b02724 Merge "Remove more Android.mk files from build/make" am: ebe0b7a1c9
am: 2c99074cbe

Change-Id: I5af0dde7533eecb64dd68cf9003434b4eb5d8a40
2019-01-07 09:54:57 -08:00
Treehugger Robot ebe0b7a1c9 Merge "Remove more Android.mk files from build/make" 2019-01-07 17:44:20 +00:00
Dan Willemsen ef45381221 Remove more Android.mk files from build/make
soong_ui is passing the Android.mk file list to Kati, and it ignores
Android.mk files found via symlinks, so we don't need the workarounds
for build/make/target/board/Android.mk and build/target/board/Android.mk
both existing.

We've got dist support in Soong now, so we can remove the signapk
Android.mk

Bug: 122332221
Test: m dist out/dist/signapk.jar out/dist/libconscrypt_openjdk_jni.so
Change-Id: I2ac9016b04146340c5ac80f7090d00e186023574
2019-01-05 02:40:45 +00:00
Hridya Valsaraju 7dbacc000b Merge "Increase slack for inode estimation algorithm" am: dacde2259f am: e5af443000
am: be281179d4

Change-Id: Ibd8d354b327c07e9a4d17171430f78417bf4cb0d
2019-01-04 17:47:29 -08:00
Hridya Valsaraju be281179d4 Merge "Increase slack for inode estimation algorithm" am: dacde2259f
am: e5af443000

Change-Id: Ic4f67c1155fa148a4b3f1cdeca8bf7d8edcf65dd
2019-01-04 17:36:38 -08:00
Treehugger Robot dacde2259f Merge "Increase slack for inode estimation algorithm" 2019-01-05 01:22:43 +00:00
Hridya Valsaraju e8e7958c13 Increase slack for inode estimation algorithm
This is required to prevent build failure on some targets.

Test: mmm
Bug: 119115481

Change-Id: Idf7c21b163a4e10e2ef435c2b2a7795a42feb200
2019-01-04 09:18:07 -08:00
Yifan Hong b1e9cec952 Merge "Put system_other in super.img" am: 6dc878bd87 am: 59823773b4
am: 2f0ab84cd7

Change-Id: I784bbb26acf70977f27762d9a37146d52e89de6e
2019-01-03 00:23:39 -08:00
Yifan Hong 2f0ab84cd7 Merge "Put system_other in super.img" am: 6dc878bd87
am: 59823773b4

Change-Id: I764b0bf5b18d9df4e1ca1434e47bbab324ecf790
2019-01-03 00:15:28 -08:00
Dan Willemsen 63e48db6d1 Add BUILD_USERNAME and BUILD_HOSTNAME
These replace $USER and `hostname`, which will soon become stable values
due to sandboxing the build on Linux.

Bug: 122270019
Test: check build.prop
Change-Id: I7493e45a2a2defbdba5d82596cb91d68480f0187
2019-01-02 14:33:29 -08:00
Yifan Hong cc46eae994 Put system_other in super.img
... for launch A/B devices.
Test: build super image and lpdump
Bug: 113182233

Change-Id: I79ad9da2f6852b39b23e862ff00f320b6565db2f
2019-01-02 12:05:10 -08:00
Dan Willemsen 2ac14d0d0b Merge "Produce ro.build.version.preview_sdk_fingerprint" am: 5723181c53 am: 74e22a4baa
am: e878b5ae54

Change-Id: Iebaa524a695a8a7a422d5b484e5a4fe3b1a109a7
2018-12-31 22:21:55 -08:00
Dan Willemsen e878b5ae54 Merge "Produce ro.build.version.preview_sdk_fingerprint" am: 5723181c53
am: 74e22a4baa

Change-Id: I14f7f87bb691fc7e59b19936e75a7ef6931ecd21
2018-12-31 22:11:41 -08:00
Dan Willemsen ad6a15433e Produce ro.build.version.preview_sdk_fingerprint
This is just a hash of the current.txt and system-current.txt right now,
though it may expand to include other API surfaces in the future.

Once prebuilts/sdk/current is populated with api_fingerprint.txt files,
we can use those for unbundled builds, but until then, just use the
PLATFORM_PREVIEW_SDK_VERSION as a placeholder.

MD5 was just the most convenient, since we don't have a sha tool that we
can use on Mac currently. I'm hoping we can get a toybox-based tool in
the future that standardizes that, but we aren't currently using sha*sum
from toybox on Linux, much less on Darwin yet.

Test: m dist out/dist/api_fingerprint.txt
Test: m out/target/product/.../system/build.prop
Change-Id: If69f270560d05135cb81a9bb2d1b208ea78f86df
2018-12-27 12:30:05 -08:00
TreeHugger Robot 2a79ca3f3e Merge "Migrate build/make to androidx.test" 2018-12-21 06:36:44 +00:00
Tianjie Xu 616ef5302c Merge "blockimgdiff: add a function to select and convert 'diff' to new" am: 28b6654ee7 am: 134178e370
am: e6610488f0

Change-Id: I4022d2e5a7728e64d300fbef4bb712b11a81083b
2018-12-20 12:43:12 -08:00
Tianjie Xu e6610488f0 Merge "blockimgdiff: add a function to select and convert 'diff' to new" am: 28b6654ee7
am: 134178e370

Change-Id: Id0c2a97ffb3a5c5c824644b8819fa31046407dfd
2018-12-20 12:33:56 -08:00
xunchang 3df4d5eb6d blockimgdiff: add a function to select and convert 'diff' to new
Package size will be unintended large if we stash more blocks than the
stash limit specified by the cache size. To reduce the maximum size of
simultaneous stashed blocks, we will inevitably convert some 'diff'
commands to 'new' commands.

To mitigate the impact, we add a new function to smartly select the
transfers to convert based on their patch size and compressed size.
This cl converts the transfers that have a larger patch size than the
compressed target sizes. And there's a slightly improvement in the
final package size: from 194M -> 185M.

Bug: 120561199
Test: build a non-A/B incremental package, run simulator
Change-Id: Id73ff736ba4e6901d245ad5549d42310d0740284
2018-12-19 20:21:25 -08:00
Hridya Valsaraju 3c4d2241e1 Merge "Relax inode usage estimation slack for DAP right sizing" am: 7cac3adf1a
am: 4ace8926ba

Change-Id: I8c2a82dc493dc2c6f9341992b238267f3caf113e
2018-12-17 18:35:57 -08:00
Treehugger Robot 7cac3adf1a Merge "Relax inode usage estimation slack for DAP right sizing" 2018-12-18 02:13:10 +00:00
David Anderson 212e5dfb53 Add an extra metadata slot to super[_empty].img.
This change excludes retrofit devices from getting a third metadata
slot, until code is in place to correctly upgrade those devices through
fastbootd/update_engine.

Bug: 121149247
Test: lpdump super_empty.img
Change-Id: Id147c42cee93a1f6d61ee0edc9cddc0c0540a279
2018-12-17 13:59:19 -08:00
Tom Cherry 8de582149b Merge "Add owners for fs_config" am: 7a005549ae am: e699395c25
am: 58c94abf4c

Change-Id: I2674da4e90ec699a1d9ec61ef7bd00618a74b899
2018-12-14 16:49:26 -08:00
Tom Cherry 58c94abf4c Merge "Add owners for fs_config" am: 7a005549ae
am: e699395c25

Change-Id: I53574a1dffe253887562b49e9b8163250af330c5
2018-12-14 16:36:17 -08:00
Hridya Valsaraju bd17fab260 Relax inode usage estimation slack for DAP right sizing
The current increase of 4 % is insufficient for some
targets.

Test: mmm
Bug: 119115481
Change-Id: Idcba8025b913da9b70794bfc7464d15b4d99ad34
(cherry picked from commit 3e02e34090)
2018-12-14 14:13:24 -08:00
Tom Cherry 0377f12108 Add owners for fs_config
Test: n/a
Change-Id: I3f81216444240acfbc86c3ef5c21e142107eb044
2018-12-14 10:55:29 -08:00
Brett Chabot 49183d3ec3 Migrate build/make to androidx.test
See go/jetpack-test-android-migration

Test: make checkbuild
Change-Id: If6a6b751c4a6ca837c3166688a0c93d2e923ee4c
2018-12-13 19:06:34 -08:00
Joe Onorato 4b10be2625 Merge "Add a print command to fs_config_generator.py" am: e1c81d74e2 am: 08d6dfe12f
am: 34ac6c73e4

Change-Id: I8313d4c91eca5bd6e10ed08c1042063915d5976f
2018-12-13 18:32:46 -08:00
Joe Onorato 34ac6c73e4 Merge "Add a print command to fs_config_generator.py" am: e1c81d74e2
am: 08d6dfe12f

Change-Id: I4784129d4653b01b9f284afdbe39be5a5f536287
2018-12-13 18:22:12 -08:00