Commit Graph

7257 Commits

Author SHA1 Message Date
Justin Yun 48aa78ed3c Remove grf_required_api_level
As we don't fix the grf window, we may not calculate the grf
expiration date and the required api level.
The verification of this will be covered by the tests at run time.

Bug: 176950752
Test: atest --host post_process_props_unittest
Change-Id: I1205f0d9a9da5bc508a49acbcbb7da581800bf45
2021-04-13 17:58:59 +09:00
Stefen Wakefield 4260fc1575 sign_target_files_apks: Relax ro.build.description requirements
Some OEMs, namely OnePlus don't use AOSP compliant build description.
Making sure that the last piece ends with -keys is more than enough.

Change-Id: Iefa3c408a3fdda0b63db257befb8ba2d36793293
2021-04-12 17:33:29 +00:00
jiajia tang 836f76bc3a Unify the style of _MakeRamdisk for ramdisk format
RamdiskFormat class is introduced by commit : f3f842b676
But it seems _MakeRamdisk() related codes are also needed, then
both of the code style are same.

This patch takes below 2 changes:
1) adds new commom function _GetRamdiskFormat()
2) unfiy the code logic of _MakeRamdisk() and its related code logic.

Change-Id: Ibd4932a6050fbac15fcd741c70dd7854c12e887d
Signed-off-by: jiajia tang <tangjiajia@xiaomi.com>
2021-04-08 09:55:15 +00:00
Treehugger Robot 222b4ab071 Merge "Use BOARD_API_LEVEL to define ro.board.api_level" 2021-04-08 00:15:06 +00:00
David Anderson 5ebe28c1d4 Merge "Relax inode usage estimate." 2021-04-07 02:15:39 +00:00
Treehugger Robot 2fea84f592 Merge "zipalign: clarify the help for -p slightly." 2021-04-06 19:15:43 +00:00
Justin Yun 07ceaa71c1 Use BOARD_API_LEVEL to define ro.board.api_level
GRF devices must define the API level of which the SoC is first
shipped by setting BOARD_SHIPPING_API_LEVEL. As this is a permanent
value, vendors may not change this value even if they implement new
features under the GRF policy.

BOARD_API_LEVEL can be optionally defined in this case to manually
set the api level of the vendor implementation.
The current api level will be set to `ro.board.api_level` property.

Bug: 176950752
Test: atest --host post_process_props_unittest
Change-Id: Ib126c1a622ded9848650f3f60c0f15005867272d
2021-04-06 16:33:07 +09:00
Elliott Hughes f4800de454 zipalign: clarify the help for -p slightly.
Bug: http://b/141281419
Test: treehugger
Change-Id: If331ad0450433bfb8e585e3df3727dd09ef14c66
2021-04-05 16:02:16 -07:00
Daniel Norman 25444470db Merge "Revert "Generate care map after merging target_files"" 2021-04-05 22:43:07 +00:00
David Anderson 203057cb9b Relax inode usage estimate.
The current inode usage estimate applies a factor (1.04x) to account for
differences between the directory and file count and what mkfs.ext4
produces. Bump this to 1.06x to allow more leniency.

This increases bramble partition sizes by 32KB total.

Bug: 182365132
Test: manual test
Change-Id: I9ade82cb89422e31ae8c5df9fff31157e88278c5
2021-04-05 13:45:02 -07:00
Daniel Norman 2d7989a635 Revert "Generate care map after merging target_files"
This reverts commit c184fa1887.

Reason for revert: b/184541365

Change-Id: Icbcbb6deb92863f4a468b9fa54f18d824a6f0939
2021-04-05 17:40:47 +00:00
Treehugger Robot f92961248b Merge "Generate care map after merging target_files" 2021-04-05 04:43:27 +00:00
Treehugger Robot d2170430fe Merge "Don't disable verity if VABC is disabled" 2021-04-02 22:52:45 +00:00
Sasha Smundak 57bb5081d7 Always use /bin/sh to run the command.
SHELL environment variable cannot be relied on because the rbcrun
can be run as `env - rbcrun ...`

Fixes: 184278019
Test: build/soong/soong_ui.bash --make-mode USE_BAZEL=1 TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug droid dist platform_tests
Change-Id: Id8fc7fd1ae8f2e674028ba5ffb3616f87eea6bc4
2021-04-01 16:44:47 -07:00
Kelvin Zhang c184fa1887 Generate care map after merging target_files
Test: th
Bug: 182296208
Change-Id: I12c0732961ec1c4d18f5cc4d136c98babba23d82
2021-04-01 17:04:12 -04:00
Kelvin Zhang 50dc1b88b7 Don't disable verity if VABC is disabled
Test: th
Change-Id: Icef5315047aa783219e1dcb6678adaa084626e52
2021-04-01 17:04:12 -04:00
Tianjie Xu 98c8507215 Merge "Fix error if ramdisk is minigzip compression" 2021-04-01 20:15:35 +00:00
Bob Badour bfa8d0cacc [LSC] Add LOCAL_LICENSE_KINDS to build/make
Added SPDX-license-identifier-Apache-2.0 to:
  tools/rbcrun/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I6a1c75458115b15d9d0d9f0dbc11e0acffc1fe7b
2021-03-31 19:57:06 -07:00
jiajia tang f3f842b676 Fix error if ramdisk is minigzip compression
This change intends to fix if ramdisk is not "lz4" compression.
Legacy is "minigzip" compression.

If not lz4, the following error will happen when exec build_super_image.py:
  Unable to get boot image build props: Failed to run command '['lz4', '-d', '/tmp/boot_omdZZ8.img/ramdisk', '/tmp/boot_omdZZ8.img/uncompressed_ramdisk']' (exit code 44):
  Error 44 : Unrecognized header : file cannot be decoded

Change-Id: I71248387bbeecbf184e0c24e6346c235d728518e
Signed-off-by: jiajia tang <tangjiajia@xiaomi.com>
2021-04-01 10:41:00 +08:00
Alexander Smundak fe5799af6b Merge changes from topic "product_config_star"
* changes:
  Product configuration in Starlark support files.
  Roboleaf product configuration runner
2021-03-31 18:28:50 +00:00
Yo Chiang e86bab474b Revert^2 "Add option to allow product makefiles to skip building s..."
This reverts commit ccfea17fb7.

Reason for revert: Original bug was resolved by updating branch config

Change-Id: I2327092261a2147fa8f2be3d878db04228e65511
2021-03-25 10:12:28 +00:00
Tianjie Xu ccfea17fb7 Revert "Add option to allow product makefiles to skip building s..."
Revert submission 1644988-nextgen-release-img-zip-cleanup

Reason for revert: b/183654818
Reverted Changes:
I2474e5fd6:Nextgen release: Don't build super_empty.img
I549439528:Add option to allow product makefiles to skip buil...

Change-Id: I711d1c288eed17686b048144d8d41c0fdd5cd8e1
2021-03-25 05:00:12 +00:00
Yi-Yo Chiang ba959a5ff1 Add option to allow product makefiles to skip building super_empty.img
This change doesn't change the condition for building super_empty.img,
it just add a toggle PRODUCT_BUILD_SUPER_EMPTY_IMAGE that product
makefiles can use to skip building super_empty.img.
Products that don't use super_empty at all, for example GSI, can set
this option to ensure the super_empty.img is not built.

Bug: 183068624
Test: "m dist" on GSI and check the build artifacts under OUT and DIST
  directories, and check the contents of *-img-*.zip
Change-Id: I54943952873d2d297fd9d18cbe14742bc12ae9c6
2021-03-24 05:35:10 +00:00
Treehugger Robot 30f09a1a2e Merge "Support GKI boot.img v4 signing" 2021-03-23 00:24:33 +00:00
Bowgo Tsai 27c39b0af2 Support GKI boot.img v4 signing
Commit I9967d06bde0e18a12b84b5b0b568db09765fe305 supports adding a
generic boot_signature into boot.img v4. This change allows replacing
the boot_signture signing key with a release key during the release
process.

The default GKI signing key can be specified in a BoardConfig.mk via:

  BOARD_GKI_SIGNING_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
  BOARD_GKI_SIGNING_ALGORITHM := SHA256_RSA2048
  BOARD_GKI_SIGNING_SIGNATURE_ARGS := --prop foo:bar

The release signing key/algorithm can be specified by the following options
when invoking sign_target_files_apks:

  --gki_signing_key=external/avb/test/data/testkey_rsa4096.pem
  --gki_signing_algorithm=SHA256_RSA4096

Additional arguments for generating the GKI signature can be
specified as below:

  --gki_signing_extra_args="--prop gki:prop1 --prop gki:prop2"

Bug: 177862434
Test: make dist
Test: sign_target_files_apks \
        --gki_signing_key=external/avb/test/data/testkey_rsa4096.pem \
        --gki_signing_algorithm=SHA256_RSA4096 \
        --gki_signing_extra_args="--prop gki:prop1 --prop gki:prop2" \
        ./out/dist/*-target_files-eng.*.zip signed.zip
Test: Checks GKI boot_signature is expected after signing:
      `unzip signed.zip IMAGES/boot.img`
      `unpack_bootimg --boot_img IMAGES/boot.img --out unpack`
      `avbtool info_image --image unpack/boot_signature`
Test: unit test: releasetools_test and releasetools_py3_test

Change-Id: I61dadbc242360e4cab3dc70295931b4a5b9422a9
2021-03-19 17:11:04 +08:00
Tianjie Xu c63bf0ad7a Merge "Check that sum of DAP groups is smaller than super" 2021-03-18 17:33:29 +00:00
Sasha Smundak 24159db21e Roboleaf product configuration runner
The application rbcrun executes Starlark scripts that define Android product configurations.
See README.md for details.

Test: go test
Fixes: 180529448
Change-Id: I7d728b47d3f381b7052a0d7d51c9e698e5c2e316
2021-03-18 10:03:59 -07:00
Jiyong Park b92b8f48fc verity_utils.py is a standalone binary
verity_utils.py gets an entry point and becomes a host binary. This is
to support signing images from the "bootimg" module type. Previously
this was done by directly invoking "avbtool" from the soong module, but
that required people to know the partition_size priori. The partition
size may not be known before actually building the partition image
especially when the partition is not for a physical partition but for a
partition in a composite image.

verity_utils.py, when the partition_size is not given, is capable of
calculating the mininum required partition size based on the size of the
unsigned input image file.

Bug: 180676957
Test: m microdroid_boot-5.10
Change-Id: I7bef292fb141c90899b7bdc0748895f95f964829
2021-03-17 16:28:16 +09:00
Tianjie 8ba4270e24 Check that sum of DAP groups is smaller than super
The maximum size of all dynamic partition groups should not exceed
the super size - DAP metadata size. Today the configuration of
some devices don't take the metadata into acount. So turn the CheckLe
into CheckLt.

Also, display a warning if the reserved size for DAP metadata is less
than 1M.

Bug: 182431975
Test: mm -j32 check-all-partition-sizes
Change-Id: Ie278f224321083e457d68da000c2b22ec8a54085
2021-03-16 22:13:13 -07:00
Treehugger Robot b7ade64e3f Merge "Trigger data wipe on spl-downgrade as well" 2021-03-12 18:50:38 +00:00
David Anderson 45b4230726 Add --disable_vabc to ota_from_target_files help text.
Bug: N/A
Test: N/A
Change-Id: Ib8f9cd5dae746b0f2dac15d4de378116f4b93178
2021-03-11 13:01:31 -08:00
Kelvin Zhang 06400177a3 Trigger data wipe on spl-downgrade as well
Test: make an spl-downgrade pkg
Change-Id: I3220719a1b3fe6b2f07bfb9fd526ec6e94ca16ba
2021-03-10 11:06:10 -05:00
Tianjie bf0b8a8610 Add a check for missing entries in AVB_FOOTER_ARGS_BY_PARTITION
Fail the signing if the AVB_FOOTER_ARGS_BY_PARTITION isn't in sync
with common.AVB_PARTITIONS.

Bug: 181787095
Test: run sign_target_files_apks on a S image

Change-Id: I6ccf5fb9f39b92c1da2554f5b3826d2cd87d84d7
2021-03-03 17:31:48 -08:00
Tianjie 697c6eecf6 Add missing R partitions in AVB_FOOTER_ARGS
If we miss these entries, the signing script won't correctly update
the avb prop to build the vbmeta. This cl adds the missing partitions
for R build.

In the followup, we need to make the map in sync with AVB_PARTITIONS in
common.py

Bug: 181787095
Test: run sign_target_files_apks
Change-Id: I39a308fb7028b45ce08f0ca3c6ad61a6c13e8082
2021-03-03 15:28:58 -08:00
Andrew Scull 5553b5704c Merge "Add pvmfw partition to target files" 2021-03-01 21:05:56 +00:00
Treehugger Robot 0a4788c3fb Merge "support pre-defined timestamp and uuid when bulid EROFS images" 2021-03-01 06:29:49 +00:00
Treehugger Robot d33ae8363c Merge "Add spl-downgrade field to ota metadata" 2021-02-25 22:51:26 +00:00
Kelvin Zhang 05ff7055b6 Add spl-downgrade field to ota metadata
In aosp/1581143 , we banned generation of SPL downgrade OTAs. However,
caller of OTA script can still force an SPL downgrade OTA by passing
--spl_downgrade flag. If this flag is specified, we propagate it to OTA
metadata so that GOTA server can properly honor this flag.

Test: th
Change-Id: Ic8cdc850d2210f4149ad9121fa4ed2e5a4f59bcc
2021-02-25 10:15:45 -05:00
Treehugger Robot 90c1763c0c Merge "releasetools: Fix an issue in common.GetSparseImage" 2021-02-25 05:05:42 +00:00
wangshumin 71af07abe8 releasetools: Fix an issue in common.GetSparseImage
Fix incorrect report "Failed to find the ZIP entry" error when
generate OTA package.

This happens when we have a file in ROOT which name contains 'system'
such as init.system_init.rc, and init.system_init.rc will be rename to
init.SYSTEM_init.rc incorrectly, so we failed to find the entry in ZIP.

Test: manual test
Change-Id: I97359e513aaca7521fe9c035f6a4264a2053b86d
Signed-off-by: wangshumin <wangshumin@xiaomi.com>
2021-02-25 09:34:57 +08:00
Joe Onorato 6af489099a Merge "ALLOW_RULES_IN_PRODUCT_CONFIG" 2021-02-24 17:43:37 +00:00
Devin Moore fd4f3c4c63 Merge "Support vendor bootconfig creation" 2021-02-24 15:56:48 +00:00
Joe Onorato 749c1955a2 ALLOW_RULES_IN_PRODUCT_CONFIG
If ALLOW_RULES_IN_PRODUCT_CONFIG is set, pass it to kati via
.KATI_ALLOW_RULES, to issue warnings or errors about rules
during product configuration.

Test: CHECK_FOR_RULES=true ./build/make/tools/product_config/test.sh
Test: ALLOW_RULES_IN_PRODUCT_CONFIG=error m nothing
Test: ALLOW_RULES_IN_PRODUCT_CONFIG=warning m nothing
Test: m nothing
Change-Id: I35dd9ffe4ec71f97beaa8b8a2f10d80502088af2
2021-02-23 22:40:39 -08:00
Joe Onorato fbabf70394 Merge "Generate FlatConfig objects from GenericConfig objects." 2021-02-24 05:57:33 +00:00
Daniel Norman 48603ff158 Creates a combined split-sepolicy file in merge_target_files.py.
This follows the same steps as OpenSplitPolicy() in
system/core/init/selinux.cpp on the device.

Bug: 178864050
Test: merge_target_files for R+S and S+S devices
Test: test_merge_target_files
Change-Id: Ia41a436bfda8e2cb65706122f0ff3805b99d16e1
2021-02-23 11:41:29 -08:00
Devin Moore 50509015bf Support vendor bootconfig creation
Gather all BOARD_BOOTCONFIG parameters.
Create vendor-bootconfig.img with parameters seperated by newlines. Pass
that file to mkbootimg as --vendor_bootconfig to add it to the
vendor_boot.img.

Test: Add BOARD_BOOTCONFIG parameters in cuttlefish .mk file
      Check vendor-bootconfig.img for expected output
      Verify expected vendor_boot.img format with:
      unpack_bootimg --boot_image vendor_boot.img
Test: Update Cuttlefish bootloader to handle the new vendor_boot.img and
      check /proc/bootconfig for the expexted parameters.
Bug: 173815685
Change-Id: Iaa9b71b4bc64375777a5353396e83bb2beb25c47
2021-02-23 07:42:05 -08:00
Joe Onorato 38a57bf1df Generate FlatConfig objects from GenericConfig objects.
Doesn't include tests. More of those will come later.

Test: build/make/tools/product_config/test.sh
Change-Id: Icd2b455ac5f7b4773ba332fc40e994dc6f024f1b
2021-02-22 17:18:07 -08:00
Joe Onorato 5af98130b8 Merge "Add tool to find problems with build repeatability." 2021-02-22 05:34:34 +00:00
Joe Onorato 2590206000 Move VarType out of its respective outer classes.
It's used more than I originally thought it would be and it's
unnecessarily nested.

Test: rm -rf out/config/ && m product-config-test product-config && java -jar out/host/linux-x86/testcases/product-config-test/product-config-test.jar && time ( product-config --ckati_bin /source/kati/ckati > ~/Desktop/out.txt )
Change-Id: Id5a075863151e37ec60e5d9dbeb817c2df245bc7
2021-02-21 14:33:33 -08:00
Tianjie Xu 5b1c0a347c Merge "Sign APEXes on all partitions" 2021-02-19 21:41:02 +00:00
Joe Onorato 2fd88e0600 Merge changes I9c1995f8,Id6763781,I52e5c07f,I4706e32f,I7d74b226
* changes:
  Keep the first and last snapshot of variables.
  Generate GenericConfig objects from MakeConfig objects.
  Emit and parse the product config variables from kati/make
  Add class to fork and exec kati, based on the commandline option given.
  Add a CSV parser to parse the output from kati.
2021-02-19 16:56:13 +00:00
Andrew Scull e077cf764f Add pvmfw partition to target files
The pvmfw is included in an `m` build but not in the distribution files.
Apply the same treatment as the dtbo partition to copy the pvmfw
partition to dist/ since, similar to the dtbo image, the pvmfw image is
generally provided as a prebuilt image.

Test: make dist
Bug: 174457787
Change-Id: I6f42517ba42db92e90048d1236d7255ccbd73f73
2021-02-19 13:07:32 +00:00
Huang Jianan 1ed889befc support pre-defined timestamp and uuid when bulid EROFS images
Bug:180682930
Test: erofs image can be set to input timestamp and UUID
Change-Id: I71e455350db51096e18ab5a03123500d56ebe252
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-02-19 08:51:46 +00:00
Tianjie 5bd0395570 Sign APEXes on all partitions
Bundle APEXes may exist on other partitions than system, e.g. vendor,
system_ext. And leaving them unsigned may cause security problems.

Bug: 180675334
Test: run sign_target_files_apks
Change-Id: Ib912a026f4010d818161a89b11f818180208843f
2021-02-18 23:02:36 -08:00
Daniel Norman b4b07aba7d Returns empty apex_infos if the apex target dir does not exist.
This is needed for partial builds that do not have the apex directory in
their target files package.

Test: build target files for a partial vendor-only build.
Change-Id: I076bfbd1a81cccddcef795f5edeaf2b51538cdec
2021-02-17 22:24:48 +00:00
Joe Onorato 64f3db2ec1 Keep the first and last snapshot of variables.
So we can compare our reconstruction of the variable state.

Test: treehugger
Change-Id: I9c1995f8969dcf95256aa7c05a01d0431e36caa2
2021-02-17 10:02:41 -08:00
Joe Onorato 8523601ce9 Generate GenericConfig objects from MakeConfig objects.
Applies heuristics to the sequence of Blocks to do so.

Test: rm -rf out/config/ && m product-config-test product-config && java -jar out/host/linux-x86/testcases/product-config-test/product-config-test.jar && time ( out/host/linux-x86/bin/product-config --ckati_bin /source/kati/ckati > ~/Desktop/out.txt )
Change-Id: Id6763781bc876e2b2e0be320a7259c1ed41c2334
2021-02-17 10:02:41 -08:00
Joe Onorato f20c93afa3 Emit and parse the product config variables from kati/make
Test: cls && rm -rf out/config/ && m product-config-test product-config && java -jar out/host/linux-x86/testcases/product-config-test/product-config-test.jar && time ( product-config --ckati_bin /source/kati/ckati > ~/Desktop/out.txt )
Change-Id: I52e5c07f9aaf899f9d45680313275c6d9e246ff2
2021-02-17 10:02:41 -08:00
Joe Onorato 9de9652582 Add class to fork and exec kati, based on the commandline option given.
Test: m product-config-test && java -jar out/host/linux-x86/testcases/product-config-test/product-config-test.jar
Change-Id: I4706e32ff7ac4424b6835b94fef40a2c838f8492
2021-02-17 10:02:41 -08:00
Joe Onorato 7c01d47c9a Add a CSV parser to parse the output from kati.
(Yet another class that would be great for android to have in a host
tools library)

Test: m product-config-test && java -jar out/host/linux-x86/testcases/product-config-test/product-config-test.jar
Change-Id: I7d74b2265393e4f340729ca5ba82d1ec92a20f85
2021-02-17 10:02:41 -08:00
Bob Badour 0390580262 [LSC] Add LOCAL_LICENSE_KINDS to build/make
Added SPDX-license-identifier-Apache-2.0 to:
  target/product/sysconfig/Android.bp
  tools/apicheck/Android.bp
  tools/product_config/Android.bp
  tools/releasetools/Android.bp
  tools/signapk/Android.bp
  tools/signtos/Android.bp
  tools/zipalign/Android.bp
  tools/ziptime/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-CC-BY SPDX-license-identifier-GPL
    SPDX-license-identifier-GPL-2.0 SPDX-license-identifier-LGPL
    SPDX-license-identifier-MIT legacy_not_a_contribution
    legacy_restricted
to:
  Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-CC-BY SPDX-license-identifier-GPL
    SPDX-license-identifier-MIT
to:
  tools/Android.bp
  tools/droiddoc/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0
    SPDX-license-identifier-LGPL SPDX-license-identifier-MIT
to:
  core/base_rules.mk
  core/dex_preopt_libart.mk
  core/package_internal.mk

Added SPDX-license-identifier-Apache-2.0 legacy_not_a_contribution
to:
  target/board/Android.mk

Added legacy_restricted
to:
  core/tasks/tools/package-modules.mk
  target/product/gsi/Android.bp
  target/product/gsi/Android.mk
  target/product/security/Android.bp
  target/product/security/Android.mk
  tools/acp/Android.bp
  tools/atree/Android.bp
  tools/fs_config/Android.bp
  tools/fs_config/Android.mk
  tools/fs_get_stats/Android.bp
  tools/libhost/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Id67a4eb1312940f999643b2ae57f45f34f120724
2021-02-14 10:37:20 -08:00
Treehugger Robot 3c1a6ee5ad Merge "Fix error where otacerts in VENDOR_BOOT isn't replaced" 2021-02-12 06:06:11 +00:00
Treehugger Robot ba106847ff Merge "Fix signing errors where some partitions aren't properly signed" 2021-02-12 04:29:44 +00:00
Treehugger Robot d3f5268dfb Merge changes Icd25d2d0,I39ef10b0,I06bb80fe
* changes:
  Rearrange the methods on ErrorReporter to be more convenient.
  Add glue to run product-config-test as a standalone commandline executable.
  CommandException to cleanly exit product-config on error.
2021-02-12 04:03:44 +00:00
Kelvin Zhang 9f781ff907 Fix error where otacerts in VENDOR_BOOT isn't replaced
Test: sign a target_file, check otacerts.zip
Bug: 180025432

Change-Id: I918c3772a6de83314d76884dff3b26a85ed66eb2
2021-02-11 20:14:24 -05:00
Kelvin Zhang 119f279455 Fix signing errors where some partitions aren't properly signed
Rewrite build.prop of all partitions

Test: sign an target_file, check build prop of partitions

Bug: 179186447
Bug: 180025432

Change-Id: I01249532dc2df1b6d9ec8d0be58424a76814b53e
2021-02-11 19:51:05 -05:00
Kelvin Zhang eb586efe6f Check for existence of private key before generating OTA
At the end of OTA generation, we will use some private key to sign the
OTA payload. Since signing happens after the payload is being generated,
if caller passes an incorrect key path, caller won't notice it until 1
hour later when delta_generator finishes. At which point caller has to
staart from scratch, pass in another key path, and wait for an hour.
Let's detect incorrect key path before calling delta_generator, so
caller will get an error message right at beginning.

Test: th
Change-Id: Iefb1e0a9ed86f82664be1675afb84c020ec28fe7
2021-02-11 19:06:09 -05:00
Kelvin Zhang 80ff466780 Prevent SPL downgrade OTAs from generating
Previously we allow all spl downgrade OTA to generate. But applying such
OTA often causes device to hang and rollback, because keymaster refuses
to attach if it detects spl downgrade. When such error happens, it's
really hard to debug. So instead of debugging a mysterious boot failure,
let''s prevent such OTA from generating in the first place.

Test: th
Bug: 178584781

Change-Id: I8e271862d804e86b16aea70424b4d3e289d43cc9
2021-02-11 19:06:08 -05:00
Joe Onorato dc5ee8ff02 Add tool to find problems with build repeatability.
Bug: 169701728
Test: build/make/tools/exercise_compare_builds
Change-Id: I6905f04e8b14f572a3b7f76e8f5fb7829c478f05
2021-02-11 08:52:44 +00:00
Treehugger Robot 7b6988c026 Merge "Make common.py python3 compatible" 2021-02-10 18:29:43 +00:00
Treehugger Robot e51dcceae1 Merge "Updates merge_target_files soong_zip to use -r instead of -l." 2021-02-09 23:11:09 +00:00
Kelvin Zhang 645dcb8264 Make common.py python3 compatible
Test: th
Change-Id: Ibe4db0a367b7b8df5eeb7f2a6d0816e8e18bf342
2021-02-09 17:53:09 -05:00
Daniel Norman eaf5c1dca2 Updates merge_target_files soong_zip to use -r instead of -l.
This is needed due to output artifacts in the zip that confuse globbing,
such as [.

(Also changes this call to RunAndCheckOutput, which prints the stderror
by default instead of RunAndWait which does not. Removes RunAndWait
which is now unused)

Bug: 179799226
Test: Run merge_target_files to merge two partial builds
Change-Id: Ibf8a5b0c013c9cd8b1e61195d97583f247d97c6f
2021-02-09 11:01:42 -08:00
Treehugger Robot 41f416d326 Merge "Add flag to manually disable vabc" 2021-02-09 01:14:50 +00:00
Treehugger Robot 6c9e319da7 Merge "extract_kernel: make it py2/py3 compatible" 2021-02-08 23:49:15 +00:00
Kelvin Zhang bbfa182995 Add flag to manually disable vabc
Test: ota_from_target_files --disable_vabc
Change-Id: I9ae9ce2c3173909c335708329e787ae45dc5da6b
2021-02-07 10:43:15 -05:00
cfig 791378cda1
extract_kernel: make it py2/py3 compatible
use py3 for AOSP build, while the script itself can be
executed under py2/py3 environment directly.

TEST: extract info from Pixel 4 kernel

Change-Id: I00db6dabb1ff93f0758017a666c476816caefae7
2021-02-07 17:05:53 +08:00
Julien Desprez 0c09471cc3 Clean TEST_MAPPING config based on go/a-unit-tests
unit_tests:true do not need TEST_MAPPING files

Test: presubmit
Bug: 178646865
Change-Id: Id36e98ce661dc2052e333b2644202361127939a5
2021-02-04 09:12:05 -08:00
Kelvin Zhang 00db3859e7 Merge "Fix test failures due to binaries not found in PATH" 2021-02-02 22:21:15 +00:00
Kelvin Zhang e9d4ddb1e0 Merge "Add releasetools_test to TEST_MAPPING" 2021-02-02 19:25:21 +00:00
Kelvin Zhang 05a3f680f7 Fix test failures due to binaries not found in PATH
Test: rm `where deapexer` && mm otapackage

Change-Id: I0b742f26ae984729b97bf796aa3ed9335b316369
2021-02-02 14:24:54 -05:00
Kelvin Zhang 553efcaae2 Add releasetools_test to TEST_MAPPING
Test: treehugger
Change-Id: I3a0f9e9e5dd8d49c22f466aa0605768fee3f4821
2021-02-02 14:24:54 -05:00
Mohammad Samiul Islam f4909b4d71 Add deapexer to releasetools_common
Bug: 178726093
Test: m updatepackage
Change-Id: I74650f339ab5399c2474d7cde1d290b55dab721c
2021-02-01 21:03:58 +00:00
Treehugger Robot 472a860bee Merge "Only add apex_info for compressed apexes" 2021-01-29 10:34:21 +00:00
Nikita Ioffe 8e0c592f89 Merge "Add support for signing a compressed apex" 2021-01-27 19:45:33 +00:00
Kelvin Zhang c72718c7c5 Only add apex_info for compressed apexes
Test: mm -j dist, then make sure apex_info.pb doesn't contain
non-compressed apex

Change-Id: I6262eb97ec53de28953257d8b3b77e32ac0259be
2021-01-27 14:17:14 -05:00
Nikita Ioffe 3608148612 Add support for signing a compressed apex
Test: atest releasetools_test
Bug: 172912232
Change-Id: I4630578694afbab675db770b46898cc32f1861f3
2021-01-27 01:27:11 +00:00
Kelvin Zhang 7bd09911a2 Add apex_info.pb to generated OTA
Test: generate an OTA, make sure apex_info.pb is in

Bug: 172911822

Change-Id: I13a6ef4bc1f6ed2d146922f3031ea24700ba06f4
2021-01-26 12:42:52 -05:00
Kelvin Zhang 22c687c5c3 Fix pylint warnings on ota_from_target_files.py
Test: treehugger
Change-Id: I0a2b9ebe001152f5de7dce6198139719322fd241
2021-01-26 12:42:52 -05:00
Kelvin Zhang 1cd839623e Merge "Emit apex_info to target_files META/apex_info.pb" 2021-01-26 17:38:07 +00:00
Kelvin Zhang 62eea43d9b Merge "Create a function that can generate ApexInfo using target-files" 2021-01-25 17:55:53 +00:00
Kelvin Zhang 5f0fcee4dd Emit apex_info to target_files META/apex_info.pb
Test: mm -j
Bug: 172911822

Change-Id: I5a70b75dbe1cd546c66beaa8e4e3a63c3987461e
2021-01-25 09:15:30 -05:00
Mohammad Samiul Islam 9fd5886e23 Create a function that can generate ApexInfo using target-files
If an OTA contains compressed APEX inside it, then the device will need
to allocate space on /data partition for their decompression. In order
to calculate how much space the OTA process needs to allocate, the
process needs more information about the APEX contained inside the OTA.

In this CL, we are adding functionality to the OTA generation script
that allows us to gather information about the APEX stored inside the
target-file zip. However, we did not integrate the new functionality
with the ota_from_target_files.py scrip yet. That will be done on follow
up CL.

Bug: 172911822
Test: atest releasetools_py3_test
Change-Id: I2ac42018f628c2c21527b3e086be1f4e7e7247ad
2021-01-22 20:13:32 -05:00
Joe Onorato 0c7e0c0e3c Rearrange the methods on ErrorReporter to be more convenient.
Test: m product-config-test && java -jar out/host/linux-x86/testcases/product-config-test/product-config-test.jar
Change-Id: Icd25d2d0897df99ba29de52cd08a42cd9e4b9514
2021-01-22 10:37:44 -08:00
Joe Onorato 6edf0ec2ed Add glue to run product-config-test as a standalone commandline executable.
Test: m product-config-test && java -jar out/host/linux-x86/testcases/product-config-test/product-config-test.jar
Change-Id: I39ef10b076eec3a313de23cab0202349b1bce799
2021-01-22 10:35:36 -08:00
Joe Onorato a5dbb0a8f6 CommandException to cleanly exit product-config on error.
Test: none
Change-Id: I06bb80fe1cc21d77ca3e32ac3110a08fc8b5af54
2021-01-22 10:35:36 -08:00
Joe Onorato 841c3e3ea6 Add skeleton for product-config tool.
There's also a bunch of boilerplate error handling and option parsing
stuff that I wish someone would put into a library that's available to
the android tree.

Test: atest product-config-test
Change-Id: Ieebcc7bd47a8644d1374fb02c146e9038859f4a2
2021-01-21 12:38:04 -08:00
Treehugger Robot d041e4babf Merge "Make ro.product.cpu.abilist.* to be fetched dynamically" 2021-01-14 18:34:22 +00:00
Yifan Hong 7a27574e5f Merge "GetBootImageBuildProp returns None if file does not exist" 2021-01-13 19:40:13 +00:00
Nikita Ioffe 015b689271 Merge "Refactor apex signing logic in preparation for compressed apexes" 2021-01-13 14:54:49 +00:00