Commit Graph

6831 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Yifan Hong ae6e0d5d28 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
2020-05-07 16:55:39 -07:00
Yifan Hong 7169f754cc 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
2020-05-07 12:48:17 -07:00
P.Adarsh Reddy e4d5d568a3 releasetools: Fallback to "mkbootimg_args" if "recovery_mkbootimg_args" not found.
For older target_files.zip, since "recovery_mkbootimg_args" may not be
set fallback to the earlier config -"mkbootimg_args" for recovery image.
This will make releasetools backward compatible, and usable for
older/already generated target-files package.

Bug: 155708400
Change-Id: If40359130b8e6da48cb8c345d8cb079f457fe36f
Merged-In: If40359130b8e6da48cb8c345d8cb079f457fe36f
2020-05-07 09:15:57 -07:00
Tianjie fd3883f159 Add a wrapper class PartitionBuildProp
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
Test: unittests pass
Change-Id: I2fe7e93a2f4de8e55f5f8051b000b96b5efdc85a
2020-05-06 22:09:44 -07:00
Treehugger Robot aa887670ae Merge "releasetools: Fallback to "mkbootimg_args" if "recovery_mkbootimg_args" not found." am: ec8abc0eb3 am: ec788a7f58
Change-Id: Id69aafe1eb55e2f126f53d302dfaf91740015f0f
2020-05-06 08:08:57 +00:00
Treehugger Robot ec8abc0eb3 Merge "releasetools: Fallback to "mkbootimg_args" if "recovery_mkbootimg_args" not found." 2020-05-06 07:32:12 +00:00
Treehugger Robot bcf9ffa819 Merge "Allow passing in codename_to_api_level_map to sign_apex." 2020-05-05 19:00:11 +00:00
Yifan Hong b1ee30d728 Merge "Fix check target files vintf test." am: 2637f8bec7 am: 90095aeb1f
Change-Id: I0db3785d55ac50a4744fed0857bf9d2944bc0754
2020-05-05 15:49:38 +00:00
Jeff Sharkey 2a5b9342f0 Merge "Split MediaProvider into its own target." into rvc-dev am: f068a60e8a
Change-Id: I7efc2e73ce5798c19432f4004b7cf913599ccbd1
2020-05-05 15:37:01 +00:00
Yifan Hong 2637f8bec7 Merge "Fix check target files vintf test." 2020-05-05 15:23:17 +00:00
Jeff Sharkey f068a60e8a Merge "Split MediaProvider into its own target." into rvc-dev 2020-05-05 15:21:13 +00:00
Hongguang Chen 3435403284 Skip _oem_props if oem_dicts is None.
The oem_dicts in BuildInfo is only available to ota_from_target_files
when it's called with "--oem_settings" input. However, aosp/1135332
starts to use BuildInfo in add_img_to_target_files w/o oem_dicts. An
assert is triggered due to it when oem_fingerprint_properties is in the
info_dict.
This change skips _oem_props reading if oem_dicts is None to allow this
case.

BUG: 155360923
BUG: 154171021
Test: Sign images with oem_fingerprint_properties.
Change-Id: I6a73feecd9567fd4d85f4eab3d4e11c5df28fe39
Merged-In: Idfd41c8b20b23d50e4895f24500f9a25625b7d98
2020-05-04 20:45:33 +00:00
Treehugger Robot 59abc40f73 Merge "Skip _oem_props if oem_dicts is None." am: 6464edbf3e am: 67893b73c6
Change-Id: I6b68f078908546571917ecf75cc52e4ebf0df10d
2020-05-04 19:33:12 +00:00
Hongguang Chen d7c160ffbf Skip _oem_props if oem_dicts is None.
The oem_dicts in BuildInfo is only available to ota_from_target_files
when it's called with "--oem_settings" input. However, aosp/1135332
starts to use BuildInfo in add_img_to_target_files w/o oem_dicts. An
assert is triggered due to it when oem_fingerprint_properties is in the
info_dict.
This change skip _oem_props reading if oem_dicts is None to allow to
this case.

BUG: 155360923
BUG: 154171021
Test: Sign images with oem_fingerprint_properties.
Change-Id: I6a73feecd9567fd4d85f4eab3d4e11c5df28fe39
2020-05-04 16:54:10 +00:00
P.Adarsh Reddy d8e24eee70 releasetools: Fallback to "mkbootimg_args" if "recovery_mkbootimg_args" not found.
For older target_files.zip, since "recovery_mkbootimg_args" may not be
set fallback to the earlier config -"mkbootimg_args" for recovery image.
This will make releasetools backward compatible, and usable for
older/already generated target-files package.

Change-Id: If40359130b8e6da48cb8c345d8cb079f457fe36f
2020-05-04 14:30:09 +00:00
Jeff Sharkey 7a3c61259e Split MediaProvider into its own target.
As we move towards becoming a Mainline module, it's important that
we catch as many bugs as possible during initial code review, and
Error Prone is designed to do exactly that.

Instead of lumping ourselves into the generic "packages" grouping,
this change adds a specific package for this Mainline module.

Bug: 142561358
Test: ./build/soong/soong_ui.bash --make-mode MediaProviderLegacy com.google.android.mediaprovider MediaProviderTests RUN_ERROR_PRONE=true
Change-Id: I62102febe39225a54c77d9ad463c350b3df9cafa
2020-05-03 11:36:17 -06:00
Yifan Hong 975e2bef86 Fix check target files vintf test.
check_vintf now checks deprecation as well, which
requires matrix fragments to exist. Update tests to
reflect this.

The test also uses legacy vendor manifest path, which makes
it not combined with the ODM manifests, causing sku_compat
test to fail. Fix it by using the new vendor manifest path
(which libvintf correctly combines it with the ODM manifests.)

Fixes: 155131894
Test: python -m unittest test_check_target_files_vintf
Change-Id: Ib660f8796efc3465d9513688695dac29c63a7514
2020-05-01 16:34:22 -07:00
Baligh Uddin d9fcafd612 Allow passing in codename_to_api_level_map to sign_apex.
BUG: 154517483
Change-Id: I93a90ae066b0e9eeb1b2ff26d9cb9b07a11fe68c
Merged-In: I93a90ae066b0e9eeb1b2ff26d9cb9b07a11fe68c
2020-05-01 13:56:04 +00:00
Steven Laver dd33d75d39 releasetools: correct allowed property sources for incremental OTAs
When loading build info from a previous version of Android, the set of
allowed property sources should match those available in that version.
In this particular case, the product_services partition was a valid
property source in Android 10.

Bug: 155053195
Test: ran unit tests from test_common.py
Test: generated an incremental OTA which previously failed
Change-Id: Ic0b0a112656533eca78dee31517deff7e3c8d7cc
Merged-In: Ic0b0a112656533eca78dee31517deff7e3c8d7cc
2020-04-30 10:54:48 -07:00