Commit Graph

100 Commits

Author SHA1 Message Date
Yo Chiang d21e7dc833 Add support for packing multiple vendor ramdisks in vendor_boot
Add support for partitioning the vendor_boot kernel modules into
multiple vendor ramdisk fragments. The partition granularity is kernel
module directory. This mechanism builds upon the existing
BOARD_KERNEL_MODULE_DIRS mechanism. For example, say we have three
kernel module directories:

BOARD_KERNEL_MODULE_DIRS := foo bar baz

We can then define a vendor ramdisk fragment:

BOARD_MKBOOTIMG_ARGS += --header_version 4
BOARD_VENDOR_RAMDISK_FRAGMENTS := dlkm_foobar

And let said ramdisk to contain the DLKM directories "foo" and "bar":

BOARD_VENDOR_RAMDISK_FRAGMENT.dlkm_foobar.KERNEL_MODULE_DIRS := foo bar
BOARD_VENDOR_RAMDISK_FRAGMENT.dlkm_foobar.MKBOOTIMG_ARGS := <mkbootimg args>

The built vendor_boot image would contain two ramdisks.
The first one being the "default" ramdisk, which contains DLKM directory
"baz" and the rest of the files that get's installed to
$(TARGET_VENDOR_RAMDISK_OUT).
The second one is the "dlkm_foobar" ramdisk, which contains the two DLKM
directories.

Design doc: go/vendor-boot-v4

Bug: 162864255
Test: Modify BoardConfig.mk to have a product build v4 vendor_boot
Test: Use unpack_bootimg to verify the vendor_boot image
Test: Teach a bootloader how to handle v4 boot image, flash boot &
  vendor_boot and boot device
Change-Id: Ibb1bbd7ebe36430c55ec6c4818c1d3888a319089
2020-12-17 11:07:04 +08:00
Anton Hansson 41f9cc2c6b Make TARGET_ARCH optional in BoardConfig
Not setting TARGET_ARCH is ok if TARGET_ARCH_SUITE is set instead. Skip
certain TARGET_ARCH-specific steps of the config:
- don't run the 'select' steps to figure out cpu flags
- don't generate dexopt config for TARGET_ARCH

Bug: 174315599
Test: lunch <product that sets TARGET_ARCH_SUITE but not TARGET_ARCH>
Change-Id: I74a9e71d0cc5c7f74d3b10b1c8bb89682c096d7c
2020-12-15 12:46:51 +00:00
Anton Hansson 5e05b8ef31 Add make support for Aml_abis and Ndk_abis options
Add a new TARGET_ARCH_SUITE which, when set to 'mainline_sdk' or 'ndk',
sets `Aml_abis: true` in soong.variables.

This is required to enable removing the custom soong.variables that
are being maintained for the ndk and mainline sdk builds.

Bug: 174315599
Test: TARGET_ARCH_SUITE=mainline-sdk m nothing; inspect soong.variables
      (ditto for ndk)
Change-Id: Ib651a637457310270840d721cdccf50bede3ee58
2020-12-15 12:46:46 +00:00
Anton Hansson b7b3d8ead6 Reformat _board_strip_readonly_list assigment
Allows for adding comments between variable definitions. This matches
the style in product.mk

Test: m nothing
Change-Id: Icc1e3d635a885000c49371997a55001739c02587
2020-12-15 12:45:37 +00:00
Treehugger Robot a25382e565 Merge "Allows GSI AVB keys on vendor boot even when not building vendor boot." 2020-12-15 02:48:43 +00:00
Daniel Norman 6af48c8312 Allows GSI AVB keys on vendor boot even when not building vendor boot.
This allows system-only builds (which disable vendor images) to inherit
from device makefiles that normally place GSI AVB keys on vendor boot.

Bug: 175594737
Test: lunch system-only build, m, observe warning not failure
Change-Id: Ib6c199d0a47b3b3be2143241d83ab586966cfd1e
2020-12-14 13:43:13 -08:00
JaeMan Park aa7b03b970 Add java_sdk_library enforcement flag verification
Raise build error when PRODUCT_ENFORCE_INTER_PARTITION_JAVA_SDK_LIBRARY
is true while BOARD_VNDK_VERSION is not set because
PRODUCT_ENFORCE_INTER_PARTITION_JAVA_SDK_LIBRARY doesn't have any
meaning in that case.

Test: m nothing
Bug: 168180538
Change-Id: Ied2f99763a7cce7674ad50867403a66b18968071
2020-12-09 13:30:51 +09:00
Will McVicker 8f52a568f0 Enable debug ramdisk for vendor_boot with recovery
The debug vendor boot image needs to include the debug ramdisk in order
to retain adb root. So make sure this still happens when recovery is
moved to the the vendor boot image.

Bug: 172510680
Test: verify adb root when using vendor_boot-debug.img
Change-Id: I20fe27635dd33e4d8a59e873e704891de223204b
2020-12-04 11:08:32 -08:00
Treehugger Robot de65fa1959 Merge "Recovery resource must be install to either boot or vendor_boot" 2020-11-17 05:28:13 +00:00
Yifan Hong cc6c202caa Recovery resource must be install to either boot or vendor_boot
... but not both.

Test: builds
Change-Id: I4bebb09632f49fddef25eadc2cad89f41f38178b
2020-11-13 19:12:19 -08:00
Yifan Hong 49968aa137 aosp_arm64 Copy boot image from $OUT to target files
If BOARD_COPY_BOOT_IMAGE_TO_TARGET_FILES is defined,
in target files, instead of rebuilding the boot image, copy the boot
image already built in $OUT to target files package directly so that
they are the same package.

Define BOARD_COPY_BOOT_IMAGE_TO_TARGET_FILES for aosp_arm64.

The GKI APEX is built using the boot image in $OUT. If the boot image in
$OUT is different from the boot image in target files, aka the generic
boot image we release, the GKI APEX we built is invalid.

If another device needs to copy $OUT/boot.img to target files, it can
define BOARD_COPY_BOOT_IMAGE_TO_TARGET_FILES.

Fixes: 172682114
Test: lunch aosp_arm64 &&
Change-Id: I10fc7a5aa36e976dbeaf25434239687455bba061
2020-11-10 12:55:40 -08:00
Yifan Hong ffb2a7f9da Merge "Build boot image if BOARD_KERNEL*_BOOTIMAGE_PARTITION_SIZE" 2020-10-21 18:34:31 +00:00
Treehugger Robot 8d9added3c Merge "Add BUILD_BROKEN_ENFORCE_SYSPROP_OWNER" 2020-10-21 00:26:34 +00:00
Yifan Hong ebe65f8c0a Build boot image if BOARD_KERNEL*_BOOTIMAGE_PARTITION_SIZE
Also gets the correct partition size and checks correctly.

Test: build aosp_arm64

Change-Id: I004e4b04d225d72db1904b983a6d03a916406085
2020-10-20 15:53:12 -07:00
Daniel Norman 6a93af91dc Merge "Removes usage of TARGET_NO_VENDOR_BOOT." 2020-10-20 17:18:01 +00:00
Inseob Kim 9d281d9271 Add BUILD_BROKEN_ENFORCE_SYSPROP_OWNER
In terms of sepolicy rules, every property should have an apporpriate
owner attribute, which can be one of: system_property_type,
product_property_type, or vendor_property_type. This will be enforced
for devices launching with S or later. Devices launching with R or
eariler can relax this by setting following under BoardConfig.mk:

BUILD_BROKEN_ENFORCE_SYSPROP_OWNER := true

See system/sepolicy/public/te_macros for more details.

Bug: 131162102
Test: system/sepolicy/tools/build_policies.sh
Change-Id: Iee05fc15beac1ccf61da4ea901a85b9d4068e0ca
2020-10-19 13:31:58 +09:00
Daniel Norman ad6293c098 Removes usage of TARGET_NO_VENDOR_BOOT.
- true -> PRODUCT_BUILD_VENDOR_BOOT_IMAGE=false
- false -> (removed, uses default option which builds vendor-boot.img
            if BOARD_BOOT_HEADER_VERSION>=3)

Bug: 170423509
Test: Inspect build artifacts from treehugger.
Change-Id: Id16fbda7fdfc70d62db389d6efb5201cb0d6d4e3
2020-10-16 15:10:21 -07:00
Yifan Hong 82b113d9c7 Add BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT
BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT controls whether GSI AVB keys are built
to vendor_boot. On devices without a dedicated recovery partition, GSI AVB
keys used to be built in boot. They are device-specific, so they should be
moved to vendor_boot.

Test: pass
Bug: 156098440
Change-Id: I0a5eaa1b39e88fcca9837c7aa3f475be47d5b0f2
2020-10-15 14:58:34 -07:00
Yifan Hong 881df39d23 Add BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT.
This variable indicates whether recovery resources are moved to
vendor_boot. If true:

- $OUT/recovery.img will not be built
- $OUT/recovery/root will be included in vendor_boot ramdisk

Bug: 156098440
Test: set to true and check output
Test: `m target-files-package` and manually inspect output
Change-Id: I56dda56bab7def1540f4fb506323e3e605620cd4
2020-10-15 14:58:34 -07:00
Yifan Hong 63c5ca19ab Add BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE.
BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE removes kernel from the
recovery image.

Test: build recovery image and unpack_bootimg
Test: build target files and unpack_bootimg IMAGES/recovery.img
      on device with GKI and dedicated recovery partition.

Bug: 156098440

Change-Id: I5f37d74ed954b26fe3dd778708b6ab9cfdc51f1e
2020-10-15 14:58:34 -07:00
Yifan Hong d381f7336a Add GKI global variable.
Add BOARD_USES_GENERIC_KERNEL_IMAGE to be the global variable to
indicate the device uses GKI image.

Test: pass

Bug: 156098440

Change-Id: Ica553bbdb791e25dfa9bafb524ab2de5e3f8720d
2020-10-15 14:58:34 -07:00
Daniel Norman 42879ff536 Various fixes to PRODUCT_BUILD_<IMAGE> variables.
- Introduces PRODUCT_BUILD_VENDOR_BOOT_IMAGE.
  - Controls vendor_boot.img, replacing TARGET_NO_VENDOR_BOOT.
  - Matches the naming convention of other similar vars.
- Guards boot-debug.img behind BUILDING_BOOT_IMAGE
- Restructures BUILDING_BOOT_IMAGE to give priority to
  PRODUCT_BUILD_BOOT_IMAGE, as do other partitions.
- ^ for BUILDING_RECOVERY_IMAGE.

Test: PRODUCT_BUILD_{BOOT,RECOVERY,VENDOR_BOOT}_IMAGE := false
      m dist
      Observe no boot, boot-debug, recovery, or vendor_boot images.
Bug: 169968221
Bug: 170423509
Change-Id: I629bf08ba08e5db14c1bf92bb338fb3ce59d5b73
2020-10-08 22:31:52 +00:00
Yifan Hong c08cbf0f4a Revert "Add modules partition."
Revert submission 1413808-modules_partition

Reason for revert: modules partition no longer needed
Reverted Changes:
Iceafebd85:Add modules partition
I2fa96199a:rootdir: Add modules directory
Ie397b9ec6:Add modules partition.
I4200d0cf5:fastboot: add modules partition

Bug: 163543381

Change-Id: Iec1d9421bbfeb114fb705f85d910c6def1f211b6
2020-09-15 19:09:26 +00:00
Yifan Hong c0f187f5f9 Add modules partition.
Modules partition is a dynamic read-write partition.
- AVB is not enabled on the partition
- OTA is file-based; see follow up CL for details
- No build prop files; in particular, no build fingerprint
- No fs_config
- No notice files; notice files are included in individual APEXes

Test: build on CF
Bug: 163543381

Change-Id: Ie397b9ec61dfd1c158450d050196024604854d4d
2020-09-09 15:00:02 -07:00
Ram Muthiah 2ad69ab090 Merge "Revert "Revert "Add prebuilt bootloader var and add bootloader t..."" 2020-08-28 04:04:24 +00:00
Ram Muthiah 0c4a352409 Revert "Revert "Add prebuilt bootloader var and add bootloader t..."
Revert submission 1411608-revert-1402265-cf-x86-bootloader-XGKLNEQAPF

Reason for revert: Breakage originally caused by change was fixed. Refer to tracking bug for details.
Reverted Changes:
I89e95d4a6:Revert "Add prebuilt bootloader var and add bootlo...
I8fe199351:Revert "Added bootloader binary to cf x86 based ta...

Bug: 166380489
Bug: 164917252
Test: local build and Treehugger build
Change-Id: Ia895aedd77f2ec825aefecaf74c6dfc1ce631c93
2020-08-27 13:18:24 -07:00
Ankit Goyal 3c94b2710a Merge "Revert "Add prebuilt bootloader var and add bootloader to img zip"" 2020-08-26 06:54:34 +00:00
Ankit Goyal 6805873751 Revert "Add prebuilt bootloader var and add bootloader to img zip"
Revert submission 1402265-cf-x86-bootloader

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_master&target=adt3-userdebug&lkgb=6791187&lkbb=6791249&fkbb=6791216, bug 166380489
Reverted Changes:
Id67b7bddd:Add prebuilt bootloader var and add bootloader to ...
Id713eaf20:Added bootloader binary to cf x86 based targets

Change-Id: I89e95d4a6a0534c8217785be9b90632fa110bc41
2020-08-26 06:40:59 +00:00
Ram Muthiah 861f05fb83 Merge "Add prebuilt bootloader var and add bootloader to img zip" 2020-08-26 02:59:22 +00:00
Ram Muthiah 41a03d3aee Add prebuilt bootloader var and add bootloader to img zip
Needed to enable a prebuilt bootloader to make it to the dist and img
directories.

Added a flag to ensure only devices that request will have the update
package populated with a bootloader

Bug: 164917252
Test: local build and Treehugger build
Change-Id: Id67b7bddda14b51a523f794976591c6de04d71ca
2020-08-25 22:12:27 +00:00
Treehugger Robot 68ec133934 Merge changes I03bb00b0,I1cf9a0ef,I1c1b7d25
* changes:
  add support to non-A/B for multiple kernels, boot images
  add BOARD_GKI_NONAB_COMPAT for non-A/B compatability with GKI
  fix recoveryimage-nodeps
2020-08-20 22:21:45 +00:00
Yo Chiang 2dcabab1c9 Merge changes Ib89ef776,I5cdc56c7
* changes:
  Disable required modules check on darwin
  Require required modules to exist
2020-08-12 03:56:10 +00:00
Steve Muckle a49b0c8613 add BOARD_GKI_NONAB_COMPAT for non-A/B compatability with GKI
The directory structure of several ramdisks are different depending on
whether the target is A/B or non-A/B. When the target needs to be
compatible with the GKI however, which is always built as A/B, it is
necessary to build these ramdisks using the A/B file hierarchy. Provide
a flag to enable this override when necessary.

Bug: 161579556
Change-Id: I1cf9a0ef5a338b0b5152113533b62804f3088c83
2020-08-09 18:11:56 -07:00
Yo Chiang 64faf88940 Require required modules to exist
Error if a required module doesn't exist unless
ALLOW_MISSING_DEPENDENCIES or BUILD_BROKEN_MISSING_REQUIRED_MODULES
is true.

Bug: 7456955
Test: TH build_test
Change-Id: I5cdc56c7433b7ce15da155993b7100af9af604fa
Merged-In: I5cdc56c7433b7ce15da155993b7100af9af604fa
(cherry picked from commit c6159372b7)
2020-08-06 06:41:09 +00:00
Yifan Hong 3c1041fb22 Add BOARD_KERNEL_MODULE_INTERFACE_VERSIONS.
This is a list of KMI versions used to filter gki_apex modules. Only
gki_apex modules with kmi_version field that are in the list are created.

Test: build GKI APEXes
Bug: 162888350
Change-Id: I0f582f6ea200d52482fd4065c8f4f8b32efc4dee
2020-08-05 15:45:23 -07:00
Yifan Hong 6040cad5c1 Add BOARD_KERNEL_BINARIES to board_config.mk
Test: pass
Change-Id: Ic670a1c60d6ab2beca593da5941f56d4f3b76c3c
2020-08-05 15:45:23 -07:00
Joel Galenson 154ac1d870 Update language to meet Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference.

Bug: 161896447
Test: Build
Change-Id: I8d33207c84f424e89f367b1c917661347402ae77
2020-07-30 15:05:55 -07:00
Yifan Hong f496f1b94f Add odm_dlkm partition.
Test: define odm_dlkm in CF.
Bug: 156020364
Change-Id: I5593d09a1cdf13e651a13e951336555a7475865e
2020-07-16 12:34:29 -07:00
Yifan Hong cfb917a1c7 Add vendor_dlkm partition.
Test: define vendor_dlkm for CF.
Bug: 156020364

Change-Id: I459059e1c20df7a285a377b8b3bbc8decc60b124
2020-07-13 14:20:56 -07:00
Jiyong Park dd3af422a2 Merge changes from topic "sysprop"
* changes:
  Handle the case when non-optional props have the same value
  BUILD_BROKEN_DUP_SYSPROP as escape hatch for the new sysprop restriction
  pm.dexopt.* props in runtime_libart.mk becomes optional
  Some properties are set as optional
  ro.zygote in base_system.mk is optional
  Don't inherit tablet-dalvik-heap for GSI and emulator
  Support optional prop assignments
2020-07-01 01:46:47 +00:00
Jiyong Park 0b4fccb66d BUILD_BROKEN_DUP_SYSPROP as escape hatch for the new sysprop restriction
As the final step for the refactoring of sysprop configuration, this
change adds BUILD_BROKEN_DUP_SYSPROP which is the escape hatch for
the new restriction. When it is turned on, the new syntax `a ?= b`
collapses to the old syntax `a = b`, duplicated assignments are allowed,
and the dups are resolved following the legacy rule of preferring the
first.

This change also summarizes all the user-facing changes to the Change.md
file.

Lastly, post_process_prop.py is refactored to accept new argument
'--allow-dup' which when turned on allowes duplicated sysprops.

Bug: 117892318
Bug: 158735147
Test: atest --host post_process_prop_unittest

Exempt-From-Owner-Approval: cherry-pick from master

Merged-In: I7bdfffd47d50aad66a78e28a30c3dad7ebac080c
(cherry picked from commit b302cdf6a4)
Change-Id: I7bdfffd47d50aad66a78e28a30c3dad7ebac080c
2020-06-30 18:44:40 +09:00
Inseob Kim 2b0b3d1491 Error if BOARD_VNDK_VERSION=PLATFORM_VNDK_VERSION
"BOARD_VNDK_VERSION := current" should be used instead.

Bug: 159866756
Test: manual
Change-Id: I854ca9c0fa195ab4bbb468a1343ef4fa28ac9258
2020-06-27 00:18:12 +09:00
Martin Stjernholm 7a430fd4c8 Introduce TARGET_BUILD_UNBUNDLED.
Setting this flag enables unbundled building, i.e. without support for
building the system image and other platform targets. This
functionality was previously enabled by TARGET_BUILD_APPS, and setting
that still implies TARGET_BUILD_UNBUNDLED.

This helps unbundled builds that aren't apps, e.g. ART runtest builds.
Specifically, with the topic of the child CL
https://r.android.com/1324517 TARGET_BUILD_UNBUNDLED does not imply
disabling dexpreopting, unlike TARGET_BUILD_APPS.

TODO: There may still be app-specific conditions that are incorrectly
controlled by TARGET_BUILD_UNBUNDLED, in particular on the Soong side
through config.UnbundledBuild().

Test: Flash & boot
Test: TH, in particular builds green on ub-launcher3-master
Bug: 157549171
Change-Id: Ic09fc879117ee06cab5444edfc280ed2b52d2870
2020-06-11 01:09:07 +01:00
Elliott Hughes 9b824d5ceb Remove TARGET_PREFER_32_BIT.
Bug: https://issuetracker.google.com/138812821
Test: builds
Change-Id: I2ff7793c8b1eb56f6be63375cc7b70aa44254443
2020-06-08 16:36:52 -07:00
Yifan Hong 65afc07f9d Support forcefully generating non-AB packages.
Force generate a non-A/B update package when requested.

Bug: 154344887
Test: ota_from_target_files.py --force_non_ab ...
Test: apply it as well

Change-Id: I5e81eb161722e07ef50081b6a16685cbc9963ae2
(cherry picked from commit 7169f754cc)
Merged-In: I5e81eb161722e07ef50081b6a16685cbc9963ae2
2020-05-19 15:23:27 -07:00
Yo Chiang 2cbcf3bda2 Merge "Check ELF prebuilts in PRODUCT_COPY_FILES" 2020-04-17 01:06:32 +00:00
Steve Muckle f84668e1da Enable non-v3 recovery image with v3 boot image
Add support for building a non-v3 recovery image along with a
v3 boot.img and vendor_boot image.

Bug: 150825361
Change-Id: I80d4e71ff09b83dd1c7f9accb4de99a30f95f4bf
2020-04-14 13:03:58 -07:00
Yo Chiang 0b49c03727 Check ELF prebuilts in PRODUCT_COPY_FILES
Add a check to ban ELF prebuilts in PRODUCT_COPY_FILES.
ELF prebuilts should be defined properly by cc_prebuilt_library_shared
and cc_prebuilt_binary so that the build system can keep track of the
file dependencies.

To opt in this check, set this option in BoardConfig.mk:
  BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := false

After all devices that have ELF prebuilts in PRODUCT_COPY_FILES are
tagged with BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true flip
BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES to default false.

After a device is cleaned up, remove its
BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true setting.

Bug: 140560012
Test: Set BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := false
Test: m # Should report any ELF prebuilt error in PRODUCT_COPY_FILES
Change-Id: Id75dac9417aed9baa7c5e9388430ff9369cf9b4f
2020-04-08 18:01:24 +08:00
Dan Willemsen 97ec812708 Mark the current BUILD_* warnings as errors by default
This switches:

  BUILD_COPY_HEADERS / LOCAL_COPY_HEADERS
  BUILD_HOST_EXECUTABLE
  BUILD_HOST_SHARED_LIBRARY
  BUILD_HOST_STATIC_LIBRARY

to errors by default. Devices can set
BUILD_BROKEN_USES_BUILD_HOST_EXECUTABLE (etc) to turn these errors back
to warnings. I've done that for all of our internal devices.

Bug: 130719878
Bug: 130696912
Bug: 130722971
Bug: 130723227
Test: remove the BUILD_BROKEN_USES_* lines from a device, see errors
Change-Id: I1aecf97f64e281df3682ff0a0fb3ac4283790acd
Merged-In: I1aecf97f64e281df3682ff0a0fb3ac4283790acd
(cherry picked from commit c4bdff5f7e)
2020-03-07 11:29:29 -08:00
Treehugger Robot 28a7820be2 Merge "initial GKI boot.img support" 2020-03-05 00:31:27 +00:00