Commit Graph

7250 Commits

Author SHA1 Message Date
Treehugger Robot b65e0b7648 Merge "Add the janitors and someone from Studio." 2020-11-10 08:55:31 +00:00
Elliott Hughes 3fc740b7cb Merge "Run zipalign tests in presubmit." 2020-11-10 00:19:31 +00:00
Elliott Hughes 3d8fb39b0e Add the janitors and someone from Studio.
Studio uses this too, not just the platform build.

Test: treehugger
Change-Id: I65c8a8f150e4d10ca31f67a816c9882d46f08ebf
2020-11-09 14:06:02 -08:00
Treehugger Robot 7bd7db619a Merge "Fix zipalign tests with GetExecutableDirectory" 2020-11-07 23:08:55 +00:00
Fabien Sanglard 6dfc6fb4c4 Fix zipalign tests with GetExecutableDirectory
Test: Self-tested
Bug: NA
Change-Id: Idc15c0e028b74a2b38c26af0e7d4a51f32210145
2020-11-06 17:04:59 -08:00
Treehugger Robot ba1811bf83 Merge "Checks for APK sharedUserIds that cross partition group boundaries." 2020-11-06 22:29:46 +00:00
Elliott Hughes c2039151ba Run zipalign tests in presubmit.
Test: treehugger
Change-Id: I2779c04313976d29c29c50920c0b356309c08439
2020-11-05 16:37:40 -08:00
Daniel Norman d33515623a Checks for APK sharedUserIds that cross partition group boundaries.
This check is used when merging target files to ensure that a merged
build does not contain any APKs that share UID across builds.

Bug: 171431774
Test: test_common
Test: Use merge_target_files.py to merge two partial builds,
      observe no failures for inputs without colliding APKs.
Test: Use merge_target_files.py to merge two partial builds,
      observe failure for inputs that have an APK that shares a
      UID across input partition groups.
Change-Id: I9dc57216882741ae46a99cfd7847f34702c75582
2020-11-05 15:17:05 -08:00
Treehugger Robot 6be3371c23 Merge "Refactor zipalign to allow unit tests" 2020-11-05 19:10:22 +00:00
Treehugger Robot 50c0f97fe7 Merge "Finds APK shared UID violations when merging target files." 2020-11-04 21:44:40 +00:00
Kelvin Zhang 31233e5922 Disable FEC computation for VABC
Test: treehugger, generate a package and make sure --disable_fec is
passed to delta_generator

Change-Id: If256af90b11a7fa03299c1272466d35ef3798a24
2020-11-03 15:45:30 -05:00
Fabien Sanglard 0f29f54695 Refactor zipalign to allow unit tests
Test: Self-tested
Bug: NA
Change-Id: I322b78c5e18082f7abf7427cdc62dbabcb18b4a0
2020-11-03 10:03:30 -08:00
Treehugger Robot 0806152b83 Merge "Fix partition timestamps for secondary payload" 2020-11-02 21:22:17 +00:00
Kelvin Zhang a59bb27754 Fix partition timestamps for secondary payload
When generating secondary payload, we exclude many partitions. These
partitions should be excluded from partition timestamps as well.

Bug: 172022126
Test: ota_from_target_files --include_secondary
Change-Id: Ia3121919154181dc882c4694ad2591dcb81e719f
2020-10-30 14:54:40 -04:00
Alistair Delva 38d49ca61a Merge "Allow flashing erofs system imgs" 2020-10-30 06:41:25 +00:00
Daniel Norman b8d52a2fdc Finds APK shared UID violations when merging target files.
This involved moving the find-shareduid-violation.py script to
releasetools to simplify the cross-tool usage. This new location aligns
this script with other similar python host tools.

In a future change this violation file will be used to check for
shared UID violations across the input build partition boundary.

Bug: 171431774
Test: test_merge_target_files
Test: Use merge_target_files.py to merge two partial builds,
      observe shared UID violations file contents in the result.
Test: m dist out/dist/shareduid_violation_modules.json
      (Checking that existing behavior in core/tasks is presereved)
Change-Id: I7deecbe019379c71bfdbedce56edac55e7b27b41
2020-10-29 09:33:26 -07:00
Chema Gonzalez f8b158b312 build: make fs_config_generator.py python2 explicitly
Test: run script in Fedora 31 with (default) python3 interpreter.

```
$ env python --version
Python 3.7.9
```

Change-Id: Ib4e68c5df54b092380e9fca473cd0dbbc0c18db7
2020-10-28 10:52:14 -07:00
Baligh Uddin 865b6605ca Merge "Move {libbacktrace,libunwindstack} from system/core -> system/unwinding/" 2020-10-28 05:16:46 +00:00
Baligh Uddin 4dc00c60da Move {libbacktrace,libunwindstack} from system/core -> system/unwinding/
BUG: 170465278
Test: TH
Change-Id: I7f0d7b1254e7a28a55599aa4ee6bb6f2ac789b60
2020-10-27 19:44:34 +00:00
Gao Xiang 961041ac80 Allow flashing erofs system imgs
Bug: 158339527
Test: build & boot
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
Change-Id: Ie74db8ebcd7214ffbec49d42b305b2f3ac2e8c9d
2020-10-28 01:24:39 +08:00
Felka Chang b511e7f33a Let genrule have the entrance depend on signapk
Currently, it may be a good idea to let genrule module depend on
java_library_host by changing soong. To change signapk module type from
java_library_host to java_binary_host makes the genrule can depend on the
signapk module directly and generate the signapk.jar at the same time.

Test: for i in `seq 1 10` ; \
        do\
            make clean; \
            make -j64 apexer_test_host_tools; \
        done
Bug: 160632228
Bug: 157878202
Change-Id: I63ae661b9b419ddc6e69ccfc9a29fd28b116c0b5
Merged-In: I63ae661b9b419ddc6e69ccfc9a29fd28b116c0b5
(cherry picked from commit d8442b4c88)
2020-10-27 14:50:39 +00:00
Joanne Chung 2c892f8700 Merge "Revert "Refactor zipalign to allow unit tests"" 2020-10-27 04:32:43 +00:00
Treehugger Robot 89dccb3cf9 Merge "Cleanup references to system/core/liblog -> system/logging/liblog" 2020-10-27 03:33:37 +00:00
Joanne Chung 2736c6f046 Revert "Refactor zipalign to allow unit tests"
This reverts commit d4f71a97bd.

Reason for revert: Looks to have broken apsp master b/171754371

Change-Id: I17ec7ab20834f6b0dbdf49668c41d3e76c0c1e41
2020-10-27 03:22:02 +00:00
Treehugger Robot 454e099c65 Merge "Refactor zipalign to allow unit tests" 2020-10-26 23:42:01 +00:00
Fabien Sanglard d4f71a97bd Refactor zipalign to allow unit tests
Test: Self-tested
Bug: NA
Change-Id: If5e42735853e1508fbeb9fb420a9a9f129c2218f
2020-10-26 12:31:03 -07:00
Baligh Uddin 84280dfa4c Cleanup references to system/core/liblog -> system/logging/liblog
BUG: 170387172
Test: TH
Change-Id: I206a8c43ba914381771826518f369bad328cc257
2020-10-26 14:34:45 +00:00
Baligh Uddin fabc1f6757 Merge "Cleanup references to system/core/base -> system/libbase" 2020-10-24 01:40:48 +00:00
Treehugger Robot 13e76a3e8f Merge "Formatting and general cleanup of merge_target_files." 2020-10-23 21:04:20 +00:00
Baligh Uddin 71fab5c75a Cleanup references to system/core/base -> system/libbase
BUG: 157656545
Test: TH
Change-Id: I0dc00f5f90cfdf439e3dc5d63e5aff178b1e9206
2020-10-23 14:40:36 +00:00
Daniel Norman dbbf5a3912 Formatting and general cleanup of merge_target_files.
Also adds a new validation that IMAGES/<partition>.img must come from
the same build that provides <PARTITION>/*.

Bug: 171431774
Test: python3 -m unittest test_merge_target_files
Test: Use merge_target_files to merge a build.
Change-Id: Ia1f3f2e65a0ca90962216fb0c5cdd24c4c150cae
2020-10-22 16:37:13 -07:00
Treehugger Robot 0b0d8d5b53 Merge "OTA: Support A/B devices custom images update." 2020-10-22 04:59:08 +00:00
Hongguang Chen 49ab1b90df OTA: Support A/B devices custom images update.
Add a new custom_image option to configure which custom images to use to
update custom partitions in A/B update.

This change also moves oem_settings to common option as A/B update will
use it to set oem properties too.

BUG: 171225290
Test: unittest pass, generate OTAs, flash to devices and check results
Change-Id: I279477d6b2954fb3705d7efede0a8bcd330c108b
2020-10-21 20:20:52 +00:00
Justin Yun 75f7cf9a2d Add fs_config_(dirs|files) for product and system_ext
These files were added to devices with the fs_config_files_nonsystem
module in base_vendor.mk. As they are partition-specific, move them
to each base_<partition>.mk file.

To add the fs_config_* files to the base_<partition>.mk files, it is
required to define the fs_config_* regardless of the existance of
partitions.

Bug: 170282998
Test: build and check if they are installed.
Change-Id: Ib8a2c75e2e0e93bb7030da981494e880f8465e5a
2020-10-21 03:39:22 +00:00
Tianjie Xu ec952237e2 Merge "sign_target_files_apks: Fix password encrypted keys handle" 2020-10-20 21:45:54 +00:00
Daniel Norman 29fda6ce51 Merge "Make merge_target_files more lenient, needed for cross-release merging." 2020-10-20 20:31:17 +00:00
Oleh Cherpak e555ab1848 sign_target_files_apks: Fix password encrypted keys handle
This patch restores the possibility of using password encrypted
keys for build signing.

Bug: 171221825
Test: 1. Generate password encrypted keys (write non empty passwords):
        $ subject='/C=US/ST=California/L=Mountain View/O=Android/OU=Android/CN=Android/emailAddress=android@android.com'
        $ mkdir ~/.android-certs
        $ for x in releasekey platform shared media; do \
            ./development/tools/make_key ~/.android-certs/$x \
            "$subject"; \
          done
      2. Create a file with passwords:
        Example of passwd file:
            [[[ 12345678 ]]] /home/user/.android-certs/releasekey
            [[[ 12345678 ]]] /home/user/.android-certs/platform
            [[[ 12345678 ]]] /home/user/.android-certs/shared
            [[[ 12345678 ]]] /home/user/.android-certs/media
            [[[ 12345678 ]]] /home/user/.android-certs/networkstack
      3. Tell system where to find passwords:
        $ export ANDROID_PW_FILE=/path/to/file/with/passwords
      4. Generate a release image:
        $ make dist
        $ sign_target_files_apks \
        -o --default_key_mappings ~/.android-certs \
        out/dist/*-target_files-*.zip \
        signed-target_files.zip

Signed-off-by: Oleh Cherpak <oleh.cherpak@globallogic.com>
Change-Id: I3e9d5318f69a2c3ac6eec64b36163b6544d49c90
2020-10-20 18:29:35 +00:00
Tianjie Xu d53d6f7169 Merge "Add ota script support to generate partial updates" 2020-10-19 18:47:12 +00:00
Treehugger Robot 6a2135b6e6 Merge changes from topic "split_ramdisk"
* changes:
  Exclude board cmdline/dtb/pagesize/base in generic boot image
  Add BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT.
  Add BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE.
  Add GKI global variable.
2020-10-17 00:40:54 +00:00
Tianjie Xu 11e5f33e2c Merge "Update ota script to match init's logic" 2020-10-16 23:10:37 +00:00
Tianjie b37c5be8cc Update ota script to match init's logic
In aosp/1459042, init has updated it's logic to use
ro.build.version.release_or_codename for fingerprint calculation.
The ota script needs the same update for ota targeting to work
correctly.

As a best effort to support pre-S dev stage builds, use
ro.build.version.release for sdk version < 30.

Bug: 170968068
Bug: 158483506
Test: unit tests, generate an OTA for S build
Change-Id: I01ca8a3b7b8b58f94b10f90ed0d27e688a72b866
2020-10-16 11:46:03 -07:00
Jaegeuk Kim ed754fb339 Add build property to enable fscompression
Bug: 162253911
Bug: 110272315
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I3cb7d0a055a7f83c9d0321d2b16f11f40a74f7aa
Merged-In: I3cb7d0a055a7f83c9d0321d2b16f11f40a74f7aa
2020-10-15 17:10:25 -07:00
Yifan Hong 38ab4d81ed Add ota script support to generate partial updates
Allow the ota generation script to take a list of partitions;
and thus generating a partial ota update package. This allow the
testing of partial update functionality, e.g. system-only updates.

Bug: 170921953
Test: unit tests, generate and apply a partial update on coral with system, system_ext, vbmeta_system
Change-Id: I0d8f93806dfbf7b781ea911117b02fc5c0971434
2020-10-15 16:30:13 -07:00
Yifan Hong 63c5ca19ab Add BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE.
BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE removes kernel from the
recovery image.

Test: build recovery image and unpack_bootimg
Test: build target files and unpack_bootimg IMAGES/recovery.img
      on device with GKI and dedicated recovery partition.

Bug: 156098440

Change-Id: I5f37d74ed954b26fe3dd778708b6ab9cfdc51f1e
2020-10-15 14:58:34 -07:00
Yifan Hong 125d0b63b9 Add function to extract timestamp from boot image
Also add toybox to otatools list.

Bug: 169169031
Test: build OTA
Change-Id: Ib14dbf46a8385ccf2a9c5a9c6f4e7fa9399cf0ba
2020-10-15 19:32:39 +00:00
Daniel Norman b0c75911b8 Make merge_target_files more lenient, needed for cross-release merging.
These changes were necessary to begin merging a new cross-release target
whose vendor half is frozen.

- MergeDynamicPartitionInfoDicts
  - Filters combined fields to remove duplicates
  - Merges `super_block_devices` as well as other keys that were not
    previously used by other targets consuming this tool.
- Introduces --allow-duplicate-apkapex-keys. This gives a warning rather
  than fatal error on duplicate apk/apex keys. This flag is needed for
  targets that cannot update a frozen half.
- (Formats merge_target_files.py)

Bug: 170683837
Test: Use merge_target_files to merge an S+R build, and boot.
Change-Id: Id5f787e730de8f8ef697e1f2f29ac6514221e58d
2020-10-15 10:16:31 -07:00
Treehugger Robot 5b7e8e0406 Merge "Allow zip64 support when opening zip files" 2020-10-08 23:35:56 +00:00
Yo Chiang d311799206 Merge changes from topic "exclude-system-shared-libs-from-elfcheck-suggestions"
* changes:
  Pass the value of system_shared_libs from Android.bp to check_elf_file.py
  Exclude system shared libs from fix suggestion
2020-09-28 03:54:27 +00:00
Chris Gross 69c6598b21 Merge "Misc fixes to release tools." 2020-09-26 18:13:24 +00:00
Stephen Hines 7f5d326ce2 Fix ordering of checks based on llvm-readobj output.
llvm-readobj has reordered some of its output, causing issues when
checking for DT_SONAME and other fields.

Bug: http://b/169195129
Test: m for a failing target
Change-Id: Ifbc120b703ec47b52e77c2baf0e4d080960e9ef9
2020-09-22 20:54:21 -07:00
Kelvin Zhang 928c2341a6 Allow zip64 support when opening zip files
When opening an zip file through zipfile.ZipFile(), python2 by default
disables zip64 support. To support update files >4GB, we manually add
allowZip64 to override the setting.

Test: generate && serve an OTA

Change-Id: I9645e963ced830cc2d3a4b72bc63b9369a1cefe8
2020-09-22 16:53:39 -04:00
Logan Chien 751a987bcc Exclude system shared libs from fix suggestion
This commit removes system shared libs (e.g. libc, libdl, or libm) from
the prebuilt ELF check fix suggestion.

Bug: 141925662
Test: Write a bad Android.mk module and check fix suggestions
Change-Id: I4a827d07b24a976c1910b814126790abbeccc793
2020-09-22 18:55:11 +08:00
Chih-hung Hsieh d890f596ce Merge "Add new Java/C++/Yacc warning patterns" 2020-09-22 07:11:54 +00:00
Chris Gross 435b8fe7ba Misc fixes to release tools.
- Remove vendor_dlkm and odm_dlkm from the default list of items that
need to be merged
- Allow a prebuilt system.img to be used when adding images to the
target files archive

Test: Built Pixel 3a and inspected the output
Change-Id: If5291fff559ed9517133f6b476d8dee2500c5b4c
2020-09-21 13:37:21 -07:00
Tom Cherry 787ef71f29 Merge "Use libcutils_headers for android_filesystem_config.h" 2020-09-21 17:26:10 +00:00
Chih-Hung Hsieh e8f4a716ad Add new Java/C++/Yacc warning patterns
Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: I49eafa322902f0587738b583b6262117595318ee
2020-09-18 21:51:06 -07:00
Tom Cherry 54752bf0ae Use libcutils_headers for android_filesystem_config.h
android_filesystem_config.h is found since system/core/include is on
the include path for all projects and contains a symlink to the real
android_filesystem_config.h.  This is fragile and the below bug seeks
to remove this symlink and have users correctly depend on
libcutils_headers.

Bug: 165825252
Test: build
Change-Id: Ie921c4fd96d6e4e42d127bfbfe7a892756ad9495
2020-09-18 22:49:10 +00:00
Treehugger Robot 281affb8a8 Merge "fs_config: Update docs" 2020-09-17 17:15:56 +00:00
Tom Cherry 329545d912 fs_config: Update docs
1. Convert to README.md
2. Sync come content with the updates on source.android.com
3. fs_config uses bionic/libc/kernel/uapi/linux/capability.h, not
system/core/include/private/android_filesystem_capability.h as the
capability header, so update the documentation accordingly.

Test: n/a
Change-Id: I24a084d7a804d3f5d2259cfcea85b8ff4e79d290
2020-09-16 16:21:30 -07:00
Yifan Hong 4e501b58b8 Merge "Revert "Add modules partition."" 2020-09-16 22:45:54 +00:00
Yifan Hong c08cbf0f4a Revert "Add modules partition."
Revert submission 1413808-modules_partition

Reason for revert: modules partition no longer needed
Reverted Changes:
Iceafebd85:Add modules partition
I2fa96199a:rootdir: Add modules directory
Ie397b9ec6:Add modules partition.
I4200d0cf5:fastboot: add modules partition

Bug: 163543381

Change-Id: Iec1d9421bbfeb114fb705f85d910c6def1f211b6
2020-09-15 19:09:26 +00:00
Luca Stefani e0fc4caea9 Sync modules required by releasetools
Test: m otapackage
Change-Id: Id9e43909f3600224af5649b2615dffd7d59723eb
2020-09-12 06:10:13 +00:00
Joe Onorato 55c090ebe0 Merge changes I4a43604b,I7200f5f9,If3402a0a
* changes:
  Add CSV output of remaining makefiles for bp converstion
  Refactor the mongo main() into a class in mk2bp_catalog.py
  Add per-partition summaries and "easy" transitions to mk2bp_catalog
2020-09-11 05:46:48 +00:00
Yifan Hong b1e66600c0 Merge "Add modules partition." 2020-09-11 00:25:24 +00:00
Joe Onorato 3198607cfd Add CSV output of remaining makefiles for bp converstion
Test: m out/target/product/$(get_build_var TARGET_DEVICE)/mk2bp_remaining.html out/target/product/$(get_build_var TARGET_DEVICE)/mk2bp_remaining.csv
Change-Id: I4a43604b2d536387c787b02a4627a0ad9e2a6ff9
2020-09-10 14:09:29 -07:00
Joe Onorato 8ade9b2e00 Refactor the mongo main() into a class in mk2bp_catalog.py
Test: m out/target/product/$(get_build_var TARGET_DEVICE)/mk2bp_remaining.html
Change-Id: I7200f5f9a6735bb0da3928aa5dc74723d69752d3
2020-09-10 14:09:28 -07:00
Joe Onorato 934bd8dcfc Add per-partition summaries and "easy" transitions to mk2bp_catalog
"Easy" means makefiles that are both clean themselves and
only depend on clean targets themselves too.

Test: m out/target/product/$(get_build_var TARGET_DEVICE)/mk2bp_remaining.html
Change-Id: If3402a0ada5d9db5fb04c617d197ab28d695b03c
2020-09-10 14:09:28 -07:00
Yifan Hong c0f187f5f9 Add modules partition.
Modules partition is a dynamic read-write partition.
- AVB is not enabled on the partition
- OTA is file-based; see follow up CL for details
- No build prop files; in particular, no build fingerprint
- No fs_config
- No notice files; notice files are included in individual APEXes

Test: build on CF
Bug: 163543381

Change-Id: Ie397b9ec61dfd1c158450d050196024604854d4d
2020-09-09 15:00:02 -07:00
Kelvin Zhang 7a1364a36a Merge "Generate partition timestamps in ota_from_target_files" am: 49fe034137
Original change: https://android-review.googlesource.com/c/platform/build/+/1402687

Change-Id: I23b48a511fded51330d7620ec748d36225175e2f
2020-09-04 12:37:45 +00:00
Kelvin Zhang 39aea44a96 Generate partition timestamps in ota_from_target_files
Test: make an OTA package
Bug: 162553432
Change-Id: I17b9f1b24307255b1e5115de12fa516126b32365
2020-09-03 14:04:21 -04:00
Treehugger Robot 5040d41e20 Merge "Add ota_metadata_pb2 to otatools.zip" am: 58c793ab0b
Original change: https://android-review.googlesource.com/c/platform/build/+/1416089

Change-Id: I77eeb78be1bcdfdae0a7f7b942af0a0307e1cc75
2020-09-02 12:56:13 +00:00
Kelvin Zhang 4d50ea4dd7 Add ota_metadata_pb2 to otatools.zip
Sometimes tests are being run by executing python -m unittest *.py. In
that case, invocation will fail due to missing ota_metadata_pb2, which
is auto generated from ota_metadata.proto(added in recent change).

Bug: 166718341
Test: unzip otatools.zip and python releasetools/test_utils.py
Change-Id: I597c7ef6dbd8e46ccde020b3122cc38a8df28dc9
2020-09-01 16:58:08 -04:00
Xin Li 37a9f38115 Merge "Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)" into stage-aosp-master 2020-09-01 20:03:45 +00:00
Tianjie Xu f55227e25f Merge "Add per-partition build info into ota metadata" 2020-09-01 18:43:30 +00:00
Tianjie 2bb14864e0 Add per-partition build info into ota metadata
As part of the ota metadata work to support partial update, we should
add the per-partition device name, fingerprint, and version to the ota
metadata.

Bug: 151088567
Bug: 166154730
Test: unit tests pass, generate a package
Change-Id: I7a71a4860aad651daf9e62df39c60d72727c14ff
2020-08-31 14:17:10 -07:00
Tianjie d5563371d4 Add more enums to the ota type
We'd better have a default type for enums. It's safe to change the
proto definition now since no one is parsing the new meta.

Also add the brick type for manually generated brick pkgs.

Bug: 166154730
Test: unit tests pass
Change-Id: Ie6d4e695c298313276b559601509c9a7a7ee91b1
2020-08-31 14:06:31 -07:00
Xin Li c2fd58fe67 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: Ie00dbea32e074838466eeed00f316250c2b4f3c2
Change-Id: I9ee3441fd4d063b9dd489cb1b01d3dbc11332457
2020-08-29 01:19:44 -07:00
Treehugger Robot 002863d698 Merge "Switch to aapt2" 2020-08-29 00:30:28 +00:00
Kelvin Zhang f5f3eaf01c Switch to aapt2
We already moved to aapt2 in Android.bp, no aapt binary in otatools.zip.
So tests should be updated accordingly.

Test: unittest
Change-Id: I29776d75e108e16bcceda49b8be47a338ee8bc1c
2020-08-28 17:40:29 -04:00
Ram Muthiah 2ad69ab090 Merge "Revert "Revert "Add prebuilt bootloader var and add bootloader t..."" 2020-08-28 04:04:24 +00:00
Ram Muthiah 0c4a352409 Revert "Revert "Add prebuilt bootloader var and add bootloader t..."
Revert submission 1411608-revert-1402265-cf-x86-bootloader-XGKLNEQAPF

Reason for revert: Breakage originally caused by change was fixed. Refer to tracking bug for details.
Reverted Changes:
I89e95d4a6:Revert "Add prebuilt bootloader var and add bootlo...
I8fe199351:Revert "Added bootloader binary to cf x86 based ta...

Bug: 166380489
Bug: 164917252
Test: local build and Treehugger build
Change-Id: Ia895aedd77f2ec825aefecaf74c6dfc1ce631c93
2020-08-27 13:18:24 -07:00
Tianjie a2076137a1 Define the protobuf for OTA metadata
Background in http://go/android-partial-updates. For partial update
(e.g. system-only) or devices with mixed build, the current
fingerprint & device name no longer suffice as the precondition to
install the package.

Therefore, we need to additionally include the per-partition build
props into the ota metadata. We also define a protobuf for the metadata
so it can be extended later. The metadata of the legacy format is also
kept for backward compatibility.

Bug: 151088567
Test: unittest pass, generate an OTA and check the result
Change-Id: I716f7da54a393cd340280dbddc3c92b3460f8ef8
2020-08-26 16:17:35 -07:00
Kelvin Zhang ff2c7454fe Merge "Fix lint errors on ota_utils.py" 2020-08-26 13:34:19 +00:00
Ankit Goyal 3c94b2710a Merge "Revert "Add prebuilt bootloader var and add bootloader to img zip"" 2020-08-26 06:54:34 +00:00
Ankit Goyal 6805873751 Revert "Add prebuilt bootloader var and add bootloader to img zip"
Revert submission 1402265-cf-x86-bootloader

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_master&target=adt3-userdebug&lkgb=6791187&lkbb=6791249&fkbb=6791216, bug 166380489
Reverted Changes:
Id67b7bddd:Add prebuilt bootloader var and add bootloader to ...
Id713eaf20:Added bootloader binary to cf x86 based targets

Change-Id: I89e95d4a6a0534c8217785be9b90632fa110bc41
2020-08-26 06:40:59 +00:00
Treehugger Robot ff6d873873 Merge "build_image relies on mkuserimg_mke2fs." 2020-08-26 04:46:56 +00:00
Ram Muthiah 861f05fb83 Merge "Add prebuilt bootloader var and add bootloader to img zip" 2020-08-26 02:59:22 +00:00
Yifan Hong 770234520d build_image relies on mkuserimg_mke2fs.
Add missing dependency.

Test: TH
Bug: 162921175
Change-Id: Ide1fe0b823e5e7a06c6c0252a5bef7bfaf6f7c28
2020-08-25 16:15:30 -07:00
Ram Muthiah 41a03d3aee Add prebuilt bootloader var and add bootloader to img zip
Needed to enable a prebuilt bootloader to make it to the dist and img
directories.

Added a flag to ensure only devices that request will have the update
package populated with a bootloader

Bug: 164917252
Test: local build and Treehugger build
Change-Id: Id67b7bddda14b51a523f794976591c6de04d71ca
2020-08-25 22:12:27 +00:00
Kelvin Zhang 2e41738566 Fix lint errors on ota_utils.py
Pylint reports lot of error on ota_utils.py, because some members of
OPTIONS object aren't defined. This CL moves some definition from
ota_from_target_files.py to ota_utils.py to fix these lint errors.

Test: Make an OTA package
Change-Id: I1e9f255d5919712b13329046c72650dfac184701
2020-08-25 15:58:24 -04:00
Kelvin Zhang dd833dcfb2 Searches for debugfs_static in search path
When signing APks on build server, there might not be an android repo.
Usually deapexer.py will be run from otatools.zip after exctration. So
we should look for debugfs_static in search path

Bug: 165347497
Test: Use sign_apk_from_target_files without android repo
Change-Id: Ifaf91764ca0dc08d010f43a24bfe975a07a71e7f
2020-08-21 14:13:13 -04:00
Treehugger Robot 78439f4668 Merge "Searches for debugfs_static in search path" 2020-08-19 23:27:08 +00:00
Kelvin Zhang d6b799a627 Searches for debugfs_static in search path
When signing APks on build server, there might not be an android repo.
Usually deapexer.py will be run from otatools.zip after exctration. So
we should look for debugfs_static in search path

Bug: 165347497
Test: Sign using self-service
Change-Id: I608870b0184bd8f5f07afa53355b39de47a97e1c
2020-08-19 16:12:23 -04:00
Tianjie e3c31eac61 Fix the syntax in install-recovery.sh
We recently modify the logic in install-recovery.sh to support
non-A/B updates on VAB launched devices. And the position of the
$(getprop ro.boot.slot_suffix) is misplaced for the recovery image.
For example:
"if ! applypatch --check EMMC$(getprop ro.boot.slot_suffix):/dev/block/recovery:SHA1"
should be:
"if ! applypatch --check EMMC:/dev/block/recovery$(getprop ro.boot.slot_suffix):SHA1"

Bug: 156979431
Test: rerun add_image_to_target_file, then validate_target_files
Change-Id: Id2d45e281151a46d66b37ea8fdb7b5cb4ae72e81
(cherry picked from commit e55f62c971)
2020-08-17 18:38:13 -07:00
Yo Chiang 76279b102f Merge "Revert^2 "releasetools: Disable host module on darwin"" 2020-08-11 04:56:55 +00:00
Yo Chiang 096c515976 Revert^2 "releasetools: Disable host module on darwin"
0ac3666667

Exempt-From-Owner-Approval: Original change was approved

Change-Id: I4030dbc072a90f9b8704926c0956787c75bc5583
2020-08-11 04:56:31 +00:00
Treehugger Robot b83c9d0461 Merge "extract_kernel.py: add support to output compiler information" 2020-08-11 02:32:23 +00:00
Kelvin Zhang 2f6571884d Merge "Move non-AB OTA generation code to a separate file" 2020-08-11 01:35:23 +00:00
Kelvin Zhang cff4d7606d Move non-AB OTA generation code to a separate file
Test: Generate a non-AB OTA, apply it
Change-Id: I2f1afbe70d17356fcbf4d59901d201a76a3d6c4f
2020-08-10 16:22:22 -04:00
Yongqin Liu 2c8b8eca5e extract_kernel.py: add support to output compiler information
Test: tested with android-mainline gki kernel from
    https://android.googlesource.com/kernel/prebuilts/mainline/arm64/

Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Change-Id: Ibf3eeb3679b233cd0d54501d385f442e0c0c34ec
2020-08-08 17:15:19 +08:00
Treehugger Robot e9bceb662b Merge "Add more details to divergent vndk lib error." 2020-08-06 21:27:09 +00:00
Steven Moreland 9d27901e4a Add more details to divergent vndk lib error.
Bash better broadcast better build-backstop baggage because baffled
beings' bewilderement begets badness.

Fixes: 162379658
Test: view error by removing "libbinder" from
  VndkMustUseVendorVariantList.
Change-Id: Ib425e30bc7b5388b78af4bfab84dd24072d550a6
2020-08-06 18:02:31 +00:00
Insaf Latypov 0ac3666667 Revert "releasetools: Disable host module on darwin"
Revert "conscrypt: Disable host module on darwin"

Revert submission 1385032-mac-required-fix

Reason for revert: breaks the build on aosp-master
Reverted Changes:
I13335299c:releasetools: Disable host module on darwin
I728a4677a:conscrypt: Disable host module on darwin
I8f3435ff1🎨 Remove dependencies on platform unavailable m...
Ibb9248ef4🎨 Disable host module on darwin
I7db68a629:libcore: Disable host module on darwin

Bug: 163030797
Change-Id: I3b3991b91652c426d8f22d60c59c44d640059619
2020-08-06 15:48:12 +00:00
Yo Chiang 79d10eddbf Merge "releasetools: Disable host module on darwin" 2020-08-06 04:02:52 +00:00
Treehugger Robot 090c0c9c6e Merge "Delete unused subdirectory." 2020-08-05 04:50:59 +00:00
Yo Chiang d65e8127f1 releasetools: Disable host module on darwin
Disable releasetools components that depend on disabled
modules on darwin host.

Bug: 162102724
Bug: 7456955
Test: TH build mac host target
Change-Id: I13335299ca0872cfa956ed756650a966f269080e
2020-08-04 07:12:57 +00:00
Yifan Hong 3a9bd34ec2 Merge "Add SetHostToolLocation." 2020-07-31 22:43:31 +00:00
Tianjie Xu 8001114aee Merge "Update language to comply with Android's inclusive language guidance" 2020-07-31 18:15:12 +00:00
Treehugger Robot c21f30ca8a Merge "Update language to meet Android's inclusive language guidance" 2020-07-31 14:49:05 +00:00
Treehugger Robot bb62634fbd Merge "Let extract_kernel return full kernel release." 2020-07-31 03:00:29 +00:00
Yifan Hong 351b6b811d Let extract_kernel return full kernel release.
Also add relevant soong rules for genrules to use it.

Test: use it in GKI APEX
Bug: 161563386
Change-Id: I04f80ba91748ee5783088d4e20e6438418863f62
2020-07-30 23:53:25 +00:00
Joel Galenson 154ac1d870 Update language to meet Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference.

Bug: 161896447
Test: Build
Change-Id: I8d33207c84f424e89f367b1c917661347402ae77
2020-07-30 15:05:55 -07:00
Yifan Hong 8e332ff3a7 Add SetHostToolLocation.
Add common.SetHostToolLocation so that, when calling
various common.Run* functions, replace the first
argument with previously set paths. This is needed
when the script is executed in a Soong sandbox.

Bug: 161563386
Test: pass
Change-Id: If3b40b518fc7fe068677d39d604e3f6578a12ea3
2020-07-29 19:44:27 -07:00
Tianjie a85bdf0bf0 Update language to comply with Android's inclusive language guidance
More details in: https://source.android.com/setup/contribute/respectful-code

Bug: 161896447
Test: build, run unittests
Change-Id: I35732333da0dd0c871f3e37c4af1b2211647d1e3
2020-07-29 12:06:00 -07:00
Ivan Lozano ad970e69f3 Merge "Update language to comply with Android’s inclusive language guidance" 2020-07-29 13:24:06 +00:00
Treehugger Robot bc02bb355c Merge "Update language to comply with Android's inclusive language guidance" 2020-07-29 05:45:10 +00:00
Ivan Lozano b021b2aeb3 Update language to comply with Android’s inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

 #inclusivefixit

Bug: 161896447
Test: N/A
Change-Id: I9fd970726d739da658f6419a1ccd3e4952b17c78
2020-07-28 15:43:15 -04:00
Kelvin Zhang b1cb5b82a6 Merge "Fix some wording to comply with respectful-code" 2020-07-28 17:58:35 +00:00
Yo Chiang 1237c1f577 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for
reference

Bug: 161896447
Test: TH
Change-Id: I2a93e520120fa52a190a445b4d4c417c299b9727
2020-07-29 01:20:01 +08:00
Dan Albert 57600a4735 Delete unused subdirectory.
Directory was flagged for not being compliant with inclusive language
guidance, and there are no references to this directory anywhere that
I can find, so just delete it.

Test: None
Bug: 161896447
Change-Id: I28892cfd32b54987380d472d032d741eb78f4156
2020-07-24 14:07:35 -07:00
Kelvin Zhang c693d95f86 Fix some wording to comply with respectful-code
https: //source.android.com/setup/contribute/respectful-code
Test: Run unit tests
Bug: 161896447
Change-Id: I9a3676b6f7bb6be43756fdf18b1d8b9ec41fb4cf
2020-07-23 10:04:12 -04:00
Bob Badour 5e9e1fbe83 Add support for combining the notices from 2 roots.
Apparently needed for cts tests due to apks putting intermediate files under
TARGET_OUT even when going to HOST_OUT.

Test: m with and without change verified no differences in notice files

Change-Id: Iea50b6bd9af9452a2600c97e2f7cb89218b9be7f
2020-07-20 17:32:14 +00:00
Yifan Hong 76a337f65e Add odm_dlkm partition. am: f496f1b94f am: 4f2ea25d5f
Original change: https://android-review.googlesource.com/c/platform/build/+/1363859

Change-Id: I4aaa3967e889923f0958afaa3227474176e36ea9
2020-07-17 22:52:14 +00:00
Yifan Hong 4f2ea25d5f Add odm_dlkm partition. am: f496f1b94f
Original change: https://android-review.googlesource.com/c/platform/build/+/1363859

Change-Id: I8c7af808f72de5611cb52f34c0138bc97ceb6254
2020-07-17 22:27:15 +00:00
Yifan Hong 997d227648 Merge changes from topic "odm_dlkm"
* changes:
  Create $OUT/{vendor,odm}/lib before symlink modules
  Add odm_dlkm/etc/build.prop
  Install ODM dlkm to appropriate place and symlink
  Add notice files for odm_dlkm
  Add odm_dlkm partition.
2020-07-17 22:05:26 +00:00
Treehugger Robot 29e347e4be Merge changes Iacfe74ae,I7c380b60 am: ce13163827 am: 5771787ccb
Original change: https://android-review.googlesource.com/c/platform/build/+/1365306

Change-Id: I81debee224374fd8f60d1cad12a4e7ac6c0591ab
2020-07-17 04:59:48 +00:00
Joe Onorato 02fb89a4d7 Add mk2bp_catalog.py that outputs more data about makefiles to be converted to soong.
- Adds makefile and which files are installed to the SOONG_CONV CSV file
- Updates soong_to_convert.py to be able to parse that
- Adds new script that is more detailed.
- Outputs that file as part of the droidcore build to
  $(OUT_DIR)/target/product/$(TARGET_DEVICE)/mk2bp_remaining.html

Test: m out/target/product/$(get_build_var TARGET_DEVICE)/mk2bp_remaining.html
Change-Id: I7c380b6070754f4329bf3965595751e4dac794a0
2020-07-16 18:19:15 -07:00
Yifan Hong f496f1b94f Add odm_dlkm partition.
Test: define odm_dlkm in CF.
Bug: 156020364
Change-Id: I5593d09a1cdf13e651a13e951336555a7475865e
2020-07-16 12:34:29 -07:00
Tianjie fb27b477d8 Use apksigner in check_target_files_signatures
Some apk files, e.g. Chrome.apk has switched to use v2+ scheme.
And the apk file no longer has a META-INF/CERT.RSA. So, the
signature parsing script should use apksigner to dump the cert
info.

Leave the parsing of META-INF/CERT.RSA as a fallback, as some apks
fail the `apksigner verify`. The script also switches to store the
digest of the cert instead of the raw bytes.

Bug: 157735036
Test: run check_target_files_signatures on aosp|signed target-files
(cherry picked from commit a9a50cf6e3)

Change-Id: I910cd1aa91d1e446bef7097871af4171c285685d
2020-07-14 21:48:48 -07:00
Tianjie Xu 25d2fb7a35 Merge "Use apksigner in check_target_files_signatures" am: 8542706908 am: e5eda8950f
Original change: https://android-review.googlesource.com/c/platform/build/+/1362881

Change-Id: I3c90e26190b8d07f1e57894f50b99a4919fa71fc
2020-07-15 03:57:33 +00:00
Tianjie Xu 8542706908 Merge "Use apksigner in check_target_files_signatures" 2020-07-15 03:25:25 +00:00
Tianjie a9a50cf6e3 Use apksigner in check_target_files_signatures
Some apk files, e.g. Chrome.apk has switched to use v2+ scheme.
And the apk file no longer has a META-INF/CERT.RSA. So, the
signature parsing script should use apksigner to dump the cert
info.

Leave the parsing of META-INF/CERT.RSA as a fallback, as some apks
fail the `apksigner verify`. The script also switches to store the
digest of the cert instead of the raw bytes.

Bug: 157735036
Test: run check_target_files_signatures on aosp|signed target-files

Change-Id: I910cd1aa91d1e446bef7097871af4171c285685d
2020-07-14 17:23:07 -07:00
Yifan Hong 9fce02b625 Add vendor_dlkm partition. am: cfb917a1c7 am: 58af66905e
Original change: https://android-review.googlesource.com/c/platform/build/+/1316438

Change-Id: I84a4ffc60242ba92ade09dba87ba53a15394fe9f
2020-07-14 19:47:16 +00:00
Yifan Hong cfb917a1c7 Add vendor_dlkm partition.
Test: define vendor_dlkm for CF.
Bug: 156020364

Change-Id: I459059e1c20df7a285a377b8b3bbc8decc60b124
2020-07-13 14:20:56 -07:00
Kelvin Zhang 922c4bd519 Merge "Fix validate_target_files for target files modified by" am: 757fd2768e am: dd940c163d
Original change: https://android-review.googlesource.com/c/platform/build/+/1350724

Change-Id: I038ec5cb51a174e174d3b68565424de6feaee95e
2020-07-09 00:57:17 +00:00
Kelvin Zhang 757fd2768e Merge "Fix validate_target_files for target files modified by" 2020-07-09 00:32:52 +00:00
Kelvin Zhang 951799f56e Merge "Check for duplicate entries in build.prop in validation script" am: 46a6ab8c05 am: 11a1e1b3bd
Original change: https://android-review.googlesource.com/c/platform/build/+/1352903

Change-Id: Ia764ae32e9e39effb73348d68fb9067be669c3d4
2020-07-06 21:59:49 +00:00
Kelvin Zhang 46a6ab8c05 Merge "Check for duplicate entries in build.prop in validation script" 2020-07-06 21:13:01 +00:00
Kelvin Zhang f2e846fb91 Check for duplicate entries in build.prop in validation script
Test: Added Unit test
Bug: 143013566
Change-Id: Ida14507a4a6034990bc81d5263ef1cea34f589c1
2020-07-06 15:13:11 -04:00
Treehugger Robot 92346502ba Merge "Fix up _CheckSecondTokenNotSlotSuffixed function." 2020-07-01 08:39:42 +00:00
Yifan Hong c8afa54838 Merge "Fix up _CheckSecondTokenNotSlotSuffixed function." into rvc-dev am: 2206bb29fd
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/+/12051901

Change-Id: Ib30dd8adc20af705060d2e5633641d759f363d3b
2020-07-01 01:48:17 +00:00
Yifan Hong 2206bb29fd Merge "Fix up _CheckSecondTokenNotSlotSuffixed function." into rvc-dev 2020-07-01 01:38:10 +00:00
P.Adarsh Reddy 1ed2d66259 Fix up _CheckSecondTokenNotSlotSuffixed function.
Incremental OTA generation was failing since the
function _CheckSecondTokenNotSlotSuffixed was in
broken state, this change fixes the same.

Bug: 160215626
Test: Incremental OTA now gets generated and applied
      successfully a non-ab device.

Change-Id: Ifb3886396fe65dcdaeba16c568419b9fa084193d
Merged-In: Ifb3886396fe65dcdaeba16c568419b9fa084193d
2020-07-01 01:37:56 +00:00
P.Adarsh Reddy 6924eb7d40 Fix up _CheckSecondTokenNotSlotSuffixed function.
Incremental OTA generation was failing since the
function _CheckSecondTokenNotSlotSuffixed was in
broken state, this change fixes the same.

Bug: 160215626
Test: Incremental OTA now gets generated and applied
      successfully a non-ab device.

Change-Id: Ifb3886396fe65dcdaeba16c568419b9fa084193d
(cherry picked from commit 52defe48d52a770c326f489357ab8877b211541e)
Merged-In: Ifb3886396fe65dcdaeba16c568419b9fa084193d
2020-06-30 14:49:04 -07:00
Jiyong Park 24d9cad563 Handle the case when non-optional props have the same value
foo=true
foo=true
foo?=false

Consider the above case: Then the duplication of foo is allowed because
they have the same value (true). However, there was a bug that the
optional assirgnment foo?=false is left unmodified.

This fixes the bug by commenting such optional assignments.

Exempt-From-Owner-Approval: fixes a broken build

Bug: 117892318
Bug: 158735147
Test: atest test_post_process_props
Test: m out/target/product/vsoc_x86/vendor/build.prop for  cf_x86_auto

Exempt-From-Owner-Approval: cherry-pick from master

Merged-In: Iba9b61d9779d93e86d9bead2286f945f8d51ab1d
(cherry picked from commit 9a32636759)
Change-Id: Iba9b61d9779d93e86d9bead2286f945f8d51ab1d
2020-06-30 18:44:51 +09:00
Jiyong Park 0b4fccb66d BUILD_BROKEN_DUP_SYSPROP as escape hatch for the new sysprop restriction
As the final step for the refactoring of sysprop configuration, this
change adds BUILD_BROKEN_DUP_SYSPROP which is the escape hatch for
the new restriction. When it is turned on, the new syntax `a ?= b`
collapses to the old syntax `a = b`, duplicated assignments are allowed,
and the dups are resolved following the legacy rule of preferring the
first.

This change also summarizes all the user-facing changes to the Change.md
file.

Lastly, post_process_prop.py is refactored to accept new argument
'--allow-dup' which when turned on allowes duplicated sysprops.

Bug: 117892318
Bug: 158735147
Test: atest --host post_process_prop_unittest

Exempt-From-Owner-Approval: cherry-pick from master

Merged-In: I7bdfffd47d50aad66a78e28a30c3dad7ebac080c
(cherry picked from commit b302cdf6a4)
Change-Id: I7bdfffd47d50aad66a78e28a30c3dad7ebac080c
2020-06-30 18:44:40 +09:00
Jiyong Park d721e870bc Support optional prop assignments
This CL adds a number of changes to make the assignment of system
properties to be less confusing.

1. Added `a ?= b` syntax, which is called optional prop assignments. The
prop `a` gets the value `b` only when there is no non-optional prop
assignment for `a` such as `a = c`. This is useful for props that
provide some reasonable default values as fallback.

2. With the introduction of the optional prop assignment syntax,
duplicated non-optional assignments is prohibited; e.g., the follwing
now triggers a build-time error:

a = b
a = c

, but the following doesn't:

a ?= b
a = c

Note that the textual order between the optional and non-optional
assignments doesn't matter. The non-optional assignment eclipses the
optional assignment even when the former appears 'before' the latter.

a = c
a ?= b

In the above, `a` gets the value `c`

When there are multiple optional assignments without a non-optional
assignments as shown below, the last one wins:

a ?= b
a ?= c

`a` becomes `c`. Specifically, the former assignment is commented out
and the latter is converted to a non-optional assignment.

3. post_process_props.py is modified so that when a prop assignment is
deleted, changed, or added, the changes are recorded as comments. This
is to aid debugging. Previously, it was often difficult to find out why
a certain sysprop assignment is missing or is added.

4. post_process_prop.py now has a unittest

Bug: 117892318
Bug: 158735147
Test: atest --host post_process_prop_unittest

Exempt-From-Owner-Approval: cherry-pick from master

Merged-In: I9c073a21c8257987cf2378012cadaeeeb698a4fb
(cherry picked from commit 7aeb8de74e)
Change-Id: I9c073a21c8257987cf2378012cadaeeeb698a4fb
2020-06-30 18:44:01 +09:00
Jiyong Park 5df5873d26 Handle the case when non-optional props have the same value
foo=true
foo=true
foo?=false

Consider the above case: Then the duplication of foo is allowed because
they have the same value (true). However, there was a bug that the
optional assirgnment foo?=false is left unmodified.

This fixes the bug by commenting such optional assignments.

Exempt-From-Owner-Approval: fixes a broken build

Bug: 117892318
Bug: 158735147
Test: atest test_post_process_props
Test: m out/target/product/vsoc_x86/vendor/build.prop for  cf_x86_auto

Exempt-From-Owner-Approval: cherry-pick from master

Merged-In: Iba9b61d9779d93e86d9bead2286f945f8d51ab1d
(cherry picked from commit 9a32636759)
Change-Id: Iba9b61d9779d93e86d9bead2286f945f8d51ab1d
2020-06-30 14:28:42 +09:00
Jiyong Park 58cf0e095c BUILD_BROKEN_DUP_SYSPROP as escape hatch for the new sysprop restriction
As the final step for the refactoring of sysprop configuration, this
change adds BUILD_BROKEN_DUP_SYSPROP which is the escape hatch for
the new restriction. When it is turned on, the new syntax `a ?= b`
collapses to the old syntax `a = b`, duplicated assignments are allowed,
and the dups are resolved following the legacy rule of preferring the
first.

This change also summarizes all the user-facing changes to the Change.md
file.

Lastly, post_process_prop.py is refactored to accept new argument
'--allow-dup' which when turned on allowes duplicated sysprops.

Bug: 117892318
Bug: 158735147
Test: atest --host post_process_prop_unittest

Exempt-From-Owner-Approval: cherry-pick from master

Merged-In: I7bdfffd47d50aad66a78e28a30c3dad7ebac080c
(cherry picked from commit b302cdf6a4)
Change-Id: I7bdfffd47d50aad66a78e28a30c3dad7ebac080c
2020-06-30 14:28:35 +09:00
Jiyong Park 598ea49881 Support optional prop assignments
This CL adds a number of changes to make the assignment of system
properties to be less confusing.

1. Added `a ?= b` syntax, which is called optional prop assignments. The
prop `a` gets the value `b` only when there is no non-optional prop
assignment for `a` such as `a = c`. This is useful for props that
provide some reasonable default values as fallback.

2. With the introduction of the optional prop assignment syntax,
duplicated non-optional assignments is prohibited; e.g., the follwing
now triggers a build-time error:

a = b
a = c

, but the following doesn't:

a ?= b
a = c

Note that the textual order between the optional and non-optional
assignments doesn't matter. The non-optional assignment eclipses the
optional assignment even when the former appears 'before' the latter.

a = c
a ?= b

In the above, `a` gets the value `c`

When there are multiple optional assignments without a non-optional
assignments as shown below, the last one wins:

a ?= b
a ?= c

`a` becomes `c`. Specifically, the former assignment is commented out
and the latter is converted to a non-optional assignment.

3. post_process_props.py is modified so that when a prop assignment is
deleted, changed, or added, the changes are recorded as comments. This
is to aid debugging. Previously, it was often difficult to find out why
a certain sysprop assignment is missing or is added.

4. post_process_prop.py now has a unittest

Bug: 117892318
Bug: 158735147
Test: atest --host post_process_prop_unittest

Exempt-From-Owner-Approval: cherry-pick from master

Merged-In: I9c073a21c8257987cf2378012cadaeeeb698a4fb
(cherry picked from commit 7aeb8de74e)
Change-Id: I9c073a21c8257987cf2378012cadaeeeb698a4fb
2020-06-30 14:27:24 +09:00
Kelvin Zhang 5d2b56b129 Fix validate_target_files for target files modified by
add_img_to_target_files.py

See bug description:
"When resigning images, the validate_target_files.py can be used to
verify the images using avbtool. The script will use the vbmeta.img to
achieve this, and all relevant images need to be in the IMAGES folder.
However, due to changes on add_img_to_target_files.py and specifically
the commit 5277d1015, some images (e.g. acpio.img and tos.img) are no
longer copied from RADIO to the IMAGES folder. This causes an error on
validate_target_files.py indicating that it cannot find image such as
IMAGES/acpio.img."
This CL fixes this by symlink images under RADIO directory to IMAGES
directory before invoking avbtool.

Bug: 159299583
Test: python3 -m unittest test_validate_target_files
Change-Id: I5769ee2ab5230d2a3a7cef10706dcc5788e654f8
2020-06-29 16:08:45 -04:00
Tianjie Xu b829269aa1 Merge "Rename the boot image for avb validation" 2020-06-26 17:35:54 +00:00
SzuWei Lin fcc61eef7b Merge "Rename the boot image for avb validation" into rvc-dev am: d7dabee7fe
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/+/12005766

Change-Id: Ic445700b7130012685f45da16433ce3e8c992feb
2020-06-26 16:54:52 +00:00
Tianjie 8c2d9096e3 Rename the boot image for avb validation
Starting from http://go/aog/1328118, we chained the 1st GKI
boot image into vbmeta. However, this fails avb validation;
because the avbtool constructs the image path based by using
"partition name + ext".

This cl works around the issue by renaming boot-5.4.img to
boot.img, so avbtool can find the image correctly.

Bug: 159656873
Test: run validate target file
Change-Id: I577226596e139e5b5f3e6ca3c28ced02431ca392
Merged-Id: I577226596e139e5b5f3e6ca3c28ced02431ca392
(cherry picked from commit 5ec1a7a66a)
2020-06-26 16:44:14 +00:00
Tianjie 5ec1a7a66a Rename the boot image for avb validation
Starting from http://go/aog/1328118, we chained the 1st GKI
boot image into vbmeta. However, this fails avb validation;
because the avbtool constructs the image path based by using
"partition name + ext".

This cl works around the issue by renaming boot-5.4.img to
boot.img, so avbtool can find the image correctly.

Bug: 159656873
Test: run validate target file
Change-Id: I577226596e139e5b5f3e6ca3c28ced02431ca392
2020-06-25 23:09:48 -07:00
Kelvin Zhang 36b904f9c7 Merge "Fix lint errors in ota_from_target_files script" am: c8b4784cb9 am: 36b5ebb1cf
Original change: https://android-review.googlesource.com/c/platform/build/+/1348022

Change-Id: Ie3dc11187c2207fbeeae178d41204a6f5858be51
2020-06-24 19:42:34 +00:00
Kelvin Zhang c8b4784cb9 Merge "Fix lint errors in ota_from_target_files script" 2020-06-24 19:17:35 +00:00
Kelvin Zhang 0876c410ad Fix lint errors in ota_from_target_files script
Only changes code styles, should be No-op to functionality

Test: Run unit tests
Bug: 159723838
Change-Id: Icf6146eb0d6b3fb66478709c0edf55bce54db68f
2020-06-24 09:21:35 -04:00
Chris Gross 84b32c2ded Merge "Use BUILD_*_IMAGE flags in add_img_to_target_files." am: e08e40947b am: d169a3fcad
Original change: https://android-review.googlesource.com/c/platform/build/+/1321954

Change-Id: Id29c2ab31d3a64146d601dee437adf2773b84466
2020-06-19 23:07:13 +00:00
Chris Gross e08e40947b Merge "Use BUILD_*_IMAGE flags in add_img_to_target_files." 2020-06-19 22:32:37 +00:00
TreeHugger Robot 6df396f96f Merge "Include image descriptor of only the first boot image in vbmeta" into rvc-dev 2020-06-17 00:46:40 +00:00
Tianjie Xu 21c7d8c5c6 Merge "Fix the read on a closed zipfile" into rvc-dev 2020-06-17 00:02:53 +00:00
Treehugger Robot 623bea86e1 Merge "Include image descriptor of only the first boot image in vbmeta" am: 397972fa6a am: 765d9a7e00
Original change: https://android-review.googlesource.com/c/platform/build/+/1328118

Change-Id: I7338d991ac9d6a51e29b1c1f94dd6088bb0238a4
2020-06-16 00:34:54 +00:00
Roopesh Nataraja 1908f97319 Include image descriptor of only the first boot image in vbmeta
Multiple boot images can be generated based on BOARD_KERNEL_BINARIES
but vbmeta would capture the image descriptor of only the first boot
image specified in BUILT_BOOTIMAGE_TARGET.

Bug : 158213759
Test: Compile multiple boot images and check if vbmeta.img
      includes image descriptor of only the first boot image
      specified in BUILT_BOOTIMAGE_TARGET

Change-Id: Ib70f65d98546a436da82656bc5c911d437618bb5
Merged-In: Ib70f65d98546a436da82656bc5c911d437618bb5
2020-06-15 17:10:56 -07:00
Treehugger Robot 397972fa6a Merge "Include image descriptor of only the first boot image in vbmeta" 2020-06-16 00:05:28 +00:00
Tianjie 17f6ed8b04 Fix the read on a closed zipfile
When calculating the dynamic fingerprints, we need to reopen the
input file if it's a ZipFile. Because the original object has been
closed, as its scope ends after the with statement.

Bug: 152167826
Test: generate an OTA package with zip input and overrides
Change-Id: I623da3cc5fcc91c6230fb5a6e86517ed995913b7
(cherry picked from commit eb06afb602)
2020-06-13 14:35:14 -07:00
Tianjie Xu 31f2d57129 Merge "Fix the read on a closed zipfile" am: b5b25409b9 am: 916b0cc0bc
Original change: https://android-review.googlesource.com/c/platform/build/+/1332612

Change-Id: Ice5c9ff31052ad32fe66d3ac42c02e72bda6e315
2020-06-13 02:51:47 +00:00
Tianjie Xu b5b25409b9 Merge "Fix the read on a closed zipfile" 2020-06-12 22:38:49 +00:00
Tianjie eb06afb602 Fix the read on a closed zipfile
When calculating the dynamic fingerprints, we need to reopen the
input file if it's a ZipFile. Because the original object has been
closed.

Bug: 152167826
Test: generate an OTA package with zip input and overrides
Change-Id: I623da3cc5fcc91c6230fb5a6e86517ed995913b7
2020-06-11 22:51:07 -07:00
Oleg Aravin 9f2bd891e4 Merge "Attach apk_name as a suffix for the temporary files" am: 95f7a32fc6 am: cbdfb69686
Original change: https://android-review.googlesource.com/c/platform/build/+/1322367

Change-Id: I6ab246774cc4d6841a8491325d61ce88343dd232
2020-06-11 21:37:11 +00:00
Oleg Aravin 95f7a32fc6 Merge "Attach apk_name as a suffix for the temporary files" 2020-06-11 21:11:30 +00:00
J. Avila d30b751838 Add LZ4 support to the release tools
The core android build platform has changed to add support for LZ4
compression for ramdisks, but the release tools were not. Fix this.

Bug: 156129966
Merged-In: I39680b91930d2d3cbd0cd565beb78e1ee699397e
Change-Id: I39680b91930d2d3cbd0cd565beb78e1ee699397e
2020-06-11 15:22:04 +00:00
J. Avila 7d9f715f29 Merge "Add LZ4 support to the release tools" am: b8d67f3722 am: d2cbd57b33
Original change: https://android-review.googlesource.com/c/platform/build/+/1329115

Change-Id: I91a65d982169c81409532561f6dae3ddb17b7398
2020-06-11 15:20:29 +00:00
J. Avila 98cd4cc7a3 Add LZ4 support to the release tools
The core android build platform has changed to add support for LZ4
compression for ramdisks, but the release tools were not. Fix this.

Bug: 156129966
Change-Id: I39680b91930d2d3cbd0cd565beb78e1ee699397e
2020-06-10 21:51:19 +00:00
Roopesh Nataraja 3e15f6edb1 Include image descriptor of only the first boot image in vbmeta
Multiple boot images can be generated based on BOARD_KERNEL_BINARIES
but vbmeta would capture the image descriptor of only the first boot
image specified in BUILT_BOOTIMAGE_TARGET.

Bug : 158213759
Test: Compile multiple boot images and check if vbmeta.img
      includes image descriptor of only the first boot image
      specified in BUILT_BOOTIMAGE_TARGET

Change-Id: Ib70f65d98546a436da82656bc5c911d437618bb5
2020-06-10 07:44:12 -07:00
Treehugger Robot 05048d976c Merge changes I53c05800,Ic218283b am: 470cfbe8d7 am: 21805afbc6
Original change: https://android-review.googlesource.com/c/platform/build/+/1317599

Change-Id: I7c7f317cca241af3f8822617d1367a5a2acb25b5
2020-06-08 16:21:45 +00:00
Jiyong Park 10e44533bc Merge changes I4d88733c,I61943476,Ibed9c96d am: c844de4241 am: 82d6dd6061
Original change: https://android-review.googlesource.com/c/platform/build/+/1317597

Change-Id: I1bb5bdf9d5dae7fe0455f517f6347d442d191440
2020-06-08 16:21:22 +00:00
Jiyong Park fe7df0a0a7 <partition>/build.prop rules are defined using macro am: e28fa80e12 am: 236859d234
Original change: https://android-review.googlesource.com/c/platform/build/+/1317596

Change-Id: I4f05b3376ab6621787dd540f53ad851dff6194a3
2020-06-08 16:21:17 +00:00
Jiyong Park cc49c6b8cd Leave a comment when removing a prop
post_process_prop.py doesn't simply drop a line when deleting a prop.
Instead, it makes the line as comment and leave a comment to clearly
mark that the prop was force removed. This is to aid the debugging.

Bug: 117892318
Test: m

Change-Id: I53c05800ff71d431a56dc370bcfe8bfc95c03bfc
2020-06-08 10:09:12 +09:00
Jiyong Park 35a83d1a5a remove buildinfo_common.sh
The shell script was responsible for appending some system properties
that are common to <partition>/build.prop files. The values of the
system properties were given via environment variables whose names were
slightly different from their corresponding make var names.

This change removes the script and instead write the system properties
directly in Make, thus eliminating the need to keep track of the mapping
across sysprop names, environment variable names, and make var names.

Bug: 117892318
Test: m

Change-Id: I4d88733c1afa30ea0c0c4fcfc2b349f07f7fc090
2020-06-05 10:50:15 +09:00
Jiyong Park 9ebefc640d Partial cherry-pick of ag/10260813
This change is a partial cherry-pick of ag/10260813
(Iaeefb35137de01c6ea57115d8830dd9bc30eccba) to prevent downstream merge
conflict when buildinfo_common.sh is removed by the upcoming changes.

Bug: 117892318
Test: m

Change-Id: I6194347668fd57dfb29ce1bfda16b90088483591
Merged-In: Iaeefb35137de01c6ea57115d8830dd9bc30eccba
2020-06-05 10:49:35 +09:00
Jiyong Park e28fa80e12 <partition>/build.prop rules are defined using macro
The macro `build-properties' is defined to generate build rules to
create <partition>/build.prop.

build.prop files in all partitions except for the system partition are
now build using the macro.

system partition will use the macro in the following changes.

Bug: 117892318
Test: m

Change-Id: Ibed9c96dac4366251ec59a0b1317aa92f501c9a3
2020-06-05 10:47:34 +09:00
Chris Gross 203191b5be Use BUILD_*_IMAGE flags in add_img_to_target_files.
Modify add_img_to_target_files.py to use the BUILDING_*_IMAGE flags when
deciding whether to create and add a given image to a target files
archive.

To do this, the BUILDING_*_IMAGE flags are now dumped to misc_info.txt.

The origin of this change was to use the BUILDING_USERDATA_IMAGE and
BUILDING_CACHE_IMAGE flags in add_img_to_target_files.py so that we
could reliably turn off the generation of the userdata and cache images.
The other image flags were added for symmetry.

Bug: 130307439
Test: m -j out/target/product/bonito/misc_info.txt
Test: m -j droid dist
Change-Id: I32d5a8d6c9ebb5f329d856030084d698ee8d271d
2020-06-04 17:53:04 +00:00
Oleg Aravin 8046cb0a2c Attach apk_name as a suffix for the temporary files
With this change the name of the signed and unsigned APK will be something like 'tmpadrbpp9f/tmpvl0lf2kr/tmpknja6mca_MyApk.apk' instead of 'tmpadrbpp9f/tmpvl0lf2kr/tmpknja6mca'.

The motivation for this change is a better logging and transparency what is being signed in the underlying client.

Change-Id: I32b0e93d5859ca3fb712e426705f16d329d71f0e
2020-06-02 16:03:21 -07:00
Anton Hansson a973323a9d Merge "releasetools: Add signapk as required modules" into rvc-dev 2020-06-01 17:53:21 +00:00
Yo Chiang 01a66620c0 Merge "releasetools: Fix non-existent required dependency" am: 61e1cc7317 am: 5e113d40d0
Change-Id: I236286dd8ee61e0163a941e6adb1a645489296eb
2020-06-01 06:59:20 +00:00
Yo Chiang 61e1cc7317 Merge "releasetools: Fix non-existent required dependency" 2020-06-01 06:31:07 +00:00
Jiyong Park c96b261f59 Merge changes from topics "remove_bootimage_sysprops", "sysprop" am: 6dd5383c37 am: 04799633dd
Change-Id: Iddb4cfd419dc0f68e15cb62f2545d8bc178b42ca
2020-05-29 21:52:11 +00:00
Hongguang Chen 96c88287a7 Fix _ImportParser() error if property is imported from oem partition.
The oem partition allows system build.prop to import properties from it
by "import /oem/oem.prop xxxx". An _ImportParser() error was raised on
this case.

BUG: 154171021
Test: 1) "atest --host releasetools_test releasetools_py3_test -c"
      2) On a device who has oem partition, "make dist" and sign its
      target zip file.
Change-Id: I47875bf7a698390e11690150e6516a3064550ca0
Merged-In: I47875bf7a698390e11690150e6516a3064550ca0
2020-05-28 15:22:31 -07:00
Tianjie Xu 8098b73e0c Merge changes I637dea34,I4a9fa35c,I5c952cd2 into rvc-dev
* changes:
  Add an option to input the boot variables for OTA package generation
  Reland "Calculate the runtime fingerprint prefixes from build prop"
  Reland "Add a wrapper class PartitionBuildProp""
2020-05-28 18:56:21 +00:00
TreeHugger Robot 20daf73fd9 Merge "Update auto-gen test config template with PARAMETERIZED_STRINGS placeholder" into rvc-dev 2020-05-28 06:12:35 +00:00
Tianjie 48d159fa7c Add an option to input the boot variables for OTA package generation
The values of the ro.boot* variables are not part of the image files
and are provided (e.g. by bootloaders) at runtime. Meanwhile, their
values may affect some of the device build properties, as a different
build.prop file can be imported by init during runtime.

This cl adds an option to accepts a list of possible values for some
boot variables. The OTA generation script later use these values to
calculate the alternative runtime fingerprints of the device; and
list the device names and fingerprints in the OTA package's metadata.

The OTA metadata is verified by the OTA server or recovery to ensure
the correct OTA package is used for update. We haven't made any
restrictions on what ro.boot* variables can be used for fingerprint
override. One possible candidate can be the skus listed in
ODM_MANIFEST_SKUS.

Bug: 152167826
Test: unittests pass, generate an OTA file with the new option
Change-Id: I637dea3472354236d2fd1ef0a3306712b3283c29
Merged-In: I637dea3472354236d2fd1ef0a3306712b3283c29
2020-05-27 22:14:30 +00:00
Tianjie Xu 835aac5cf6 Reland "Calculate the runtime fingerprint prefixes from build prop"
This reverts commit b21e48b499.

In practice, some partners use the 'import' statement to override
the device fingerprint at runtime. The runtime fingerprint will
later add to the metadata of OTA package, so that the OTA server
can deliver the package to corresponding devices correctly.

This CL supports parsing a subset of import statement that the init
process recognizes. And we loose the restriction based on how the
dynamic fingerprint is used in practice. Right now, we only searches
for the override of brand, name and device. And the placeholder
format should be ${placeholder}, with its value supplied by the
script caller.

As part of the implementation, we generate all the possible
combinations of the input boot variables. And recalculate the
fingerprint for each of the combination. Though we load the
build.prop multiple times, the logic is easier to follow. Also,
it's more convenient to enhance the logic if we only want to
allow some of the boot variables combination later.

Bug: 152167826
Change-Id: I4a9fa35c7ac037ff1cf4f9a4bdff602beac3894b
Merged-In: I4a9fa35c7ac037ff1cf4f9a4bdff602beac3894b
Test: unittests pass
2020-05-27 22:14:02 +00:00
Tianjie Xu 726d20a68f Reland "Add a wrapper class PartitionBuildProp""
This reverts commit 6022545272.

The build prop for a partition used to be a simple key:value
dictionary. But we need more fields to hold the alternative build
props overriden by the 'import' statement. Therefore, add a new
class as a wrapper for these props first.

Bug: 152167826
Change-Id: I5c952cd2a976ba1a09ddc66d56c2b8b55a61986b
Merged-In: I5c952cd2a976ba1a09ddc66d56c2b8b55a61986b
Test: unittests pass
2020-05-27 22:13:34 +00:00
Jiyong Park ae55638f75 Refactor post_process_props.py
The script is refactored to not parse lines everytime a prop is looked
up or updated.

Also it is now built using python_binary_host.

Bug: 117892318
Test: m

Change-Id: I1677ca5aa919c54b7b0740fdc52e1399009f9a12
2020-05-27 12:52:44 +09:00
Jiyong Park 58dd353a07 remove code for default.prop
default.prop files are gone. Remove the code in post_process_prop.py
that handles the file.

Bug: 1313599
Test: m

Change-Id: I3b4ff4adac57a406b70300d34ece7028cb52eb2d
2020-05-27 12:52:43 +09:00
Hongguang Chen 4217f575c3 Merge "Allow more than one '=' in avb_extra_custom_image_extra_args." into rvc-dev 2020-05-26 23:46:13 +00:00
TreeHugger Robot 13aff4012d Merge "sign_apex.py respects hash algorithm" into rvc-dev 2020-05-26 01:03:48 +00:00
Treehugger Robot 93b42b8fe3 Merge "Allow more than one '=' in avb_extra_custom_image_extra_args." am: 6d412db1b3 am: 787ee95af2
Change-Id: I08b51e5b108019f28c8c9004ddcb931acd11caf0
2020-05-25 22:36:21 +00:00
Hongguang Chen 4975a9334f Allow more than one '=' in avb_extra_custom_image_extra_args.
avb_extra_custom_image_extra_args can be set to
'oem=--signing_helper_with_files=/tmp/avbsigner.sh' on signing server.
The second '=' shouldn't be splitted in this case.

BUG: 154171021
Test: Manually sign target zip files which has custom images.
  sign_target_files_apks -d certs --avb_extra_custom_image_key \
    oem=oem_rsa4096.pem --avb_extra_custom_image_algorithm \
    oem=SHA256_RSA4096 --avb_extra_custom_image_extra_args \
    oem="--signing_helper_with_files=/tmp/avbsigner.sh" \
    xxxx-target_files.zip signed.zip

Change-Id: I815d574f791734d4c6a25a9f8d827b5b4f93d7cc
Merged-In: I815d574f791734d4c6a25a9f8d827b5b4f93d7cc
2020-05-25 15:11:30 -07:00
Yo Chiang a0359ca828 releasetools: Fix non-existent required dependency
HOST module img_from_target_files has non-existent required: zip2zip
HOST module releasetools_py3_test has non-existent required: otatools
HOST module releasetools_test has non-existent required: otatools

Bug: 7456955
Test: TH presubmit
Test: atest releasetools_test # Test result doesn't change
Change-Id: I4fa4fb9c120fda5d4cb309b1e3a2660c3387eb7f
2020-05-25 17:14:51 +08:00
Hongguang Chen 883eecbc4b Allow more than one '=' in avb_extra_custom_image_extra_args.
avb_extra_custom_image_extra_args can be set to
'oem=--signing_helper_with_files=/tmp/avbsigner.sh' on signing server.
The second '=' shouldn't be splitted in this case.

BUG: 154171021
Test: Manually sign target zip files which has custom images.
  sign_target_files_apks -d certs --avb_extra_custom_image_key \
    oem=oem_rsa4096.pem --avb_extra_custom_image_algorithm \
    oem=SHA256_RSA4096 --avb_extra_custom_image_extra_args \
    oem="--signing_helper_with_files=/tmp/avbsigner.sh" \
    xxxx-target_files.zip signed.zip

Change-Id: I815d574f791734d4c6a25a9f8d827b5b4f93d7cc
2020-05-24 21:10:44 -07:00
Hongguang Chen d9edddd64d Add options to sign the prebuilt custom images.
The custom images are any images owned by OEMs and SoCs, oem images
mounted on /oem is an example. The oem images can be used to customize
devices for different carriers, like wallpaper, ringtones, and
carrier-specific apks. OEMs can generate multiple oem images, like
oem.img, oem-carrier1.img and oem-carrier2.img and flash different oem
images for different carriers. The oem images are only one case, OEMs
and SoCs can add more custom images and mount them to custom partitions.

This change enables custom images to be vbmeta.img chained partitions.
The following configuration in BoardConfig.mk is an exmaple. It has two
custom partitions: oem and test. They will be signed by different keys.
And they will be chained by vbmeta.img. The custom images here are
prebuilts, which can be built by `make custom_images` separately.
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST should include all custom images
to apply AVB signing. And to every custom partition, one image whose
name is partition name must be added in its
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST.

BOARD_CUSTOMIMAGES_PARTITION_LIST := oem test

BOARD_AVB_OEM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
BOARD_AVB_OEM_ALGORITHM := SHA256_RSA4096
BOARD_AVB_OEM_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_OEM_ROLLBACK_INDEX_LOCATION := 1
BOARD_AVB_OEM_PARTITION_SIZE := 5242880
BOARD_AVB_OEM_IMAGE_LIST := \
    device/xxxx/yyyy/oem/oem.img \
    device/xxxx/yyyy/oem/oem1.img

BOARD_AVB_TEST_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
BOARD_AVB_TEST_ALGORITHM := SHA256_RSA2048
BOARD_AVB_TEST_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_TEST_ROLLBACK_INDEX_LOCATION := 2
BOARD_AVB_TEST_PARTITION_SIZE := 10485760
BOARD_AVB_TEST_IMAGE_LIST := \
    device/xxxx/yyyy/test/test.img \
    device/xxxx/yyyy/test/test1.img

To resign the custom images in the target zip file, the
avb_extra_custom_image_key, avb_extra_custom_image_algorithms and
avb_extra_custom_image_extra_args options are added to the
sign_target_files_apks tool too. The following test cases list some
examples about how to use them.

BUG: 154171021
Test: 1) "atest --host releasetools_test releasetools_py3_test -c"
  2) Build images by 'make dist', sign and validate target files.
   a) Test on dist w/ chained vbmeta_system and ome custom images
   sign_target_files_apks -d certs \
     --avb_extra_custom_image_key oem=oem_rsa4096.pem \
     --avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
     xxx-target_xxx.zip signed.zip
   validate_target_files.py signed.zip
   Flash image and boot up.
   Verify the oem images and vbmeta images in OUT and target zips by
   avbtool.

   b) Test on dist w/ chained vbmeta_system and oem and test custom images
   sign_target_files_apks -d certs \
     --avb_extra_custom_image_key oem=oem_rsa4096.pem \
     --avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
     --avb_extra_custom_image_extra_args oem=--do_not_generate_fec \
     --avb_extra_custom_image_key test=test_rsa4096.pem \
     --avb_extra_custom_image_algorithm test=SHA256_RSA4096 \
     xxx-target_xxx.zip signed.zip
   validate_target_files.py signed.zip
   Verify the oem, test images and vbmeta images in OUT and target zips
   by avbtool.

   c) Test on dist w/o chained partition.
   sign_target_files_apks -d certs xxx-target_xxx.zip signed.zip
   validate_target_files.py signed.zip
   Flash image and boot up.
   Verify the vbmeta images in OUT and target zips by avbtool.

Change-Id: Ifccfee5e8909697eef6ccda0cc352fa16a9f6db6
Merged-In: Ifccfee5e8909697eef6ccda0cc352fa16a9f6db6
2020-05-21 22:22:19 +00:00
Tianjie Xu 7790069449 Merge "Add an option to input the boot variables for OTA package generation" am: 1ca7b10456 am: 0dbde58c9b
Change-Id: I27286dd6a6eae839231bacd508d9a014b9f8a32a
2020-05-21 18:27:34 +00:00
Tianjie Xu 1ca7b10456 Merge "Add an option to input the boot variables for OTA package generation" 2020-05-21 17:58:21 +00:00
Treehugger Robot 9e55d3d282 Merge "Add options to sign the prebuilt custom images." am: 8a87dae43b am: 1c23d3ce54
Change-Id: Ife592f30393e0411cb9ca94a34409aa9f111e8ec
2020-05-21 17:10:36 +00:00
Treehugger Robot 8a87dae43b Merge "Add options to sign the prebuilt custom images." 2020-05-21 16:34:13 +00:00
Tianjie d6867167d1 Add an option to input the boot variables for OTA package generation
The values of the ro.boot* variables are not part of the image files
and are provided (e.g. by bootloaders) at runtime. Meanwhile, their
values may affect some of the device build properties, as a different
build.prop file can be imported by init during runtime.

This cl adds an option to accepts a list of possible values for some
boot variables. The OTA generation script later use these values to
calculate the alternative runtime fingerprints of the device; and
list the device names and fingerprints in the OTA package's metadata.

The OTA metadata is verified by the OTA server or recovery to ensure
the correct OTA package is used for update. We haven't made any
restrictions on what ro.boot* variables can be used for fingerprint
override. One possible candidate can be the skus listed in
ODM_MANIFEST_SKUS.

Bug: 152167826
Test: unittests pass, generate an OTA file with the new option
Change-Id: I637dea3472354236d2fd1ef0a3306712b3283c29
2020-05-20 19:01:17 -07:00
Treehugger Robot 5b79a329f1 Merge "sign_apex.py respects hash algorithm" am: ed67178e4a am: ef5e5708a9
Change-Id: Icd7e7c1a8612e47da115b7341aec95d9ccf2201d
2020-05-21 01:11:18 +00:00
Jiyong Park b3a5402d3f sign_apex.py respects hash algorithm
When sign_apex.py re-signs an apex, the hash algorithm is extracted and
it is used when re-packaging the file.

Bug: 155771970
Test: releasetools_py3_test doesn't regress
(some tests were failed, but they failed even without this change:
test_ApexApkSigner_apkKeyNotPresent (test_apex_utils.ApexUtilsTest) ... ERROR
test_ApexApkSigner_noApkPresent (test_apex_utils.ApexUtilsTest) ... ERROR
test_ApexApkSigner_noAssetDir (test_apex_utils.ApexUtilsTest) ... ERROR
test_ApexApkSigner_signApk (test_apex_utils.ApexUtilsTest) ... ERROR)

Merged-In: I996a33e0208d3dd3a04a31b8dafb27ef995297f2
Change-Id: I996a33e0208d3dd3a04a31b8dafb27ef995297f2
(cherry picked from commit a1887f326c)
2020-05-21 09:58:00 +09:00
Treehugger Robot ed67178e4a Merge "sign_apex.py respects hash algorithm" 2020-05-21 00:35:54 +00:00
Hongguang Chen f23364d280 Add options to sign the prebuilt custom images.
The custom images are any images owned by OEMs and SoCs, oem images
mounted on /oem is an example. The oem images can be used to customize
devices for different carriers, like wallpaper, ringtones, and
carrier-specific apks. OEMs can generate multiple oem images, like
oem.img, oem-carrier1.img and oem-carrier2.img and flash different oem
images for different carriers. The oem images are only one case, OEMs
and SoCs can add more custom images and mount them to custom partitions.

This change enables custom images to be vbmeta.img chained partitions.
The following configuration in BoardConfig.mk is an exmaple. It has two
custom partitions: oem and test. They will be signed by different keys.
And they will be chained by vbmeta.img. The custom images here are
prebuilts, which can be built by `make custom_images` separately.
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST should include all custom images
to apply AVB signing. And to every custom partition, one image whose
name is partition name must be added in its
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST.

BOARD_CUSTOMIMAGES_PARTITION_LIST := oem test

BOARD_AVB_OEM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
BOARD_AVB_OEM_ALGORITHM := SHA256_RSA4096
BOARD_AVB_OEM_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_OEM_ROLLBACK_INDEX_LOCATION := 1
BOARD_AVB_OEM_PARTITION_SIZE := 5242880
BOARD_AVB_OEM_IMAGE_LIST := \
    device/xxxx/yyyy/oem/oem.img \
    device/xxxx/yyyy/oem/oem1.img

BOARD_AVB_TEST_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
BOARD_AVB_TEST_ALGORITHM := SHA256_RSA2048
BOARD_AVB_TEST_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_TEST_ROLLBACK_INDEX_LOCATION := 2
BOARD_AVB_TEST_PARTITION_SIZE := 10485760
BOARD_AVB_TEST_IMAGE_LIST := \
    device/xxxx/yyyy/test/test.img \
    device/xxxx/yyyy/test/test1.img

To resign the custom images in the target zip file, the
avb_extra_custom_image_key, avb_extra_custom_image_algorithms and
avb_extra_custom_image_extra_args options are added to the
sign_target_files_apks tool too. The following test cases list some
examples about how to use them.

BUG: 154171021
Test: 1) "atest --host releasetools_test releasetools_py3_test -c"
  2) Build images by 'make dist', sign and validate target files.
   a) Test on dist w/ chained vbmeta_system and ome custom images
   sign_target_files_apks -d certs \
     --avb_extra_custom_image_key oem=oem_rsa4096.pem \
     --avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
     xxx-target_xxx.zip signed.zip
   validate_target_files.py signed.zip
   Flash image and boot up.
   Verify the oem images and vbmeta images in OUT and target zips by
   avbtool.

   b) Test on dist w/ chained vbmeta_system and oem and test custom images
   sign_target_files_apks -d certs \
     --avb_extra_custom_image_key oem=oem_rsa4096.pem \
     --avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
     --avb_extra_custom_image_extra_args oem=--do_not_generate_fec \
     --avb_extra_custom_image_key test=test_rsa4096.pem \
     --avb_extra_custom_image_algorithm test=SHA256_RSA4096 \
     xxx-target_xxx.zip signed.zip
   validate_target_files.py signed.zip
   Verify the oem, test images and vbmeta images in OUT and target zips
   by avbtool.

   c) Test on dist w/o chained partition.
   sign_target_files_apks -d certs xxx-target_xxx.zip signed.zip
   validate_target_files.py signed.zip
   Flash image and boot up.
   Verify the vbmeta images in OUT and target zips by avbtool.

Change-Id: Ifccfee5e8909697eef6ccda0cc352fa16a9f6db6
2020-05-20 04:10:00 +00:00
TreeHugger Robot 27e8474d57 Merge "support different boot partition sizes in aosp_arm64" into rvc-dev 2020-05-20 03:26:56 +00:00
TreeHugger Robot 9817fa2953 Merge "Fix the syntax in install-recovery.sh" into rvc-dev am: 581a943336
Change-Id: I00241508e40d7c3fb50d2bff6da376131d805682
2020-05-19 22:44:42 +00:00
Yifan Hong bdb3201353 Use add_slot_suffix function in edify script
Whenever a device is retrieved from fstab, wrap it with
add_slot_suffix() if it has slotselect option.

Test: change fstab (changes boot image, which is a static partition),
      change system partition (a dynamic partition),
      generate incremental OTA with --force_non_ab and apply it on
      cuttlefish
Bug: 153581609
Change-Id: Id3f8e4425b65176baf1b0ff1ee07ab3d820a3a7f
(cherry picked from commit ae6e0d5d28)
Merged-In: Id3f8e4425b65176baf1b0ff1ee07ab3d820a3a7f
2020-05-19 15:23:27 -07:00
Yifan Hong 65afc07f9d Support forcefully generating non-AB packages.
Force generate a non-A/B update package when requested.

Bug: 154344887
Test: ota_from_target_files.py --force_non_ab ...
Test: apply it as well

Change-Id: I5e81eb161722e07ef50081b6a16685cbc9963ae2
(cherry picked from commit 7169f754cc)
Merged-In: I5e81eb161722e07ef50081b6a16685cbc9963ae2
2020-05-19 15:23:27 -07:00
Treehugger Robot c7d65744c4 Merge "support different boot partition sizes in aosp_arm64" am: def74b4c2b am: 3bfb87b96b
Change-Id: Iff0c4a70c7a3ed43d2f96a72a0dd16c4301386f0
2020-05-19 22:02:28 +00:00
Steve Muckle 53226684b9 support different boot partition sizes in aosp_arm64
The different boot images in aosp_arm64 have different partition size
requirements. Add support for defining a partition size associated with
each boot image variant.

This support is limited to aosp_arm64 currently, which is built with
recovery-as-boot.

A previous version of this change did not update the boot-debug image
AVB logic with the required macro for multiple boot partition size
support. This is now required because the aosp-arm64 boot.img is
configured as a chained AVB partition.

Bug: 156036850
Bug: 155049180
Change-Id: I66b57de91042bfd56ba54a3659843d8cf7873955
Merged-In: I66b57de91042bfd56ba54a3659843d8cf7873955
2020-05-19 14:37:40 -07:00
Treehugger Robot def74b4c2b Merge "support different boot partition sizes in aosp_arm64" 2020-05-19 21:30:07 +00:00
Tianjie e55f62c971 Fix the syntax in install-recovery.sh
We recently modify the logic in install-recovery.sh to support
non-A/B updates on VAB launched devices. And the position of the
$(getprop ro.boot.slot_suffix) is misplaced for the recovery image.
For example:
"if ! applypatch --check EMMC$(getprop ro.boot.slot_suffix):/dev/block/recovery:SHA1"
should be:
"if ! applypatch --check EMMC:/dev/block/recovery$(getprop ro.boot.slot_suffix):SHA1"

Bug: 156979431
Test: rerun add_image_to_target_file, then validate_target_files
Change-Id: Id2d45e281151a46d66b37ea8fdb7b5cb4ae72e81
2020-05-19 13:44:26 -07:00
Jiyong Park a1887f326c sign_apex.py respects hash algorithm
When sign_apex.py re-signs an apex, the hash algorithm is extracted and
it is used when re-packaging the file.

Bug: 155771970
Test: releasetools_py3_test doesn't regress
(some tests were failed, but they failed even without this change:
test_ApexApkSigner_apkKeyNotPresent (test_apex_utils.ApexUtilsTest) ... ERROR
test_ApexApkSigner_noApkPresent (test_apex_utils.ApexUtilsTest) ... ERROR
test_ApexApkSigner_noAssetDir (test_apex_utils.ApexUtilsTest) ... ERROR
test_ApexApkSigner_signApk (test_apex_utils.ApexUtilsTest) ... ERROR)

Change-Id: I996a33e0208d3dd3a04a31b8dafb27ef995297f2
2020-05-19 23:19:59 +09:00
Treehugger Robot e18d90b28e Merge "Update auto-gen test config template with PARAMETERIZED_STRINGS placeholder" am: 203fd77042 am: b72fa3aaf6
Change-Id: I5ec86e149d8a5ec6dacc56afce1cfae81e714f5c
2020-05-18 02:28:33 +00:00
easoncylee 88936626cf Update auto-gen test config template with PARAMETERIZED_STRINGS
placeholder

Bug: 134509111
Test: add "test_mainline_modules: [some.apk]" to TetheringTests,
and build the modules, confirm the parameterized option is added
in the test config.

Change-Id: I0f4f837412075520153d21c9ca12cf5c3f555de7
Merged-In: I0f4f837412075520153d21c9ca12cf5c3f555de7
2020-05-18 09:58:18 +08:00
Treehugger Robot 203fd77042 Merge "Update auto-gen test config template with PARAMETERIZED_STRINGS placeholder" 2020-05-18 01:50:49 +00:00
Tianjie 620437b2bf Exclude vendor_boot in secondary payload
The secondary payload is used by factory OTA to speed up the first
boot of the device. The payload should only contain bootloaders
images and the precompiled apps in system_other. Remove vendor_boot
to reduce the secondary payload size.

Bug: 156782745
Test: build a package with secondary payload
Change-Id: I3a9f6dda00a5aac038438065e2bc6483d71b5e95
(cherry picked from commit c385064d94)
2020-05-15 22:36:00 +00:00
Steve Muckle 903a1ca7e1 support different boot partition sizes in aosp_arm64
The different boot images in aosp_arm64 have different partition size
requirements. Add support for defining a partition size associated with
each boot image variant.

This support is limited to aosp_arm64 currently, which is built with
recovery-as-boot.

A previous version of this change did not update the boot-debug image
AVB logic with the required macro for multiple boot partition size
support. This is now required because the aosp-arm64 boot.img is
configured as a chained AVB partition.

Bug: 156036850
Bug: 155049180
Change-Id: I66b57de91042bfd56ba54a3659843d8cf7873955
2020-05-15 10:16:17 -07:00
easoncylee 9425870f73 Update auto-gen test config template with PARAMETERIZED_STRINGS
placeholder

Bug: 134509111
Test: add "test_mainline_modules: [some.apk]" to TetheringTests,
and build the modules, confirm the parameterized option is added
in the test config.

Change-Id: I0f4f837412075520153d21c9ca12cf5c3f555de7
2020-05-15 11:43:43 +08:00
Treehugger Robot b05afb3207 Merge "Fix _ImportParser() error if property is imported from oem partition." am: f774ae9aa0 am: 16402667c4
Change-Id: I9ad800b0f5aad55eac82c802cbb6b1b5a1926245
2020-05-15 01:18:06 +00:00
Hongguang Chen b4702b7006 Fix _ImportParser() error if property is imported from oem partition.
The oem partition allows system build.prop to import properties from it
by "import /oem/oem.prop xxxx". An _ImportParser() error was raised on
this case.

BUG: 154171021
Test: 1) "atest --host releasetools_test releasetools_py3_test -c"
      2) On a device who has oem partition, "make dist" and sign its
      target zip file.
Change-Id: I47875bf7a698390e11690150e6516a3064550ca0
2020-05-14 17:44:14 +00:00
Paul Duffin 00f6a090c2 Merge "Revert "support different boot partition sizes in aosp_arm64"" am: 29beb858ef am: 61b3971e66
Change-Id: I9bfa60c9d39199735676b776cde921d9628c7209
2020-05-14 09:57:56 +00:00
Paul Duffin 29beb858ef Merge "Revert "support different boot partition sizes in aosp_arm64"" 2020-05-14 09:23:49 +00:00
Paul Duffin b5a334d0b3 Revert "support different boot partition sizes in aosp_arm64"
This reverts commit 11c4bcf406.

Reason for revert: Broke build b/156569314

Bug: 156569314
Change-Id: I384740320acf48d09b0544e45b5a13ff0a6a163d
2020-05-14 08:40:52 +00:00
Treehugger Robot 50639bd4cb Merge "support different boot partition sizes in aosp_arm64" am: ade028ea9e am: 6f978c6b7f
Change-Id: Icaf368a8bb753eff980bc053395ad09033dfd47d
2020-05-14 07:52:31 +00:00
Treehugger Robot ade028ea9e Merge "support different boot partition sizes in aosp_arm64" 2020-05-14 07:05:31 +00:00
Tianjie Xu c7ff3baddf Merge "Exclude vendor_boot in secondary payload" am: 7a3cf2c4ba am: f6dd644e6b
Change-Id: I5620b9b975de46c5d99c30b0166a8d4a846e83d6
2020-05-14 03:07:54 +00:00
Tianjie c385064d94 Exclude vendor_boot in secondary payload
The secondary payload is used by factory OTA to speed up the first
boot of the device. The payload should only contain bootloaders
images and the precompiled apps in system_other. Remove vendor_boot
to reduce the secondary payload size.

Test: build a package with secondary payload
Change-Id: I3a9f6dda00a5aac038438065e2bc6483d71b5e95
2020-05-13 14:47:31 -07:00
TreeHugger Robot 1f3678e84c Merge changes from topic "nonab_on_vab_r" into rvc-dev am: 4d8e9cc847
Change-Id: I18ae2cc04e6edad5498fdc0c2de6f5a163d10c82
2020-05-13 18:25:35 +00:00
Yifan Hong 010d320848 resolve merge conflicts of 7169f754cc to rvc-dev-plus-aosp
Change-Id: Ic1a44cfe929707e2fb76282dcd06f839a8159735
2020-05-13 17:44:04 +00:00
TreeHugger Robot 4d8e9cc847 Merge changes from topic "nonab_on_vab_r" into rvc-dev
* changes:
  Use add_slot_suffix function in edify script
  Support forcefully generating non-AB packages.
2020-05-13 17:26:44 +00:00
Steve Muckle 11c4bcf406 support different boot partition sizes in aosp_arm64
The different boot images in aosp_arm64 have different partition size
requirements. Add support for defining a partition size associated with
each boot image variant.

This support is limited to aosp_arm64 currently, which is built with
recovery-as-boot.

Bug: 156036850
Bug: 155049180
Change-Id: I73b70a4d52c2662c3015899632bb8a2b424108d5
2020-05-12 16:51:45 -07:00
Tianjie Xu 6c9400948c Merge "Reland "Calculate the runtime fingerprint prefixes from build prop"" am: e9ab85956f am: 728d35e3a9
Change-Id: Ifdd0fd225c0e0d7cdcb10442dacafcf986a197f7
2020-05-12 19:19:51 +00:00
Tianjie Xu dca53f1a18 Merge "Reland "Add a wrapper class PartitionBuildProp""" am: 49b45296f6 am: 2399593a28
Change-Id: I6f5d7244907bec60b1a4641327874ff95bdb551f
2020-05-11 22:09:22 +00:00
Luca Stefani 972a64ec8d releasetools: Add signapk as required modules
* common.py requires the signapk jar

Bug: 156149605
Test: m otapackage ( before it was broken )
Change-Id: Ic0cff0a21258cb1e7d1ced5553a940dcf5cd6d04
Merged-In: Ic0cff0a21258cb1e7d1ced5553a940dcf5cd6d04
2020-05-11 14:39:36 +01:00
Tianjie Xu 9afb221c9e Reland "Calculate the runtime fingerprint prefixes from build prop"
This reverts commit b21e48b499.

In practice, some partners use the 'import' statement to override
the device fingerprint at runtime. The runtime fingerprint will
later add to the metadata of OTA package, so that the OTA server
can deliver the package to corresponding devices correctly.

This CL supports parsing a subset of import statement that the init
process recognizes. And we loose the restriction based on how the
dynamic fingerprint is used in practice. Right now, we only searches
for the override of brand, name and device. And the placeholder
format should be ${placeholder}, with its value supplied by the
script caller.

As part of the implementation, we generate all the possible
combinations of the input boot variables. And recalculate the
fingerprint for each of the combination. Though we load the
build.prop multiple times, the logic is easier to follow. Also,
it's more convenient to enhance the logic if we only want to
allow some of the boot variables combination later.

Bug: 152167826
Change-Id: I4a9fa35c7ac037ff1cf4f9a4bdff602beac3894b
Test: unittests pass
2020-05-10 21:49:53 +00:00
Tianjie Xu 0fde41e711 Reland "Add a wrapper class PartitionBuildProp""
This reverts commit 6022545272.

The build prop for a partition used to be a simple key:value
dictionary. But we need more fields to hold the alternative build
props overriden by the 'import' statement. Therefore, add a new
class as a wrapper for these props first.

Bug: 152167826
Change-Id: I5c952cd2a976ba1a09ddc66d56c2b8b55a61986b
Test: unittests pass
2020-05-09 05:24:18 +00:00
Greg Kaiser 3fd11f86a6 Merge changes from topic "revert-1297095-MANSYJSCZY" am: 763c8a7691 am: 7eb76f74d9
Change-Id: If2a0528ccea808512dca010d68929ad841607070
2020-05-09 00:58:29 +00:00
Greg Kaiser 6022545272 Revert "Add a wrapper class PartitionBuildProp"
Revert submission 1297095

Bug: 156131275
Reason for revert: Broken build
Reverted Changes:
I2fe7e93a2:Add a wrapper class PartitionBuildProp
Iac093a40d:Calculate the runtime fingerprint prefixes from bu...

Change-Id: Ie846d23b9f5c3325d021236725826512be7a3c78
2020-05-09 00:30:33 +00:00
Greg Kaiser b21e48b499 Revert "Calculate the runtime fingerprint prefixes from build prop"
Revert submission 1297095

Bug: 156131275
Reason for revert: Broken build
Reverted Changes:
I2fe7e93a2:Add a wrapper class PartitionBuildProp
Iac093a40d:Calculate the runtime fingerprint prefixes from bu...

Change-Id: I8b1262c6e94a1db349de39896e56f366c8d64d4c
2020-05-09 00:30:33 +00:00
Tianjie Xu e9dc695f60 Merge changes Iac093a40,I2fe7e93a am: 8aba9ec7c8 am: 93eec51aa4
Change-Id: I3f20e7d90ccf0d83aab03f6d89e3b2522b596ffc
2020-05-08 21:26:19 +00:00
Tianjie 0d2fcd50d7 Calculate the runtime fingerprint prefixes from build prop
In practice, some partners use the 'import' statement to override
the device fingerprint at runtime. The runtime fingerprint will
later add to the metadata of OTA package, so that the OTA server
can deliver the package to corresponding devices correctly.

This CL supports parsing a subset of import statement that the init
process recognizes. And we loose the restriction based on how the
dynamic fingerprint is used in practice. Right now, we only searches
for the override of brand, name and device. And the placeholder
format should be ${placeholder}, with its value supplied by the
script caller.

As part of the implementation, we generate all the possible
combinations of the input boot variables. And recalculate the
fingerprint for each of the combination. Though we load the
build.prop multiple times, the logic is easier to follow. Also,
it's more convenient to enhance the logic if we only want to
allow some of the boot variables combination later.

Bug: 152167826
Test: unittests pass
Change-Id: Iac093a40dc6f873c5e1858efa44cb2bd6082508a
2020-05-07 23:52:07 -07:00