Commit Graph

34545 Commits

Author SHA1 Message Date
Bowgo Tsai 7cd30041e9 Align size of vbmeta image to 4k boundary
Adding option "--padding_size 4096" when making vbmeta.img.

Bug: 38454093
Test: build vbmeta.img and check it's being padded.
Change-Id: Id3ba6bf9998755bae75ec8b272ceccf59f4b8666
2017-06-13 11:31:06 +08:00
Dan Willemsen 6402873d49 Apply ALLOW_MISSING_DEPENDENCIES to droiddoc template dir
Some of our minimal branches don't have the necessary droiddoc
templates, so don't cause a FindEmulator warning when the template dir
is missing and ALLOW_MISSING_DEPENDENCIES is set. The warnings will soon
be errors.

When the template directory is missing, ensure that the command doesn't
succeed by adding the directory into the dependency list. Passing a
missing directory doesn't cause an error otherwise, it just wouldn't use
the template.

Test: build-aosp_arm64.ninja is identical before and after this change
Test: Move away build/tools/droiddoc/templates-sdk; m -j libcore-docs
Change-Id: I122f3916b6ab348a5a98dcf2520992eda3655e26
2017-06-12 19:31:50 -07:00
Paul Duffin c45b7e3d98 Added android.test.mock to PRODUCT_PACKAGES
Adds android.test.mock.jar to the /system/framework
directory. That will allow it to be dynamically included
with a uses-library manifest entry.

Bug: 30188076
Test: flash and check contents of /system/framework
Change-Id: I3ea0e558276176edd21e24c8337980c5c02a652e
2017-06-09 13:34:13 +01:00
Treehugger Robot d6e8002734 Merge "Delay the write-back of misc_info in sign_target_files_apks.py." 2017-06-08 22:24:53 +00:00
Dan Willemsen 25a4c9481b Merge "Add mising AAPT2 dependency" 2017-06-08 16:10:05 +00:00
Dan Willemsen c401a62d81 Add mising AAPT2 dependency
Bug: 33381544
Test: m clean; mma -j with a prebuilt aar using aapt2
Change-Id: Ie41def84aa35f3774abd6d713fb4a75d63a88876
2017-06-08 00:14:32 -07:00
Treehugger Robot 61ddffc6af Merge "Find target keywords in the first 100 lines." 2017-06-08 01:40:59 +00:00
Chih-Hung Hsieh 655c542dc8 Find target keywords in the first 100 lines.
Bug: 62416199
Test: warn.py build.log
Change-Id: I8c5ef310758fdd44519aeb1efe2f0bd92fe1ac87
2017-06-07 23:17:13 +00:00
Treehugger Robot 288a675fd9 Merge changes Ifbeed546,Ia283252d,I28c85736
* changes:
  More aapt2 aar prebuilt fixes
  Use framework resources for prebuilt aars with aapt2
  Don't attempt to write to / for aar prebuilts
2017-06-07 23:00:24 +00:00
Tao Bao 46a5999a02 Delay the write-back of misc_info in sign_target_files_apks.py.
Currently we're writing META/misc_info.txt to the new TF.zip during
ReplaceVerityPrivateKey(). We should delay that until we have replaced
everything in need. Otherwise we won't be able to replace/overwrite
that zip entry (unless `zip -d` first).

This CL also cleans up the return value of ReplaceVerityPublicKey() and
ReplaceVerityKeyId(), since the caller no longer needs the values.

Test: sign_target_files_apks.py and check the generated signed TF.zip.
Change-Id: I9fbd7182247728281519e5e3971557f6b018ad65
2017-06-07 15:13:50 -07:00
Treehugger Robot 8340ae35a7 Merge "Fix ALLOW_MISSING_DEPENDENCIES in PDK builds" 2017-06-07 01:34:02 +00:00
Yi Kong 1923ed7f41 Merge "Switch to clang-4053586" 2017-06-06 21:09:43 +00:00
Treehugger Robot 9718140570 Merge "Fix the broken script in AssertFingerprintOrThumbprint." 2017-06-05 22:33:05 +00:00
Treehugger Robot 401b1d2509 Merge "Remove three board_avb_* args from META/misc_info.txt." 2017-06-05 20:01:05 +00:00
Tao Bao d2d01e519e Fix the broken script in AssertFingerprintOrThumbprint.
Bug: 62252466
Test: Re-generate an incremental OTA that goes from the fingerprint to
      thumbprint, and check the updater-script.
Change-Id: I6e2cbf68cbd22fbcf0d200fc3fdc8a33da510a53
2017-06-05 12:27:52 -07:00
Tao Bao 3ebfddeabe Remove three board_avb_* args from META/misc_info.txt.
board_avb_algorithm and board_avb_key_path are overlapping with
avb_signing_args. In core/Makefile, only avb_signing_args (i.e.
INTERNAL_AVB_SIGNING_ARGS) will be used in the AVB-signing command. It
covers the contents in board_avb_{algorithm,key_path}. We should do the
same thing in tools/releasetools to avoid potential inconsistency.

This CL cleans up the logic in tools/releasetools, by always using
avb_signing_args. This also allows easier signing key replacement (so we
can replace the key/algorithm/signer in 'avb_signing_args').

board_avb_system_add_hashtree_footer_args is unused in releasetools
script, and the same information has been covered by
system_avb_add_hashtree_footer_args. This CL removes this arg as well.

Test: `m dist`. Then a) check the removed three args no longer exist in
      META/misc_info.txt; b) check that rebuilding images with
      add_img_to_target_files.py uses the same parameters.
Change-Id: I7db890b5c942de5b6868d8d1ebf937586d4729c0
2017-06-05 10:33:52 -07:00
Yi Kong dd65f96c3d Switch to clang-4053586
Bug: 37423073
Test: Build on multiple devices
Change-Id: Ic1a5f515db66275ee96fb6a614ffbb719bb91859
2017-06-02 22:13:01 -07:00
Dan Willemsen ccc48163ea Fix ALLOW_MISSING_DEPENDENCIES in PDK builds
ALLOW_MISSING_DEPENDENCIES was being set up before TARGET_BUILD_PDK, so
PDK builds were not triggering ALLOW_MISSING_DEPENDENCIES.

Bug: 62086238
Test: m -j nothing (check out/soong/soong.variables for AllowMissingDependencies)
Test: PDK_FUSION_PLATFORM_ZIP=test.zip m -j nothing (check AllowMissingDependencies)
Change-Id: I70919fbc7e397e55356cb467c6218cf6e7279c6c
2017-06-02 15:25:20 -07:00
Tao Bao 4536e45f66 Merge "Support re-generating DTBO image from add_img_to_target_files.py." 2017-06-02 22:13:36 +00:00
Tianjie Xu 65b98cd3b1 Merge "Generate care_map.txt when AVB is enabled" 2017-06-02 18:09:58 +00:00
Tianjie Xu 6b2e155ee6 Generate care_map.txt when AVB is enabled
When AVB is enabled, generate care_map.txt and add it to the target
files. Also copy it into the OTA package where it will later be used
by the update_verifier.

Bug: 62208947
Test: \
1. Run add_img_to_target_files on the TF of a new pixel device,
and care_map.txt generates successfully.

2. Make dist in oc-dr1-release and find care_map.txt in the OTA package.

3. update_verifier succeeds in reading all the blocks on the care_map,
and fails to read out-of-bound blocks.

Change-Id: I2881711e6f87789cb7de150dbeca18b756fed68a
2017-06-01 21:36:43 -07:00
Tao Bao c633ed0230 Support re-generating DTBO image from add_img_to_target_files.py.
This is a step to enable signing a given target_files zip with release
keys.

When calling sign_target_files_apks.py, we will delete all the entries
under IMAGES/ in order to re-generate them (with the proper release
keys). In order to support that, we need to pack everything in need into
TF.zip.

Steps to test the CL.
a) Choose a target that has both AVB and DTBO enabled.
 $ m dist

b) Check IMAGES/dtbo.img and PREBUILT_IMAGES/dtbo.img both exist in the
   generated out/dist/TF.zip.

c) Remove the entries under IMAGES/ from the generated TF.zip.
 $ zip -d TF.zip IMAGES/\*

d) Re-generate the images with TF.zip.
 $ build/make/tools/releasetools/add_img_to_target_files.py TF.zip

e) Check that IMAGES/dtbo.img is re-generated, and it's identical to the
   image in b). Note that by default the re-generated image will carry a
   different footer, because of the random salt. This CL is verified by
   specifying the same salt.

Bug: 38315721
Test: see above.
Change-Id: I0bdc4e1cd4800962dc3902ca550dad6a8ca56c78
2017-06-01 20:07:33 -07:00
Treehugger Robot b5e90583ef Merge "Move math function definitions." 2017-06-02 00:11:04 +00:00
Treehugger Robot a46695c337 Merge "Fix make warning/error colors on Mac" 2017-06-01 08:24:49 +00:00
Treehugger Robot db5fa05429 Merge "Pack avbtool into otatools.zip." 2017-06-01 07:19:17 +00:00
Dan Willemsen 25f2d0ded7 Fix make warning/error colors on Mac
Apparently the default bash echo doesn't support \e even though the man
page says it does. So use \033 instead.

Test: m -j nothing on mac, get colors
Test: m -j nothing on linux, still get colors
Change-Id: I608fa87e3c28bf8f99264d39f9b250008a81235a
2017-05-31 19:20:09 -07:00
Tao Bao ba029141dc Merge "Remove the obsolete logic in img_from_target_files.py." 2017-05-31 23:18:15 +00:00
Steven Moreland a64f33668e Move math function definitions.
Created math.mk and moved all math function definitions there.
Then, included this file in config.mk. This allows the functions to be
used by whatever includes config.mk (envsetup and build).

Test: manually setting combinations of PRODUCT_SHIPPING_API_LEVEL
  and PRODUCT_FULL_TREBLE_OVERRIDE and looking at values of
  PRODUCT_FULL_TREBLE.
Bug: 62229856
Change-Id: Icdab4214a1e65ae202411613dbcb9c9ea5f43b09
2017-05-31 20:41:49 +00:00
Tao Bao 2bb109709a Remove the obsolete logic in img_from_target_files.py.
img_from_target_files.py used to handle the case that a given TF.zip not
containing the image entries under IMAGES/. That is only the case for
pre-Lollipop releases.

Also unzip the needed files only since we know that for sure now.

Test: img_from_target_files.py with an existing bullhead-TF.zip gives
      the same bullhead-img.zip.
Change-Id: I892379ba388df80ae63be9d3ce647fbb77fd4753
2017-05-31 11:17:56 -07:00
Tao Bao 3cba374da2 Pack avbtool into otatools.zip.
Also pack the test keys for easier testing.

Bug: 38315721
Test: m otatools-package and avbtool is present in otatools.zip.
Change-Id: Ieb63bf3f4bc211ef1f48ab278cb01b70845d06da
2017-05-31 10:20:25 -07:00
Treehugger Robot fe7aeb1de7 Merge "Support signing custom images with AVB HASH or AVB HASHTREE" 2017-05-31 03:24:25 +00:00
Tianjie Xu f7a76f9a30 Merge "Remove the obsolete UnpackPackageDir() in edify generator" 2017-05-31 01:08:15 +00:00
Treehugger Robot c6ad99c926 Merge "Makefile: Add the dependency for BUILT_OTATOOLS_PACKAGE." 2017-05-30 23:12:50 +00:00
Tianjie Xu 0996f815db Merge "Move recovery building from sign_target_files_apk to add_img_to_target_files" 2017-05-30 20:40:19 +00:00
Treehugger Robot 81787c1bbc Merge "Add blueprint_tools as default target" 2017-05-30 19:30:51 +00:00
Tianjie Xu 616fbeb144 Move recovery building from sign_target_files_apk to add_img_to_target_files
Currently we're building the boot/recovery image twice, which is
redundant. And b/38455129 shows a problematic case when the image
from two builds doesn't match. We should only build the recovery
image once in the add_img_to_target_files.

Bug: 62021378
Test: call sign_target_files_apk on an angler target file,
recovery-from-boot.p generates successfully; and SHA of recovery.img
matches the one in install-recovery.sh.

Change-Id: I01e033501d80c18a87cbb870300eee5c19a04441
2017-05-26 17:20:22 -07:00
Tianjie Xu ada0854169 Merge "Update the recovery files under SYSTEM/ if recovery patch is rebuilt" 2017-05-27 00:15:58 +00:00
Jeff Gaston 143f2b1fe5 Add blueprint_tools as default target
Bug: 38351765
Test: rm out -rf && m -j && stat out/soong/host/*/bin/bpfmt

Change-Id: I60ededa1b13fb575616162d6dc1b0b8159f97f20
2017-05-26 17:12:40 -07:00
Tianjie Xu 38af07ff20 Update the recovery files under SYSTEM/ if recovery patch is rebuilt
If we pass "rebuild_recovery" to add_img_to_target_files, the recovery
patch is rebuilt. But related files under SYSTEM/ (e.g.
SYSTEM/recovery-from-boot.p && SYSTEM/bin/install-recovery.sh) are not
updated.

This may cause a mismatch between system.img and SYSTEM/, and
may lead to a failure in validate_target_files.py.

Bug: 62096364
Test: Rebuild the system image in the TF and observe the recovery files
under SYSTEM/ get updated.

Change-Id: I7d679a612a86d02cf2eff81d1d120c0067138ed9
2017-05-26 22:40:23 +00:00
Treehugger Robot dddd7738d0 Merge "Update RenderScript build config and definitions." 2017-05-26 22:29:36 +00:00
Treehugger Robot 64caaf4679 Merge changes I73787aff,I0d149812
* changes:
  Move APP-% and PRODUCT-% implementation out of Kati
  Remove the rest of showcommands, dist goal
2017-05-26 22:08:49 +00:00
Miao Wang a9fed83fae Update RenderScript build config and definitions.
Bug: 38342163

  - obj/lib is deprecated and TARGET_OUT_INTERMEDIATE_LIBRARIES will be
  removed. We need to use per-module intermediates directory instead.
  - prebuilts/ndk/current folder is gone. For libm and libc, we just
  need ndk/r10 as stub libs for linking.

Test: mm and made sure this does not affect on device target.
Test: make -j50 FORCE_BUILD_RS_COMPAT=true RSTest_Compat works as
expected.

Change-Id: I8fbf5c10322707849a23c6b0dacc28b028db451e
2017-05-26 13:48:08 -07:00
Dan Willemsen 9bfcbc8a71 Move APP-% and PRODUCT-% implementation out of Kati
This way we'll share ninja files with the equivalent normal configs. We
were already parsing them in the make config step in order to fix
TARGET_PRODUCT / TARGET_BUILD_VARIANT / TARGET_BUILD_APPS, now they
replace themselves in MAKECMDGOALS with the appropriate goals.

If we're not going to pass any goals to ninja, pass the default goal.

Test: ALLOW_MISSING_DEPENDENCIES=true m -j APP-Calculator
Test: m -j PRODUCT-aosp_fugu-eng
Test: m -j PRODUCT-aosp_fugu-eng sdk
Test: m -j PRODUCT-aosp_fugu-sdk
Test: lunch aosp_arm64-userdebug; m -j
Test: lunch aosp_arm64-userdebug; m -j dist
Test: lunch aosp_arm64-userdebug; m -j adb
Change-Id: I73787aff9f74aed328e3fa75c571ae15a28851b0
2017-05-26 12:57:04 -07:00
Dan Willemsen 562baccae8 Remove the rest of showcommands, dist goal
showcommands is all handled in soong_ui, make/kati/ninja never see the
argument.

Remove the dist goal, since we'll never pass it to ninja, only to Kati
as a modifier.

Remove DUMP_%, since that's not used anywhere (it appears to be in our
code search via the NDK build system)

Test: m -j showcommands dist
Change-Id: I0d1498128caece685e98c2c2b5b0c3f545da0e11
2017-05-26 12:57:04 -07:00
Colin Cross 7bc6eb12f4 Merge "Pass TARGET_BUILD_PDK to soong" 2017-05-26 19:34:32 +00:00
Tobias Thierer bc8f82ff25 Merge changes from topic 'bug_38177295_checkbuild'
* changes:
  Let signapk access internal APIs under OpenJDK 9 toolchain
  Desugar: allow reflection over internal APIs.
2017-05-26 12:08:39 +00:00
Tobias Thierer 9cc3c76abd Let signapk access internal APIs under OpenJDK 9 toolchain
signapk relies on internal APIs sun.security.{pkcs,x509},
for example in com.android.apksig.internal.apk.v1.V1SchemeSigner.

This breaks at signapk runtime under OpenJDK 9 because those
packages are not exported by the java.base module.

This CL unbreaks signapk by allowing it to access these internal
packages. In the long term, signapk should migrate away from these
internal APIs (bug 37137869).

Test: make ANDROID_COMPILE_WITH_JACK=false checkbuild tests \
      && make checkbuild tests
      (with OpenJDK 8u45 toolchain on the PATH)
Test: make EXPERIMENTAL_USE_OPENJDK9=true \
      ANDROID_COMPILE_WITH_JACK=false checkbuild
      (with jdk 9-ea+170 toolchain on the PATH)

Bug: 37137869
Bug: 38177295
Change-Id: I64cab83e6eb7b135cf2ad7b523736cb409aaae02
2017-05-25 20:34:22 +01:00
Colin Cross 2ddbcdf3a7 Pass TARGET_BUILD_PDK to soong
Also enable ALLOW_MISSING_DEPENDENCIES when TARGET_BUILD_PDK is set
so that soong modules can reference modules that are disabled in the
PDK.

Test: builds
Bug: 62086238
Change-Id: Ic43e843a717b802ace0cee568b9e7e561a6c0868
2017-05-25 10:29:19 -07:00
Tobias Thierer 97479ccb7f Desugar: allow reflection over internal APIs.
Desugar reflects over internal APIs at runtime, using the
java.lang.invoke.MethodHandles.Lookup API.

On OpenJDK 9 toolchains, such reflection is only allowed
to packages to which the java.lang.invoke module is opened.

This CL adds an override to open the module to all unnamed
modules (i.e., to Desugar) when running Desugar.

Test: make checkbuild
      (with OpenJDK 8u45 toolchain on the PATH)
Test: make EXPERIMENTAL_USE_OPENJDK9=true checkbuild
      (with OpenJDK 9-ea toolchain on the PATH)

Bug: 38177295

Change-Id: I2cf74a96ea17366dd50b8d92af8e41e812247ef7
2017-05-25 18:14:27 +01:00
Tobias Thierer 5368131063 Merge "Drop build support for LEGACY_USE_JAVA7." 2017-05-24 10:24:53 +00:00