Commit graph

41192 commits

Author SHA1 Message Date
Stephen Hines
f733f896d3 Merge "Switch to clang-4579689." 2018-02-06 18:35:41 +00:00
Tao Bao
26fc64da06 Merge "releasetools: Capture stderr output when calling delta_generator." 2018-02-06 17:20:53 +00:00
Treehugger Robot
08ba09ed7f Merge "Clear local robolectric testing variables" 2018-02-06 16:55:09 +00:00
hansson
ee00360292 Merge "Add a base makefile for 64 bit only builds." 2018-02-06 10:08:48 +00:00
Tao Bao
3f15ada51b releasetools: Capture stderr output when calling delta_generator.
Prior to this CL, the call to delta_generator in
check_ota_package_signature.VerifyAbOtaPayload() didn't redirect stderr.
The logs (mostly INFO) on successful verification added noise to the
normal output, which also upset the unittest result parser.

This CL captures stderr outputs from delta_generator, and will only dump
them on error.

Bug: 72884343
Test: `python -m unittest -v test_ota_from_target_files > /dev/null`
      gives clean output.
Test: Inject error into delta_generator. The call to
      check_ota_package_signature correctly dumps both of stdout and
      stderr outputs.
Change-Id: I014a4b21bf758dcf0a4b9963259d6019851935ee
2018-02-05 23:39:23 -08:00
James Lemieux
bb426739ce Clear local robolectric testing variables
This prevents them from mistakenly bleeding between test targets.

Bug: 72384841
Test: make Run_TeleService_robotests
Change-Id: Ie2c047be1450420f8e27b8b45e9416e96b477b45
2018-02-05 15:39:18 -08:00
Treehugger Robot
fe34c5b52c Merge "Move system manifest / device matrix build rules" 2018-02-05 22:27:18 +00:00
Treehugger Robot
ca2ffed06c Merge "releasetools: Fix an issue with pubkey extraction." 2018-02-05 21:25:47 +00:00
Treehugger Robot
a3a211dafe Merge "Add Traceur to user builds." 2018-02-05 20:31:23 +00:00
Anton Hansson
1ac8a6df9a Add a base makefile for 64 bit only builds.
This makefile specifies a configuration that only starts a 64 bit
zygote (as opposed to both 64/32, as standard 64 bit builds do).
It should be inherited by products that only supports 64 bit apps.

Bug: 72810053
Test: Manual, using product in https://android-review.googlesource.com/608276
Change-Id: Ib88eccf8d4c575bfd93d6edb130348aeca4ae3f8
2018-02-05 18:24:16 +00:00
Treehugger Robot
8b35ac67b2 Merge "Renames sepolicy files from nonplat_* to vendor_*" 2018-02-05 17:31:45 +00:00
Treehugger Robot
993e1d2634 Merge "releasetools: Add sdk and security patch level info to metadata." 2018-02-05 17:25:16 +00:00
Bowgo Tsai
09f88a6b88 Renames sepolicy files from nonplat_* to vendor_*
Bug: 64240127
Test: boot bullhead/taimen
2018-02-05 18:22:45 +08:00
Tao Bao
04e1f012dd releasetools: Fix an issue with pubkey extraction.
When calling 'openssl x509 -pubkey' to extract the public key from a
certificate, openssl 1.0 and 1.1 handle the '-out' parameter
differently. openssl 1.0 doesn't write the output into the specified
filename, which leads to the payload verification failure in
check_ota_package_signature.VerifyAbOtaPayload(). This CL addresses
the issue by always collecting the output from stdout instead.

It also refactors the two copies into common.ExtractPublicKey(), and
adds unittest. get_testdata_dir() is moved into test_utils.py that holds
common utils for running the unittests.

Bug: 72884343
Test: python -m unittest test_common
Test: python -m unittest test_ota_from_target_files
Test: Run sign_target_files_apks with '--replace_ota_keys' on marlin
      target_files zip. Check the payload pubkey replacement.
Test: Trigger the tests with forrest, and tests no longer fail on
      machines with openssl 1.0.1.
Change-Id: Ib0389b360f064053e9aa7cc0546d718e7b23003b
2018-02-04 13:59:52 -08:00
Treehugger Robot
8a6ab0f240 Merge "Revert "Renames sepolicy files from nonplat_* to vendor_*"" 2018-02-03 10:00:53 +00:00
Tao Bao
93db955964 Merge "releasetools: Detect incomplete block ranges." 2018-02-03 04:32:13 +00:00
Treehugger Robot
80ac71bada Merge "releasetools: Add Payload class." 2018-02-03 02:36:56 +00:00
Tao Bao
c7b403a2e8 releasetools: Add Payload class.
This breaks down the current WriteABOTAPackageWithBrilloScript() into
smaller and testable units, which also prepares for the work in
b/35724498.

Bug: 35724498
Test: python -m unittest test_ota_from_target_files
Test: Get identical A/B OTA packages w/ and w/o the CL.
Change-Id: I2ea45ce98e2d2baa58e94fb829b7242f6fe685a7
Merged-In: I2ea45ce98e2d2baa58e94fb829b7242f6fe685a7
(cherry picked from commit 036d721812)
2018-02-02 16:18:07 -08:00
Carmen Jackson
343428120a Add Traceur to user builds.
This adds the Traceur app to all builds on phones and tablets.
Previously, it was included on userdebug builds on specific devices only.

Bug: 64762598
Test: Flashed a user build and a userdebug build and saw Traceur on both
builds.

Change-Id: I9bf7d68c737845a519f57f8f60ee9064bf33a2f5
2018-02-02 11:19:49 -08:00
Treehugger Robot
76c6906bf2 Merge "releasetools: Clean up two no-op lines that set 'ota-wipe'." 2018-02-02 17:28:35 +00:00
Tao Bao
24604cc5b9 releasetools: Clean up two no-op lines that set 'ota-wipe'.
The same thing has been set in GetPackageMetadata(), so they are no-op.

Also replace an occurrence of 'OPTIONS.source_info_dict' with
source_info, which has been missed from previous clean-up CLs.

Test: Generate an A/B OTA package, and an incremental BBOTA with
      --wipe_user_data. Check the metadata.
Test: Generate a two-step incremental BBOTA successfully.
Change-Id: I4bb491cac9064d93fb86d12e617c8f38f040e01e
2018-02-01 16:30:42 -08:00
Bowgo Tsai
ec7dbbb537 Revert "Renames sepolicy files from nonplat_* to vendor_*"
This reverts commit 8b5f514038.
Fix angler/bullhead boot failure.

Bug: 72787689
Test: build
2018-02-02 07:58:45 +08:00
Tao Bao
35dc255180 releasetools: Add sdk and security patch level info to metadata.
The info comes from the build.prop file of the target build (thus no
backward compatibility concerns). OTA server and client can optionally
use these info to understand the expected behavior of an OTA package.

Bug: 72751683
Test: python -m unittest test_ota_from_target_files
Test: `m dist`, then check the metadata in the generated OTA package.
Change-Id: I5935f67684d2486bb5f00d67ce4bc756589a56ed
2018-02-01 15:58:20 -08:00
Yifan Hong
87328762e4 Move system manifest / device matrix build rules
Test: build these files
Change-Id: I6467f4b7ce421358c30ad7a4c72a77dcc2ed3f88
2018-02-01 15:36:40 -08:00
Treehugger Robot
a4c7d59afc Merge "releasetools: Make validate_target_files.py pylint clean." 2018-02-01 23:23:46 +00:00
Tao Bao
c765cca38b releasetools: Detect incomplete block ranges.
This CL detects incomplete block ranges (e.g. due to the holes in
mke2fs created images). Such block ranges will be tagged, so we won't
attempt to imgdiff those files. Note that the change to blockimgdiff.py,
which uses the tag info, will come in a separate CL.

An 'extra' attribute is added to RangeSet class, which defaults to an
empty dict. An 'incomplete' tag will be added into the dict by the
caller of the class. Not adding this tag as an immediate attribute,
because it is not a property regarding the ranges being represented, but
rather some storage space for the caller.

This CL also refactors GetSparseImage and RoundUpTo4K into common.py, so
the same code can be called from both of ota_from_target_files.py and
validate_target_files.py. Not able to add unittests for
GetSparseImage(), as SparseImage requires data in specific format.

Bug: 68016761
Test: Run validate_target_files.py on target-files.zip. It skips
      validating files with missing holes as before.
Test: Run ota_from_target_files.py on angler target-files.zip. It gives
      identical packages w/ and w/o the CL.
Test: pylint on changed files. There're warnings with common.py, but
      unrelated to this change.
Change-Id: I126ccfea13c0d5ebcc8c1b4ff1a4f9200e97423a
2018-02-01 12:35:48 -08:00
Tao Bao
bb20e8c5f2 releasetools: Make validate_target_files.py pylint clean.
C: 73, 0: Wrong hanging indentation (add 4 spaces).
      file_name, actual_sha1, expected_sha1)
      ^   | (bad-continuation)
C:171, 0: Wrong continued indentation (add 20 spaces).
        'SYSTEM/etc/recovery.img', expected_recovery_sha1)
        ^                   | (bad-continuation)
C:185, 0: Wrong continued indentation (add 20 spaces).
        file_path='IMAGES/boot.img', expected_sha1=boot_info[3])
        ^                   | (bad-continuation)
C:191, 0: Wrong continued indentation (add 20 spaces).
        file_path='IMAGES/recovery.img',
        ^                   | (bad-continuation)
C:192, 0: Wrong continued indentation (add 20 spaces).
        expected_sha1=expected_recovery_sha1)
        ^                   | (bad-continuation)
W: 67,15: Use % formatting in logging functions and pass the % parameters as arguments (logging-format-interpolation)
W:150,17: Use % formatting in logging functions and pass the % parameters as arguments (logging-format-interpolation)
W:153,15: Use % formatting in logging functions and pass the % parameters as arguments (logging-format-interpolation)
W:194,15: Use % formatting in logging functions and pass the % parameters as arguments (logging-format-interpolation)
C: 27, 0: standard import "import logging" comes before "import common" (wrong-import-order)
C: 28, 0: standard import "import os.path" comes before "import common" (wrong-import-order)
C: 29, 0: standard import "import re" comes before "import common" (wrong-import-order)
C: 31, 0: standard import "import sys" comes before "import common" (wrong-import-order)

Test: pylint --rcfile=pylintrc validate_target_files.py
Test: Run validate_target_files.py with a target-files.zip.
Change-Id: Ie64acdb4cee4326938c4ad5a34b575d7b82478c0
2018-02-01 12:03:17 -08:00
Yi Kong
421733f693 Switch to clang-4579689.
Bug: 68397894
Test: http://go/clang-4523590-testing
Change-Id: Id3fbac182869e92ab9b7d27d63d9f28c565c7b08
2018-02-01 10:24:04 -08:00
David Brazdil
edd4716ff9 Merge "Revert "Revert "Apply hiddenapi build tool on boot jars""" 2018-02-01 09:25:51 +00:00
Treehugger Robot
4b4c3d91b0 Merge "releasetools: Move the AVB salt setup into common.LoadInfoDict()." 2018-02-01 00:06:46 +00:00
Tao Bao
12d87fc174 releasetools: Move the AVB salt setup into common.LoadInfoDict().
We used to do this in add_img_to_target_files.AddImagesToTargetFiles(),
which didn't cover the path when calling from make_recovery_patch. As a
result, /system/bin/install-recovery.sh contains different SHA values
from the actual images.

Test: Set up aosp_bullhead to use AVB. `m dist`, then run the following
      command to verify the generated install-recovery.sh.

  $ ./build/make/tools/releasetools/validate_target_files.py \
      out/dist/aosp_bullhead-target_files-eng.zip

Change-Id: Id7be8fb17072252fcd4d08db2057b8c4af053376
2018-01-31 12:25:10 -08:00
Treehugger Robot
5e7d417271 Merge "Renames sepolicy files from nonplat_* to vendor_*" 2018-01-31 14:37:44 +00:00
Tianjie Xu
5edd2821de Merge "Protect SparseImage._GetRangeData() with lock" 2018-01-30 23:34:50 +00:00
David Brazdil
b8fa6dd104 Revert "Revert "Apply hiddenapi build tool on boot jars""
This reverts commit 4a2926a44e.

Reason for revert: The original CL caused two issues:
1) Increased app startup because `profman` failed to verify boot
jars and created an empty profile for the boot image. All methods
in the framework therefore ran interpreted/JITed. New flag
"--skip-apk-verification" has been added to `profman` to fix
the issue in CL Iad614e47feada293218c11cff985a8012ca49a0f.
2) Caused a crash in Mockito CTS tests because jvmti did not
remove hiddenapi access flags from boot jars before using them.
This has been fixed with CL Ibc9a96a6b541c06844f276db009ac29514f7a3bb.

Bug: 64382372
Bug: 72550707
Test: make test-art-host
Change-Id: Ie8c58714455662f042f56b2977b01b75c5ec7d2f
2018-01-30 18:25:46 +00:00
Bowgo Tsai
8b5f514038 Renames sepolicy files from nonplat_* to vendor_*
Bug: 64240127
Test: boot an existing device
Change-Id: I6d6ac7d9dee450b2a20649e5f4dbb8976f48061e
2018-01-30 16:15:12 +08:00
Dan Willemsen
157fbf771b Merge "Clean up some kati warnings" 2018-01-30 07:43:27 +00:00
Treehugger Robot
d33cac8af1 Merge "Write SOONG_MODULES_MISSING_PGO_PROFILE_FILE to $DIST_DIR" 2018-01-30 06:34:15 +00:00
Treehugger Robot
709ee786cd Merge "Warn.py: Update errorprone categories" 2018-01-30 02:05:19 +00:00
Dan Willemsen
893bebc44b Clean up some kati warnings
Kati has a `--warn` option that adds some extra Kati-specific warnings
-- like using undefined make functions, undefined user functions, likely
bad variable lookups, etc. Some of these are bugs, others are fine doing
nothing. This fixes up all of them in the core build system.

It also complains about $(eval) usage in a recipe not being recommended.
Those aren't handled as part of this change.

Bug: 72661763
Test: build-aosp_arm.ninja is identical before and after
Change-Id: I8e00af142a7745236d3ad4efc9e91ec3ce71a511
2018-01-29 16:23:37 -08:00
Pirama Arumuga Nainar
ae9595674b Write SOONG_MODULES_MISSING_PGO_PROFILE_FILE to $DIST_DIR
Bug: http://b/72642679

Store missing profile files and the modules that refer to them, passed
via SOONG_MODULES_MISSING_PGO_PROFILE_FILE variable, to
$DIST_DIR/pgo_profile_file_missing.txt as part of the 'dist' target.

Test: 'm dist' and verify creation of pgo_profile_file_missing.txt.
Change-Id: I4ac0a1f413cbb99b33ad1903aeebd3ebcf3b9f59
2018-01-29 14:48:08 -08:00
Treehugger Robot
d8e3c4eb07 Merge "Fix /sys denials." 2018-01-29 22:04:32 +00:00
Tianjie Xu
df1166e92f Protect SparseImage._GetRangeData() with lock
The generator function is not thread safe and is prone to race
conditions. This CL uses a lock to protect this generator and loose the
locks elsewhere, e.g. 'WriteRangeDataToFd()'.

Bug: 71908713
Test: Generate an incremental package several times for angler 4208095 to 4442250.
Change-Id: I9e6f0a182a1ba7904a597f403f2b12fe05016513
2018-01-29 11:52:10 -08:00
Tianjie Xu
92d73d3ab9 Merge "Double check the sha1 for ranges during package generation" 2018-01-29 19:50:08 +00:00
Tobias Thierer
e1b94da7c8 Merge "javac 9 -target 1.9: Move bootclasspath jars onto classpath." 2018-01-29 10:51:24 +00:00
David Brazdil
4e6c5218db Merge "Add flag to control hidden API warning toasts" 2018-01-29 10:22:10 +00:00
Tianjie Xu
8a7ed9f771 Double check the sha1 for ranges during package generation
Check that the Sha1 for src&tgt ranges are correct before computing
patches. This adds ~6 seconds overhead for ~2400 commands.

Bug: 71908713
Test: Generate an incremental package from angler 4208095 to 4442250.
Change-Id: I8cf8ce132fb09a22f7d6689274ddb4a27770be76
2018-01-28 01:54:52 +00:00
Treehugger Robot
f9d8f6fa7d Merge "Fix multilib test data being installed twice to the same place" 2018-01-27 03:42:09 +00:00
Dan Willemsen
4133793ce3 Fix multilib test data being installed twice to the same place
Fixes lots of warnings of the form:

build/make/core/base_rules.mk:606: warning: overriding commands for target `out/target/product/generic_arm64/testcases/simpleperf_unit_test/testdata/perf.data'
build/make/core/base_rules.mk:606: warning: ignoring old commands for target `out/target/product/generic_arm64/testcases/simpleperf_unit_test/testdata/perf.data'

Test: lunch aosp_arm64-eng; m device-tests
Change-Id: I32575d25f3aef1d4000fcb63d6ffc025ad21f937
2018-01-26 16:57:57 -08:00
Alex Light
9f1e629503 Merge "Revert "Apply hiddenapi build tool on boot jars"" 2018-01-26 18:40:55 +00:00
Alex Light
4a2926a44e Revert "Apply hiddenapi build tool on boot jars"
This reverts commit b7f00ed2af.

Bug: 72550707
Bug: 64382372
Test: atest CtsInlineMockingTestCases

Reason for revert: Causing invalid dex files to be passed to jvmti
                   agents. This causes CtsInlineMockingTestCases and
                   other tests to fail.

Change-Id: I50129e94791b9e2bef919fe398b4250ae461195b
2018-01-26 18:16:52 +00:00