Commit Graph

41163 Commits

Author SHA1 Message Date
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
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
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
David Brazdil 661f97b62b Merge "Move locations of all hidden API lists into the build folder" 2018-01-26 16:03:25 +00:00
David Brazdil 41847e1917 Add flag to control hidden API warning toasts
Just like visual warnings about improper use of native libraries,
warnings about the usage of hidden APIs will be displayed in non-
final, non-user builds only.

Bug: 64382372
Test: make
Change-Id: Id0a4200f912ac3303026cb26b6d8974c47332828
2018-01-26 12:19:32 +00:00
David Brazdil 2e36f52738 Move locations of all hidden API lists into the build folder
ART buildbots are broken because they build against a pinned commit of
the framework and thus lack the build rules to generate hidden API lists
We aim to fix this by generating dummy API lists in the build folder.
This patch changes the location of the blacklist and dark greylist from
frameworks/base/config/ to ${TARGET_COMMON_OUT_INTERMEDIATES}/... . On
normal builds, the framework will copy its text files into the build
folder.

Test: make
Bug: 64382372
Change-Id: I9b55d2865599e367d9c4be4f834182f5c084c3bf
2018-01-26 11:35:36 +00:00
Tobias Thierer 0276db1ec7 javac 9 -target 1.9: Move bootclasspath jars onto classpath.
When building with OpenJDK 9's javac with -source 1.9 -target 1.9,
a runtime image (with system modules) is used via the --system
command line flag, instead of --bootclasspath.
The runtime image only contains the default libraries (libcore)
but is missing other libraries that might be on the bootclasspath
for a particular build target.

This CL fixes compilation for this case by adding the missing
jars onto the classpath instead.

This already used to work but was broken by CL [1]. I attempted
to conditionally revert some of that CL's changes to java_common.mk
for the case of language level 1.9, but couldn't get it to work.
Therefore this CL follows a different approach.

[1] http://r.android.com/519552

Bug: 38177569
Test: Treehugger
Test: Ran "EXPERIMENTAL_USE_OPENJDK9=true make checkbuild docs"
      and spot-checked some javac invocations to confirm that the
      system modules libs were not included in the bootclasspath,
      but other libs were.

Change-Id: I48fd11aac9b310bfa58dee0f9cfb3ef33f10bca8
2018-01-26 02:48:48 +00:00
Treehugger Robot 9f1b1f90a1 Merge "Fix comment indicator on endif" 2018-01-26 01:21:26 +00:00
Bryan Eyler 57b5232def Fix comment indicator on endif
It's referring to the wrong if start.

Change-Id: I6f78aee54fb89fb5f69a4e86102d5a8e2cc2bbd1
2018-01-25 14:55:31 -08:00
Treehugger Robot 98fce11494 Merge "Fix INSTALLED_ -> BUILT_ missing refactor piece." 2018-01-25 21:23:28 +00:00
Andreas Gampe cf528ca79d Warn.py: Update errorprone categories
From current tip-of-tree.

Bug: 72451126
Test: build/make/tools/warn.py errorprone.log
Change-Id: I1d632fb8801b74af695b4f7f464a99792e46637a
2018-01-25 12:25:20 -08:00
David Brazdil 221848b181 Merge "Apply hiddenapi build tool on boot jars" 2018-01-25 19:51:29 +00:00
Steven Moreland 915f35166f Fix INSTALLED_ -> BUILT_ missing refactor piece.
Some of the dependencies for target-files-package were
refactored but only partially. Since these are satisfied
by transitive dependencies, the problem wasn't noticed
earlier.

Bug: N/A
Test: target-files-package finds dependencies

Change-Id: Ibdd7587f87735148e55d3b9835478075b6547efc
2018-01-25 10:45:26 -08:00
Primiano Tucci 27be3bf0e2 Merge "Add perfetto daemons and cmdline client to core makefiles" 2018-01-25 18:38:09 +00:00
Primiano Tucci 90ebe5baf2 Add perfetto daemons and cmdline client to core makefiles
Perfetto is a tracing daemon that allows both to capture
traces from the kernel (via the traced_probes binary)
and allows data to be pushed from userspace (via the
traced binary). Tracing is never enabled by default
and can be kicked off either via statsd or by the shell.
The daemon executables are split only for the sake
of security and isolating SELinux domains. Under the
hoods they are just two shells that run code in the
same shared libarary.
See go/perfetto-sys-health-details for expected
binary / memory / overhead impact.

Bug: 72484603
Test: builds (see go/perfetto-test-spec for test plan)
Change-Id: Ib5fbd7cd2113010398802b622363b75f3eef738d
2018-01-25 15:32:11 +00:00
David Brazdil b7f00ed2af Apply hiddenapi build tool on boot jars
Restrictions on usage of private APIs require encoding new information
into the dex files of the boot class path. ART now contains a new build
tool called `hiddenapi` which takes three lists of class member
signatures (blacklist, light and dark greylist), finds the class members
in their respective dex files and modifies their access flags in place.

This patch invokes the `hiddenapi` tool on all JARs in
PRODUCT_BOOT_JARS. For Java libraries built with Makefiles the tool is
invoked after the dexer directly on DEX files. For Soong-built
libraries, the build system has to unzip the JAR produced by Soong,
apply `hiddenapi` and rezip again. This is due to the fact that the
PRODUCT_BOOT_JARS variable is not available to Soong.

Bug: 64382372
Test: m
Change-Id: I6ce897d204459c8b6f46ed49e0909ff76c08a9ed
2018-01-25 09:22:08 +00:00
Nicolas Geoffray f90b7e1948 Merge "For prebuilts, use the built_module for nostripping dexpreopt." 2018-01-25 08:58:48 +00:00
David Brazdil a5cc50ab4c Merge "Add hidden API list file variables" 2018-01-25 07:55:35 +00:00
Jaekyun Seok 8fe7f9bfa2 Merge "Support /product partition" 2018-01-25 03:53:37 +00:00
Alexey Polyudov 01b873b2de Merge "Fix syntax error in makefile soong namespaces handling" 2018-01-25 03:33:58 +00:00
Treehugger Robot 88114b0b0b Merge "healthd: fix /sys denials." 2018-01-25 02:01:58 +00:00
Alexey Polyudov ea55e8c86c Fix syntax error in makefile soong namespaces handling
Change-Id: I5254f7877422e23f3c3b69f37f1be849a12e296a
Signed-off-by: Alexey Polyudov <apolyudov@google.com>
2018-01-24 17:01:21 -08:00
Jaekyun Seok b7735d8105 Support /product partition
This CL adds the following build flags to support building product partition
from Android build system.
- BOARD_AVB_PRODUCT_ADD_HASHTREE_FOOTER_ARGS
- BOARD_AVB_PRODUCT_KEY_PATH
- BOARD_AVB_PRODUCT_ALGORITHM
- BOARD_AVB_PRODUCT_ROLLBACK_INDEX_LOCATION
- BOARD_PREBUILT_PRODUCTIMAGE
- BOARD_PRODUCTIMAGE_EXTFS_INODE_COUNT
- BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE
- BOARD_PRODUCTIMAGE_PARTITION_SIZE
- BOARD_PRODUCTIMAGE_SQUASHFS_BLOCK_SIZE
- BOARD_PRODUCTIMAGE_SQUASHFS_COMPRESSOR
- BOARD_PRODUCTIMAGE_SQUASHFS_COMPRESSOR_OPT
- BOARD_PRODUCTIMAGE_SQUASHFS_DISABLE_4K_ALIGN
- BOARD_USES_PRODUCTIMAGE
- LOCAL_PRODUCT_MODULE
- PRODUCT_FOOTER_ARGS
- PRODUCT_PRODUCT_BASE_FS_PATH
- PRODUCT_PRODUCT_VERITY_PARTITION
- TARGET_COPY_OUT_PRODUCT
- TARGET_OUT_PRODUCT*

And PRODUCT_PRODUCT_PROPERTIES is added to save product-specific
properties in /product/build.prop.

Bug: 64195575
Test: succeeded building product.img with BOARD_PRODUCTIMAGE_PARTITION_SIZE,
BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE and PRODUCT_PRODUCT_VERITY_PARTITION.

Change-Id: I774e6a38003734421591e51bed103802ff84f432
2018-01-25 09:33:58 +09:00
Treehugger Robot 11e95dedd2 Merge "Add Nan to OWNERS" 2018-01-25 00:31:49 +00:00
David Brazdil ae6915ead0 Add hidden API list file variables
Add variables for the hidden API blacklist and dark and light greylist
files. These are text files with signatures of boot class path class
member with restricted access for non-platform code.

Bug: 64382372
Test: m
Change-Id: I5639c5269872ac626efc69bd3a374a7a7125d502
2018-01-24 20:48:54 +00:00
Tri Vo 82ca9a743a Fix /sys denials.
Labeled files linked from /sys/class/{rtc, net}.
Fixes these denials:
avc: denied { read } for pid=6413 comm="system_server" name="hctosys"
dev="sysfs" ino=10068 scontext=u:r:system_server:s0
tcontext=u:object_r:sysfs:s0 tclass=file permissive=0

avc: denied { write } for pid=4785 comm="Binder:4785_2" name="mtu"
dev="sysfs" ino=9213 scontext=u:r:netd:s0 tcontext=u:object_r:sysfs:s0
tclass=file permissive=0

Test: files labeled as expected; emulator boots without above denials.
Change-Id: I8fd8cc993ede0ddfd4404c0647a60da4867ef128
2018-01-24 12:39:47 -08:00
Tri Vo 30a532a1bf healthd: fix /sys denials.
Label /sys/class/power_supply/* appropriately and give healthd read
permissions to that directory.

Fixes this denial:
avc: denied { read } for pid=1386 comm="healthd" name="power_supply"
dev="sysfs" ino=2562 scontext=u:r:healthd:s0
tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0

Bug: 72437093
Test: emulator boots with no denials from healthd
Change-Id: Ie3853cb5e9167fcd70f393ff589971ad6212c580
2018-01-24 11:13:22 -08:00
Nicolas Geoffray e3e19f0dfa For prebuilts, use the built_module for nostripping dexpreopt.
Earlier, we would use the prebuilt directly, which doesn't go through
build optimizations like uncompressing the dex files.

bug: 63920015
Test: m -j32 && verify priv-apps prebuilt's vdex don't contain
      the dex code.

Change-Id: I1a69d3b6832e3a940616f71a95c13091a4220b4b
2018-01-24 15:20:33 +00:00
Treehugger Robot 082837365d Merge "Add BOARD_EXT4_SHARE_DUP_BLOCKS to share duplicated blocks on ext4" 2018-01-24 04:10:42 +00:00
Treehugger Robot 3fcaecec8a Merge "Don't use old VNDK and SystemSDK versions for new devices" 2018-01-24 02:25:38 +00:00
Jiyong Park 95f9313445 Don't use old VNDK and SystemSDK versions for new devices
We need to prevent vendors from using old VNDK and SystemSDK versions
for newly launched device. Otherwise, deprecating old versions of the
APIs would be really difficult.

Specifically, it is enforced that

PRODUCT_SHIPPING_API_LEVEL <= BOARD_VNDK_VERSION

PRODUCT_SHIPPING_API_LEVEL <= min(BOARD_SYSTEMSDK_VERSIONS)

Bug: 72126206
Test: manually setting BOARD_VNDK_VERSION to 24 in
device/google/wahoo/BoardConfig.mk and choosecom to walleye
Test: m -j shows an error on BOARD_VNDK_VERSION
Test: BOARD_SYSTEMSDK_VERSION="25 26" m -j shows an error on
BOARD_SYSTEMSDK_VERSION

Change-Id: I17646487a9c77a6a5110749e22ba47f0f75920cf
2018-01-24 09:59:09 +09:00
Treehugger Robot 37cc632f81 Merge "Install ld.config.noenforce.txt instead of copying it" 2018-01-23 22:50:09 +00:00