Commit Graph

232 Commits

Author SHA1 Message Date
Paul Trautrim 23b46e54ac Merge "Add PRODUCT_BUILD_VBMETA_IMAGE to control vbmeta generation" 2019-08-20 00:07:35 +00:00
Treehugger Robot a7832d5543 Merge "Add a product build var for mainline module certs" 2019-08-15 07:43:46 +00:00
Paul Trautrim 4e14323a31 Add PRODUCT_BUILD_VBMETA_IMAGE to control vbmeta generation
In line with the existing PRODUCT_BUILD_*_IMAGE variables, add a flag to
control whether vbmeta is generated.

Bug: 139328573
Test: manual
Change-Id: Id71026f9b0de9019e82e8ef594e718a4b0f3628f
2019-08-13 16:43:39 +09:00
Yifan Hong 7d37b40c6e Add virtual A/B product.
- Add PRODUCT_VIRTUAL_AB_OTA(_RETROFIT)
- Set ro.virtual_ab.{enabled,retrofit} respectively.

A device will do the following to enable virtual a/b or retrofit:

$(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota_retrofit.mk)

Bug: 135752105
Test: build with device with flag set
Change-Id: I6cb1207aef3ddcc40e215e20589abf995ec81aac
2019-08-07 18:31:33 -07:00
Remi NGUYEN VAN 87d0f2703f Add a product build var for mainline module certs
OEMs may need to have different device configurations that use different
signing configurations for mainline modules. The network stack mainline
module has a sepolicy context referencing its certificate, so the
generated plat_mac_permission.xml differs based on the module signing
configuration.

The added PRODUCT_MAINLINE_SEPOLICY_DEV_CERTIFICATES variable defines a
per-product directory for the certificates, so that which certificate to
use can be configured in the product makefile, instead of replacing the
certificate file itself.

This change is to be submitted together with another change in sepolicy
makefile.

Test: changed certificate path, m, verified plat_mac_permissions.xml has
      new certificate.
Bug: 134995443
Bug: 138097611

Change-Id: I863a9904d4a2ea2abad679ae0969d50e374f269d
2019-08-07 18:54:04 +09:00
Elliott Hughes 0548439172 Remove PRODUCT_IOT.
Test: treehugger
Change-Id: Ic214ebda6c65e7e51e39151b10f4ce965b35c121
2019-07-30 09:01:15 -07:00
Justin Yun 6151e3f1ea Rename product_services to system_ext
Bug: 134359158
Test: build and check if system_ext.img is created
Change-Id: I67f2e95dd29eac6a28e07e24ea973d3a134c3bfc
2019-07-09 08:57:19 +00:00
Kavi Gupta 7185f8cc2d Modify build to put dumpcoverage agent into /system/lib
This location allows the agent to be attached to arbitrary processes.

It only makes sense to include libdumpcoverage.so on coverage builds,
as these are the only builds that have any information to be dumped.

Test: manual, used examples in README (see other CL) to test whether
it works on a userdebug_coverage build on cuttlefish

Change-Id: Ib2fece1b41a3b5d16c8a2a444c5486137e475fda
2019-06-27 09:28:39 -07:00
Anton Hansson 528fdc021f Fix non-existing modules check
This variable was accidentally changed to refer to the
shorthand PRODUCT_XYZ instead of PRODUCTS.<mk>.PRODUCT_XYZ
in a previous mass-migration, but that shorthand didn't
exist for these variables. Add it in.

Also whitelist the offender introduced since it was broken.

Test: lunch generic; m nothing
Change-Id: I29dd73c29796743e770afa0c2ceb4f8583dc6e1e
2019-06-25 21:52:58 +01:00
Anton Hansson 879b007555 Make PRODUCT_CHARACTERISTICS a single-valued variable
Values should be comma-separated, and things won't go down well
if there are multiple words in this variable.

Bug: 123783710
Test: Put this in product_config.mk and ran multiproduct_kati:
      ifneq (1,$(words $(PRODUCT_CHARACTERISTICS)))
        $(error oops)
      endif
Change-Id: I5627f416093d68d8d19916a914739686b74d392f
2019-05-13 18:15:32 +01:00
Treehugger Robot 765e433d24 Merge "Add PRODUCT_EXTRA_VNDK_VERSIONS product variables" 2019-05-09 08:25:23 +00:00
Isaac Chen e9723507a1 Add PRODUCT_EXTRA_VNDK_VERSIONS product variables
PRODUCT_EXTRA_VNDK_VERSIONS should be in _product_list_vars
because it's used as a list with probably more than one version
included/set in differemt makefiles.

Bug: 132046980
Test: $ lunch aosp_x86_ab-userdebug
      $ m -j
      $ find $OUT/system/ -name vndk-* # vndk-27 directory is included

Change-Id: Iee9b7b678a23eed781cc761d820db9ff67ae5d34
2019-05-08 15:46:00 +08:00
Chris Gross a784ef197c Add BUILD_RECOVERY_IMAGE and BUILD_BOOT_IMAGE flags
Bug: 123428770
Test: Built system-only image and checked that no boot.img or
recovery.img files where created. Booted the resulting merged build on
device.

Change-Id: I760476502775e68125907c39e66b8665e789a798
2019-05-07 11:00:37 -07:00
Anton Hansson c1c4c0bbf0 Mark many single value variables as such
This changes these variables to not inherit multiple values,
which allow for some more flexibility in how/where they're defined
in makefiles.

Also remove the previous equivalent solution that was in place for
the PRODUCT_BUILD_* flags.

Bug: 116769560
Test: presubmit
Change-Id: Ia27a11d95263ceb45ffa355e75bb2aa6d9672139
2019-05-06 16:19:19 +01:00
Anton Hansson d26c647f74 Add support for single-value product variables
Prior to this change, all PRODUCT_* variables are inherited with
list semantics, meaning the variable value in the current makefile
as well as all the makefiles it inherits are concatenated together.

Many of these variables are not lists, so this change adds the
ability to classify a variable as a single-value variable, which
will inherit at most one value (the first one), unless the variable
is already defined in the current file.

This change also marks all current variables as list variables.
A future change will re-classify the single-value variables as such.

Bug: 116769560
Test: presubmit
Change-Id: I57719a5eefd0749e92c08b1773b6f929629267a3
2019-05-06 16:17:20 +01:00
Calin Juravle c23e013814 Merge "Rename PRODUCT_USES_ART to PRODUCT_USES_DEFAULT_ART_CONFIG" 2019-05-02 17:56:11 +00:00
Calin Juravle cdff6b1451 Rename PRODUCT_USES_ART to PRODUCT_USES_DEFAULT_ART_CONFIG
It better describes what is meant to represent.

Test: m build
Change-Id: I942721cee2c7eaef625bf8c64aae32c1725705eb
2019-05-01 15:35:03 -07:00
Mathieu Chartier b9dc792b19 Add PRODUCT_DEX_PREOPT_RESOLVE_STARTUP_STRINGS
For enabling per product configuration of resolving startup
const strings.

Bug: 130217075
Bug: 131310042
Test: make

(cherry picked from commit b37c79c3a2)

Merged-In: I51cb8931b915a710ab584f954b7a99c7a651d914
Change-Id: I0ecc7823620bca9f252b3d91b82982db91dd248d
2019-04-30 17:00:19 -07:00
Calin Juravle 6bfdcda0e6 Add the entire boot image to boot.zip
Add all the boot image files necessary of offline inspection and
compilation in a single zip file (boot.zip).

This replaces the previous boot_profiles_jars.zip which contained only the
jar files.

Bug: 130376456
Test: m dist

Change-Id: I25b0c03ee9e7a2c2ff25db406656ce79baff5a46
Merged-In: Ib71c4fcc0d451570d0bb0584745487c54f884fd9
(cherry picked from commit 3dfae3f149)
2019-04-18 17:48:39 -07:00
Tao Bao 9be20c7650 Allow building generic OTA packages.
We already have targets that build generic system images, which can be
applied (flashed) onto matching devices to replace their target-specific
system images. This CL adds PRODUCT_BUILD_GENERIC_OTA_PACKAGE that
allows building generic OTA packages to be installed over-the-air.

Since A/B and non-A/B OTAs have different package formats, currently the
support is limited to targets that use A/B OTAs. Note that this CL only
allows _building_ the package - will need additional changes for the
actual package install as well as targeting matching devices.

Bug: 122851610
Test: `m otapackage` on a target that sets
      `PRODUCT_BUILD_GENERIC_OTA_PACKAGE := true`.
Test: TreeHugger
Change-Id: If6fd2da15d24c5aaee09618efe94514c6d83292d
2019-04-10 14:29:50 -07:00
Anton Hansson 13ea2a6a7d Automate the strip and assignment of PRODUCT_ vars
With this change, all PRODUCT_ variables are treated the same
when it comes to stripping and assigning them to their final
variable name. In the past, all the PRODUCT variables needed
to be listed in two places to achieve this.

The documentation previously attached to the strip/assignment
is moved to the PRODUCT_ variable list in product.mk.

Also refactor some of the default value logic to cope with
the new automation.

Many places in the build system that currently refer to
$(PRODUCTS.$(INTERNAL_PRODUCT).X) can now be modified to
use $(X) directly.

Bug: 116769560
Test: verified noop on PRODUCT_ variables on all products in the tree
Change-Id: I5677c355e81359b1d3c0db2a2232941097a05047
2019-03-28 15:26:49 +00:00
Anton Hansson ee4c970eb0 System-specific product sysprops
This change makes it possible for products to specify the values
of the ro.product.system.X sysprops independently from the
corresponding sysprops on the other partitions.

Leave the fingerprint as-is for now. It will be changed to follow
suit in a followup change.

Bug: 110206836
Test: make
Change-Id: Id30012e1948df792778b102203116d4ae3f68e56
2019-03-12 18:03:44 +00:00
Dan Willemsen 3d05a08a6f Reland "First pass at creating PRODUCT_HOST_PACKAGES"
Adds icu-data_host_runtime_apex to fix unbundled builds which pull it in
via PRODUCT_PACKAGES, but are missing packages that would pull it in via
PRODUCT_HOST_PACKAGES.

Test: build/soong/build_test.bash
Test: in ub-timezonedata-master; tapas TimeZoneData; m
Change-Id: I1583c7582b386c3e8478711cb1df340518d763c1
Merged-In: I1583c7582b386c3e8478711cb1df340518d763c1
2019-03-06 14:46:06 -08:00
Anton Hansson d488d2d7d7 Move BoardConfig strip / READONLY marking
This moves the BoardConfig READONLY marking being product.mk's
responsibility to board_config.mk.

Also unify it with the BUILD_BROKEN_* setting handling, and
READONLY a few additional variables.

Test: build_test
Change-Id: Ifcfef588aa459223d6d7f017413d1681f341297f
2019-03-01 10:04:18 +00:00
Anton Hansson 71b7f7fbd0 Add support for *_CPU_VARIANT_RUNTIME flags
Specified in the BoardConfig, and default to the value of the non
_RUNTIME variants.

These flags do not modify build-time compilation, but get written to
system properties on /vendor and can be inspected at runtime to
run/compile code for the specified cpu.

Migrate the bionic and ART cpu variant flags to use the new variables,
but leave the ART preopting using the non-_RUNTIME variants.

Bug: 120773446
Test: boot downstream device specifying CPU_VARIANT_RUNTIME flags
Test: grep dalvik.vm vendor/default.prop
Change-Id: Idc81110172582f38f84cca87f2eff140c5b5f9ac
2019-02-21 14:32:13 +00:00
Anton Hansson 70222b21ee Add more BoardConfig variables to stash list
I would like to centralize/standardize the BoardConfig
variable sanity checking in a file similar to product_config.mk,
but for now just add a few more standard BoardConfig
variables to the .KATI_READONLY list.

Also fix the inconsistent indentation in this file.

Test: make
Change-Id: I2a878b95ffc07e3f5bc4eb4970775bdef347e094
2019-02-21 14:02:15 +00:00
Nicolas Geoffray cd75414f1e Merge "Revert "Revert "Never strip and store dex files uncompressed when they are preopted on system.""" 2019-02-13 11:59:39 +00:00
Anton Hansson 2582554c42 Merge "Move dump-products back to the config stage" 2019-02-13 09:12:30 +00:00
Nicolas Geoffray 98f5e86660 Revert "Revert "Never strip and store dex files uncompressed when they are preopted on system.""
This reverts commit a81dad1bc4.

Test: build && atest android.text.cts.EmojiTest#testEmojiGlyphWebView on Cuttlefish
Change-Id: Ie3c43830fc9a994ed35883abb8ca71d97bd5c44d
2019-02-12 14:00:38 +00:00
Dan Willemsen 5436c7e583 Obsolete add_lunch_combo
Bug: 77599627
Test: source build/envsetup.sh with add_lunch_combo calls in bash & zsh
Change-Id: If12b41d8f9a2f56efdb64ad0dccc25a1e342fdd1
2019-02-11 21:36:25 -08:00
Anton Hansson dce3f920f2 Move dump-products back to the config stage
It's unnecessary to run all the make file parsing to dump product
configs. Move the dumping to product_config.mk instead, but switch
the output to $(warnings) as stdout is a bit sensitive during
the config stage.

Test: multiproduct_kati -only-config dump-products
Change-Id: I8c7365c9f90ea2bf152b82dfb983bfb0cdcb1697
2019-02-11 21:19:54 +00:00
Colin Cross 05ef66fc0b Merge "Revert "Never strip and store dex files uncompressed when they are preopted on system."" 2019-02-11 19:31:31 +00:00
Colin Cross a81dad1bc4 Revert "Never strip and store dex files uncompressed when they are preopted on system."
This reverts commit 9cdc3beb3d.

Reason for revert: b/123436620

Change-Id: I45fa9236e37c3b7e2d44ede62a2701db2bc8a20d
2019-02-11 19:30:39 +00:00
Nicolas Geoffray f07d63390c Merge "Never strip and store dex files uncompressed when they are preopted on system." 2019-02-11 10:31:12 +00:00
Nicolas Geoffray 9cdc3beb3d Never strip and store dex files uncompressed when they are preopted on system.
In order for the runtime module to always be able to compile apps,
make sure we keep a copy of the dex files optimally.

Gated by a product flag if a product doesn't include the module yet.

Test: build
Change-Id: Ia9bba7f6f12f3400078a43d39ba4134cf8818399
2019-02-08 22:45:48 +00:00
Jaewoong Jung 664b72abfe Merge "Make side change for prod override vars support." 2019-02-07 01:50:59 +00:00
Kostya Kortchinsky 027324099f Add option to disable Scudo globally [Make]
This adds an option to turn off Scudo globally, and use it for Go.

Bug: 123228023
Test: verify that Scudo is disabled for a Go build, eg:
lunch marlin_svelte-eng && m -j, check that Scudo is not linked in
out/target/product/marlin/system/bin/mediaextractor
Test: verify that Scudo is enabled otherwise, eg:
lunch marlin-eng && m -j, check that Scudo is linked in
out/target/product/marlin/system/bin/mediaextractor

Change-Id: Idc82d581fade544a474e6f2ff0b54dd191ba0818
Merged-In: Idc82d581fade544a474e6f2ff0b54dd191ba0818
2019-02-04 12:35:04 -08:00
Jaewoong Jung 7dfae5023a Make side change for prod override vars support.
For the new override vars, we don't support make-based overrides because
their primary purpose is to enable Soong migrations for the ones that
use inherit-package.

Bug: 122957760
Test: Manual build tests with Browser2, BrowserGoogle, and Chrome
Change-Id: Ia685511391f61fe143774e12b3b67b526049962a
2019-01-30 14:48:50 -08:00
Logan Chien 0e53d887d6 Add prebuilt ELF binaries checker
This commit introduces a prebuilt ELF binaries checker.  The checker
will check:

1. Whether all DT_NEEDED shared libraries are specified in
   `shared_libs` (Android.bp) or `LOCAL_SHARED_LIBRARIES` (Android.mk).

2. Whether all undefined symbols in the prebuilt binary can be resolved
   to defined symbols exported by its dependencies.

This ensures that prebuilt binaries won't silently become ABI
incompatible.

To check the prebuilt binaries, all of the dependencies must be
specified in `shared_libs` (Android.bp) or `LOCAL_SHARED_LIBRARIES`
(Android.mk).

If your prebuilt binaries cannot be checked for some reason, you may add
the following property to Android.bp:

    check_elf_files: false,

Or, add the following setting to Android.mk:

    LOCAL_CHECK_ELF_FILES := false

Bug: 119084334
Test: CHECK_ELF_FILES=true make check-elf-files
Change-Id: I523d3083f22fd4053c096d26f61f8375800281c8
2019-01-21 21:35:01 +08:00
Dongwon Kang 167758a153 Move UPDATABLE_BOOT_(MODULES|JARS) to base_system.mk for further extension
Test: build & boot
Bug: 112766913

Change-Id: I5af02d44c4b4163acdc4e3078dcebd84556ee049
2019-01-18 17:06:18 -08:00
Dan Willemsen 674952098b Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.

There are a few use cases here:

 * For GSI-like cases, we only want to build the system image. This
   didn't really change, but it's somewhat simpler to configure, and
   easier to understand the build logic.

 * On the opposite side, when you're planning on using a GSI, the device
   specific build can only build the vendor images (or some other set).

 * Some cases (Fuchsia, etc) don't want to build any images, as they'll
   be distributing the build artifacts in their own packaging.

I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.

Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-18 13:11:34 -08:00
Jeongik Cha b2c4bb7e3d Dump and enforce certificate for apks
Dump the list of APKs that aren't located at system partition and signed
with system certificate.
And when enforcement option is enabled, it makes build error if there is
the apk that satisfies the condition above.

Bug: 74699609

Test: m -j
Test: m out/target/product/$(get_build_var TARGET_DEVICE)/certificate_violation_modules.txt

Change-Id: I23c41f2665dd97abac3e77d1c82d81ff91b894eb
2019-01-10 11:37:22 +09:00
Jiyong Park 185d41e84d Add PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES
It is a list of <module_name>:<manifest_name> pairs. When the module
name of an APK or an APEX matches with <module_name>, then its app
manifest name is overridden to <manifest_name>.

<module_name> and <manifest_name> can be patterns as in
com.android.%:com.mycompany.android.%.release

Test: m with PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES for
1) an APK in Android.mk
2) an APK in ANdroid.bp
3) an APEX
and check that manifest names are modified as specified

Change-Id: Ic09e059ea7b7ea99a50a1cf423a25aa587ef4466
2019-01-09 21:08:10 +09:00
Yifan Hong e5d879a193 Allow space in BOARD_*_SIZE variables for dynamic partitions
Allow instances like:
BOARD_SUPER_PARTITION_SIZE := 4294967296 # 4GiB

Test: add trailing space to BOARD_SUPER_PARTITION_SIZE,
BOARD_(group)_SIZE, BOARD_*IMAGE_PARTITION_RESERVED_SIZE,
BOARD_SUPER_PARTITION_(device)_DEVICE_SIZE, build passes.

Fixes: 120042457
Change-Id: Ib7244e3fd2f782657c84cdb74e601ac96176571d
2018-11-28 15:33:17 -08:00
Ivan Lozano fda9a6f38e Add support for AArch64 XOM binaries.
Adds build system support for generating AArch64 binaries with
execute-only memory layouts via a new LOCAL_XOM property. Also adds
support for an ENABLE_XOM build flag for global builds.

Bug: 77958880
Test: make -j ENABLE_XOM=true
Change-Id: I6af9e3615d0a9fdff802eae50e6ad94311ec8046
2018-11-21 09:05:08 -08:00
Treehugger Robot b906ebb313 Merge "PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS: allow inheritance" 2018-11-21 00:41:44 +00:00
Yifan Hong 452d9267fc PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS: allow inheritance
Test: with this is true, build
     `verified_assembled_system_matrix.xml`;
      file includes kernel requirements
Change-Id: I833b4fefabefb2f0457171055afe5722981e3589
2018-11-20 11:50:52 -08:00
Yifan Hong 7416b8d143 Remove PRODUCT_USE_LOGICAL_PARTITIONS.
Use PRODUCT_USE_DYNAMIC_PARTITIONS instead.
Test: boots
Fixes: 119286600

Change-Id: I5c0828eac2b6c579edbb494b150bc586b3b576f1
2018-11-20 00:34:30 +00:00
David Anderson 619fe2da5a Add build flags for spanning the super partition across multiple block devices.
This adds BOARD_SUPER_PARTITION_BLOCK_DEVICES, which must contain a list
of the (non-A/B suffixed) partitions that will comprise the super
partition. It is only intended for devices which cannot have a partition
named "super". For each entry, there must be a
BOARD_SUPER_PARTITION_x_DEVICE_SIZE variable defined with the exact size
of that partition (not its image size). The sum of these sizes must be
equal to BOARD_SUPER_PARTITION_SIZE.

Bug: 116802789
Test: device with BOARD_SUPER_PARTITION_BLOCK_DEVICES builds
Change-Id: I1a79c2e08ca99ce7e42207893ef3285caffecf44
2018-11-12 16:12:51 -08:00
Yifan Hong c5c0124e7d logical partitions -> dynamic partitions
Reflect a name change.

* PRODUCT_USE_LOGICAL_PARTITIONS is deprecated and
will be removed in the future.

* ro.boot.dynamic_partitions is created. ro.boot.logical_partitions
will be removed once all the usage is removed.

Bug: 119286600
Test: builds

Change-Id: I5cb8bb1f5ebcee893fbef3a0f047c32de8773830
2018-11-09 16:02:59 -08:00