Compare commits

..

73 commits

Author SHA1 Message Date
Alexander Koskovich
0ee73fcd93
Fix printf usage in _wrap_build()
On some systems using floating-point instead of decimal results
in the build time being displayed as "nan:nan".

Test: m, "build completed successfully (02:26 (mm:ss))"
Change-Id: I7a2b401903b63117a7718cc5aa2a0d5610b57ca2
2024-10-24 19:32:27 +02:00
Aaron Kling
4bd23deef4
core/Makefile: Fix filenames with commas
Prior to this, any filenames with commas, for example device specific
nvrams or hcds compatible with the mainline kernel, would cause a build
failure because GNU make can't handle passing an argument with a comma
because comma is the delimiter.

To work around this pass the arguments via variables local to the rule.

Change-Id: I852b36d7194394389a63683fc8c68474f8323d9b
2024-10-24 19:32:20 +02:00
LuK1337
12fa5410d1
core: Allow overriding device/model/name/fingerprint properties
Change-Id: I84c4ecb4d20fe6954551e4f07f739e04bfffd647
2024-10-24 19:32:03 +02:00
Luca Stefani
ef1f47fc07
Export PRODUCT_BUILD_PROP_OVERRIDES to soong
Change-Id: I6b6da3ef5b76cec5274f58b9337974d61771cecd
2024-10-24 19:31:52 +02:00
Inseob Kim
2e615745ce
Include TARGET_ODM_PROP to odm/etc/build.prop
It's missing in Soong's build_prop module.

Bug: 322090587
Bug: 361623560
Test: set TARGET_ODM_PROP and see odm/etc/build.prop
Change-Id: I670081bbe0addc8fed0b7c04ae560ef830cbfecf
2024-10-24 19:31:52 +02:00
Inseob Kim
45a7c8cf92
Build product/odm build.prop with Soong
Bug: 322090587
Test: compare build.prop before and after, boot
Change-Id: Iab157cf313d62c1c95ef66dd0a2b9563ee60ab46
2024-10-24 19:31:52 +02:00
Inseob Kim
65b9ee2040
Build system_ext build.prop with Soong
Bug: 322090587
Test: build and compare system_ext/etc/build.prop
Change-Id: I7b1af2e2b1fe7f107e1540d7b797c7bf489b8a0d
2024-10-24 19:31:52 +02:00
Inseob Kim
4d8f8c5906
Revert^6 "Use Soong-built system/build.prop"
0b2f48f0b2966227b8cb9c7eec332288e4c76099

Change-Id: I5d89d26945a3ab94f102633ccffa7622b5f99469
2024-10-24 19:31:52 +02:00
Pawan Wagh
b2aafc4f2f
Set system property ro.product.page_size
When target sets TARGET_BOOTS_16K, it should boot
with 16KB page size. Adding system property based on TARGET_BOOTS_16K.

Test: m Vts16KPageSizeTest && atest -c Vts16KPageSizeTest
Flag: TEST_ONLY
Bug: 350993987
Change-Id: I72c55261ad8d67dfa6be7374e1acd6baddbb3342
2024-10-24 19:31:52 +02:00
Inseob Kim
6e875791eb
Revert "Revert "Revert "Revert "Revert^2 "Add more variables for..."
Revert submission 3200273-revert-3196490-revert-3195812-revert-3195644-revert-3195637-revert-3184480-system_build_prop_soong-BZIDUTEOOC-KRUETCBWUR-TUHZPHUVFJ-XYILSUPUOA-PCKYAVELZP

Reason for revert: fixed breakage with aosp/3200730, verified with ABTD

Reverted changes: /q/submissionid:3200273-revert-3196490-revert-3195812-revert-3195644-revert-3195637-revert-3184480-system_build_prop_soong-BZIDUTEOOC-KRUETCBWUR-TUHZPHUVFJ-XYILSUPUOA-PCKYAVELZP

Change-Id: I19163de97c397b9c171362d221389a1d66a5712a
2024-10-24 19:31:52 +02:00
Inseob Kim
f41361569b
Fix a bug that BUILD_VERSION_TAGS is ignored
Bug: 349046347
Test: set BUILD_VERSION_TAGS and build
Change-Id: Ica1c8283ec530147e744613692a3daccf7f94a4a
2024-10-24 19:31:52 +02:00
Inseob Kim
b98cf3cf21
Revert^2 "Conditionally pass kernel version to build.prop"
ff77e222131c0c79bce658ea658afa4d6f2ba673

Change-Id: I846175bb9dc2b0e000fc39c7faf2e24167b4a513
2024-10-24 19:31:52 +02:00
Kiyoung Kim
92cc83d5f2
Pass PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD to Soong
Pass PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD to Soong so it can decide if
ART debug APEX should be used instead of ART APEX

Bug: 351698657
Test: AOSP CF eng build succeeded
Change-Id: I1e0683be5cd66f1a18e7aec5b1d96ac6e5f4588a
2024-10-24 19:31:52 +02:00
Inseob Kim
b91b0f1462
Add build_prop soong module
build_prop is a soong module generating {partition}/build.prop. It's
ported from build/make/core/sysprop.mk and will replace sysprop.mk in
the future. Currently used only by Android.bp cuttlefish system image.

Bug: 322090587
Bug: 346214958
Test: compare system/build.prop and aosp_cf_x86_64_system-build.prop for
      eng / user / userdebug
Change-Id: Iadb793a049b7be15b36f948c3a473105db3835a1
2024-10-24 19:31:52 +02:00
Inseob Kim
8fac570055
Add soong extra config file
Soong extra config file contains Makefile variables that Soong itself
doesn't need to know. It will be read by product_config module to
provide Makefile variables to build tools e.g. build.prop.

Bug: 346214955
Test: see output of product_config module
Change-Id: I045b2722ae85a10d33b9e6b832f4cc2d6789e59a
2024-10-24 19:31:52 +02:00
Luca Stefani
c5505418b4
aflags: Ensure <partition>/aconfig_flags.pb exists before reading
In some build targets/combinations aconfig_flags.pb
may not be generated.

For example in GSI only system/aconfig_flags.pb exists
and system-only updates won't have vendor/aconfig_flags.pb.

Test: m, aflags
Change-Id: I136345a8748bc6d80bd98e673f90e0a2ab380ab1
2024-10-24 19:31:52 +02:00
Cole Faust
a83dd3bc49
Add soong_config_set_bool
To allow typing soong config variables as bools for using in soong
select expressions.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I39496cd2a3366689e3f232ba10353a7d56d8d1ed
2024-10-24 19:31:52 +02:00
Cole Faust
f6a5a12325
Add PLATFORM_SEPOLICY_VERSION as a soong config variable
So that it can be used in android.bp files. This is to replace the
existing usages of PLATFORM_SEPOLICY_COMPAT_VERSIONS.

Bug: 347605145
Bug: 342006386
Test: m nothing --no-skip-soong-tests
Change-Id: Ia2831fa2c77b2f55d4e39e48b71acf13c605bf1e
2024-10-24 19:31:52 +02:00
Cosmin Tanislav
0fc77ec51e
Don't copy recovery.img to BOOTABLE_IMAGES if it doesn't exist
If BOARD_USES_RECOVERY_AS_BOOT is set to true, recovery.img is
not built.

If BOARD_CUSTOM_BOOTIMG is set, INSTALLED_RECOVERYIMAGE_TARGET
gets copied to BOOTABLE_IMAGES.

If both are set, the following error is produced.

acp: missing destination file

Since it is possible to have both BOARD_USES_RECOVERY_AS_BOOT and
BOARD_CUSTOM_BOOTIMG set, guard the copy operation so that it does
not try to copy a missing recovery.img.

Change-Id: Iae24e31a586e98955807d213df3dbaa0a2f13bae
2024-10-24 19:31:52 +02:00
Yumi Yukimura
4080494752
releasetools: Pass non-sparse super_empty.img to update_dynamic_partitions()
* So that updater program can load dynamic partitions metadata from OTA
  when it fails to load from the device

Change-Id: I73687009a2cb243aba1bfec6f357c8ff25f27784
2024-10-24 19:31:52 +02:00
Yumi Yukimura
28e997681e
releasetools: build_super_image: Do not set readonly attr
* Makes logical partitions writable when flashed to the device

Change-Id: Id473acaedab9400870700bc317a140fd73a58456
2024-10-24 19:31:52 +02:00
Yumi Yukimura
d233aeb780
build: Enable super image build rules depending on single super block device
* The current logic does not suit for multiple block devices case,
  it generates split images hence output dir shall be specified
* Multiple block devices is possible with non-RDAP too, and it could
  work for RDAP with single block device, so it's incorrect to depend
  on RDAP flag

Change-Id: I8563b96b35351ef0a3b40ae172c2e904ee57f85e
2024-10-24 19:31:52 +02:00
Chirayu Desai
390c3a63af
Don't set PRODUCT_ENABLE_UFFD_GC by default
* Overriding this from devices doesn't work
* Using ?= here doesn't work either
* It still defaults to "default" based on other places
  and works the same, so let's just remove this

Change-Id: Ie9d732796a46770c11a7608e7c0990653d59fbd0
2024-10-24 19:31:52 +02:00
Michael Bestas
99ea7632bb
Remove non existent health 2.0 recovery package
Health 2.0 targets have been removed in change
I8e1eb743d978315ae9b5b516d3e2e9dc6151d2c2

Test: m, observe "includes non-existent modules in PRODUCT_PACKAGES"
      error is no longer present.
Change-Id: Idd910dfe7028cf0f39e11451a256807c24063061
2024-10-24 19:31:52 +02:00
Chirayu Desai
a26124d361
Revert "Add DeviceDiagnostics.apk"
This reverts commit 3cff79686f.

Reason: Not present in AOSP

Change-Id: If4a812327bc44d1fba880726b601971cc946147d
2024-10-24 19:31:52 +02:00
Ricky Cheung
0eda3e0123
Correct logic for obtaining the path to full recovery image
Currently, an extra '/vendor' is appended in target_files_dir of
make_recovery_patch.py, which will yield an erroneous path when
attempting to build full recovery image on vendorimage-leas devices:

SYSTEM/vendor/vendor/etc/recovery.img

This patch addresses the issue by removing the extra '/vendor' of
target_files_dir, and add checks for whether the target builds
vendor image in MakeRecoveryPatch() as well. This ensures no
recovery image will be generated with prebuilt vendor.

Signed-off-by: Ricky Cheung <rcheung844@gmail.com>
Change-Id: I2dc6e43537deb606dd01fb090add2595502055c1
2024-10-24 19:31:52 +02:00
Gérard Parat
7713f520fa
releasetools: Make recovery patch use bsdiff exclusively
It seems like switching from minigzip to toybox gzip (bug: 288169261)
makes imgdiff fail in in this way:
* W imgdiff : imgdiff.cpp:1435 Failed to reconstruct target deflate chunk 3 []; treating as normal
* E imgdiff : imgdiff.cpp:1390 Failed to set bonus data

Test: Sign non-AB target files package
Change-Id: I29f1d8f1168347141d80860e8ed02e19b0031447
2024-10-24 19:31:52 +02:00
Yumi Yukimura
f84254ef1b
build: Add phony package to build enforce RRO packages
This allows one to build *__auto_generated_rro_(product|vendor).apk
under $(PRODUCT_OUT)/(product|vendor)/overlay/ without having to
build the full partition image or do full android build.

Change-Id: I0c215ed7968e0cba348d344e00a014470ac37b6e
2024-10-24 19:31:52 +02:00
LuK1337
201b843839
releasetools: Fix fstab path detection when input_file is a path to zip
If _FindAndLoadRecoveryFstab() is called with a path to target files zip
file, then it'll always attempt to read the fallback recovery.fstab
path. By making sure to pass zipfile.ZipFile(), it'll be able to read
the zip file ToC and use the correct path instead.

Test: Generate signed ota package for gts4lv
Change-Id: I4f3b975c677b7928999d0fe4fb137c868d7a206e
2024-10-24 19:31:52 +02:00
Aaron Kling
73d586ad36
Fix unified a/b zip generation failure
If vendor model props are blacklisted, a/b zips fail to generate.
This uses a non-partition specific prop if the partition specific
variant does not exist.

Change-Id: I96f583ceb3ccebee21211b964e2ea66217ffd41f
2024-10-24 19:31:52 +02:00
Michael Bestas
36727b55ff
Replace device_kernel_headers with generated_kernel_headers
Change-Id: I54a969d63f9644f89a231d52f2ef0919edd5b784
2024-10-24 19:31:52 +02:00
Michael Bestas
8aab9617db
envsetup: Set INLINE_KERNEL_BUILDING based on TARGET_NO_KERNEL
Change-Id: I2404adf572bdafb91edc66a19a83a2696004b33f
2024-10-24 19:31:52 +02:00
Chirayu Desai
1c390cd216
Replace old-style kernel headers only when building inline
Change-Id: I71b891928a13771c176adc0eaa79b46503cb176f
2024-10-24 19:30:14 +02:00
LuK1337
28d41a4097
Disable sparse images for A/B updater targets
In past, brillo_update_payload was unsparsing all images before putting
them in payload.bin, now we ought to unsparse them ourselves here.

Change-Id: I69baa71678f8116ed8e256bd629a1af9bad13ba8
2024-10-24 19:29:52 +02:00
LuK1337
14ea1e60c6
Don't remove ANDROID_SECURE_STORAGE_CMD from env vars
We also use it in avbtool.

Change-Id: I4737c1815a031d307f6915a73b5f5b1a37b6baaa
2024-10-24 19:29:45 +02:00
HZ
136394bf16
Add bluetooth to default key map
Previously the key mapping in releasetool/sign_target_files_apks.py
is missing the aforementioned key that was introduced in Android 13,
so it's writing corrupted signatures in plat_mac_permissions.xml.

Test: make target-files-package otatools
sign_target_files_apks -o -d <CERT_ROOT> ...

Change-Id: If42907cffbd500281876f8f822cbb645583d06ed
2024-10-24 19:29:37 +02:00
Chirayu Desai
554a1915a8
Add vendor_kernel_boot files to target-files-package
* This is a required dependency of target-files-package
so that it can be built from a clean build.

Test: rm -rf out/target/product && m target-files-package
Change-Id: I89e60f47e3e2cd6029a92b1aca505acd9cf4645b
2024-10-24 19:29:15 +02:00
Aaron Kling
3c2c75b556
Allow passing makefile path to enforce-product-packages-exist
To allow enforcing at a product level

Change-Id: I75084246be885a163260bed42f2b13e0db388f85
2024-10-24 19:29:11 +02:00
Chris Soyars
56c9b0fb10
releasetools: squash backuptool support
This is a squash of the following commits:

Author: Chris Soyars <ctso@ctso.me>
Date:   Thu Dec 23 00:44:33 2010 +0100
    Add otapackage support for backuptool

    Change-Id: I512554c579d444067cd3ccbb0e6946a5eb6bc964a

    Modular backuptool.sh.  Executes backup and restore methods defined in arbitrary /system/addon.d/*.sh scripts.

    * Copy backuptool.functions alongside backuptool.sh.
    * Delete both from /system/bin as they are not useful there.

    Patch Series
    ============
    http://review.cyanogenmod.com/#change,13265
    CyanogenMod/android_build
      * edify generator
    http://review.cyanogenmod.com/#change,13266
    CyanogenMod/android_system_core
      * permissions on /system/addon.d
    http://review.cyanogenmod.com/#change,13267
    CyanogenMod/android_vendor_cm
      * 50-cm.sh reference backup script
      * modular backuptool.sh
      * support backuptool.functions used by /system/addon.d/*.sh scripts

    Change-Id: I26b4907d28f49c69627699d2accd2f0fa2d1b112

    update ota_from_target_files to handle mounting/unmounting for backupscript

    backupscript should not be mounting/unmounting itself as it makes other
    scripts have unexpected results (such as modelid_cfg, which expects /system
    to be mounted)

    instead have the ota script handle the mounting/unmounting

    Change-Id: I94511f4147c624d975cb3ecbeaa8b0e98f63437c

    build: Don't run backuptool on GMS builds

    Change-Id: I5dde27f9d16b88049171db9805221d92e67f3e5d

Author: Tom Marshall <tdm@cyngn.com>
Date:   Wed Apr 9 16:14:07 2014 -0700
    build: edify: use set_metadata for backuptool

    Also use saner permissions on backuptool.sh

    Change-Id: I50742b51867aa358f5924b8dc208833092a35bd9

Author: Ricardo Cerqueira <ricardo@cyngn.com>
Date:   Wed Nov 5 18:16:43 2014 +0000
    ota: Include copies of the recovery scripts even if shipping in block mode

Author: Ricardo Cerqueira <ricardo@cyngn.com>
Date:   Wed Nov 5 19:58:59 2014 +0000
    ota: Fix recovery-script cleanups in block mode

    Change-Id: Iadb480f8062cfb7a0e6c9024e32ac0d71a7481d7

Author: Arian <arian.kulmer@web.de>
Date:   Wed Jun 17 12:35:16 2020 +0200
    build: Disable backuptool on user instead of GMS builds

    * Backuptool is not exclusively used for GApps but
      also used by other things (i.e. Magisk), hence
      it shouldn't be disabled on all GMS builds.

    Change-Id: Ia95c6fed21d7bed5e2e0610aa94264edc1d02c80

Author: Davide Garberi <dade.garberi@gmail.com>
Date:   Tue Sep 24 18:45:17 2019 +0200
    releasetools: Move system mount handling to backuptool

    * This allows the ROM to be flashed on any recovery, whether it mounts
      system to /system, /system_root or /mnt/system like Q recovery

    * Remove any type of system mount with static paths from updater-script
      to figure out the path dinamically through backuptool

    Change-Id: I7b33726305cb6f3eec146d26135f0081002a25dc

Author: Jesse Chan <jc@lineageos.org>
Date:   Fri Jun 12 21:53:18 2020 +0800
    releasetools: support dynamic partitions for backuptool

    Change-Id: I4a04e52f64e307a9852d786aabf17975a020b4b8
    Signed-off-by: Jesse Chan <jc@lineageos.org>

Author: Jesse Chan <jc@lineageos.org>
Date:   Tue Jul 7 23:50:10 2020 +0800

    backuptool: do not unmap dynamic partition after finished

    Keep partitions mapped so users can install addons.

    Change-Id: Ic70621986bf136775e686dc8cc690ce076485907
    Signed-off-by: Jesse Chan <jc@lineageos.org>

Author: Alessandro Astone <ales.astone@gmail.com>
Date:   Mon Apr 12 18:40:10 2021 +0200

    backuptool: Map extra dynamic partitions for Addon.d V3

    Change-Id: Ia8fa1963c722c5aa2987b947e4e919e19909a9a8

Change-Id: I2401d334d8e16d18d3770b339ec2c787dd8e477c
2024-10-24 19:28:59 +02:00
Tom Marshall
3ac02eee13
build: ota: Support for install tools in /tmp/install
* Anything in OUT/install gets packaged up into the zip and extracted
   to /tmp/install immediately after FullOTA_InstallBegin.

 * Use /tmp/install in edify scripts and remove code related to using
   and manipulating /system for install tools.

 * Modified to support signing steps being split from build steps.

   Package install files into target-files INSTALL path
   Read from target-files for OTA package creation

   From Change-Id: I64f919c2a757b5474f6cc5f82bd6c33c2a8b558a

 * This also fully reverts commit 6a324ba and partially reverts
   commit f388104 as the functions are still needed here.

   From Change-Ids: I4911244ec9945d197d2b56d0d11eab6d2f7b6d3e
                    I4943e2e89ee5c810a63746c570dc5e31e95b8c53

Squashed with the following:

Author: LuK1337 <priv.luk@gmail.com>
Date:   Wed Feb 19 02:14:59 2020 +0100
    releasetools: Use 0oXXX instead of 0XXX for octal

    * Fixes py3 syntax error.

    Change-Id: Ia9ca6e392f43694ddf4c952b07bf159e8dead36e

Author: LuK1337 <priv.luk@gmail.com>
Date:   Fri Nov 13 15:27:24 2020 +0100
    Add $(PRODUCT_OUT)/install to INTERNAL_RECOVERYIMAGE_FILES

    * Fixes $(PRODUCT_OUT)/install not being included on targets
      not providing their own /vendor || /system/vendor.

    Change-Id: I15b8305bb7efacfcf3018708bf7ff8b8500744fb

Change-Id: I315a3238e36c8d15e26f935e272f7e27dd59c320
2024-10-24 19:28:26 +02:00
Aaron Kling
2fa06c1c39
Disable Traceur for non eng-builds
Change-Id: I9cc1d747dc70bcf89486009f7ecae1628ccfc0aa
2024-10-24 19:28:26 +02:00
LuK1337
82d9f1507a
releasetools: Unconditionally store recovery.img in non-A/B OTA
Change-Id: Ib5c9f2f0fa90fd921d8f61b74364a20aaecb842e
2024-10-24 19:28:26 +02:00
Aaron Kling
6ee8d10147
releasetools: Fallback to calculated fp if partition fp is missing
This happens when the fingerprint property is blacklisted for the
purposes of unified device builds.

Change-Id: I9f8a5041248c3f73fce7a16da73cb8f68c06c8e2
2024-10-24 19:28:26 +02:00
lambdadroid
8b69c4d0a0
build: Respect fs_config when generating recovery ramdisk
Without the -d $(TARGET_OUT) option for mkbootfs, only the
compiled-in fs_config (from AOSP) is used for the generated
ramdisk image. Device-specific additions are ignored.

This is why AOSP sets this option for both the boot- and recovery
ramdisk [1]. However, the option was removed for the recovery ramdisk
in review.lineageos.org/c/LineageOS/android_build/+/222722

This causes device-specific fs_config additions to be ignored when
generating the recovery ramdisk, potentially setting the wrong
permissions.

[1]: android.googlesource.com/platform/build/+/refs/tags/android-9.0.0_r37/core/Makefile#1388

Change-Id: I0f77a49d8b2f08791e60b34ddbb6f3b32bc2f0bc
2024-10-24 19:28:26 +02:00
marcost2
453fe9d9a0
Add support for separate kernels for boot and recovery [2/2]
* Either as prebuilts, or with separate defconfigs

Change-Id: Iae31e3634178e66b4119c718994fe1c660414529
2024-10-24 19:28:26 +02:00
Quallenauge
ef7318daaf
soong: Add ability to build scudo-free 32-bit libc variant.
Targets can switch on this feature by setting
MALLOC_SVELTE_FOR_LIBC32 := true

The default is to build libc32 with scudo enabled.

Change-Id: I207659af05412a8e7dc850d57b491ee565554a65
2024-10-24 19:28:26 +02:00
David Ng
2131227516
build: Add support for device tree in boot.img
Add support for optional device tree image (dt.img)
to boot and recovery images.  Some devices use kernel device
tree and this adds the device tree image as a section within
the boot/recovery images.

Change-Id: I91431ef2f4b86485895678916e39a8572be878eb

Build: add DT image variable to Makefile

DT image variable is currently present in
generate_extra_images.mk.This file is moved to
build/tasks to support persist image generation
during parallel make. As build/tasks is called
at the end of Makefile, DT image variable is not
available for other images generation like boot and
recovery. Adding this variable in Makefile ensures
the variable is defined before usage

Change-Id: I21f675d8ce648dc1cf1f4f3aede33278300e08c9
CRs-fixed: 548299

Fix case where boot/recovery.img were being built with wrong params.

The boot and recovery images  now get built using the same params during ota package
generation as during a normal build.

Change-Id: I93d46e11a4245288f0e87c87a2e4bf45ac5aff69

Fix the extra dt.img compilation issue.

Add support for optional device tree image (dt.img)
for device that doesnt have TARGET_BOOTIMAGE_USE_EXT2

Change-Id: I6e07b3ca6d049a8ebdad7ea304b4f39e7c846151

releasetools: Store and use the dt image file through target files

Target files packages may be used for signing images separate from the
build process. Store the device tree image file in the target files
package so it can be used during the signing process.

Change-Id: Ie8507121fa9c4ba57ecffeab05bd859ae5f5b788
2024-10-24 19:28:26 +02:00
Ricardo Cerqueira
9b1095722e
Add BOARD_CUSTOM_BOOTIMG_MK support
This is a combination of 2 commits.
This is the 1st commit message:

    Add BOARD_CUSTOM_BOOTIMG_MK support

    Simplified version of the previous implementation. Recovery's ramdisk
    is spun off from the main recovery target again to allow overriding
    just the image-generation step

    [mikeioannina]: Squash cm-13.0 changes and adapt to N

    Change-Id: I058d214f0cf2d05b7621b369ef1f8a983c3ac258

This is the commit message #2:

    build: Handle custom boot images properly

    When a pre-built image should be used, it should be stored in the
    target files zip so that it can be used with external signing
    processes.

    Original-Change-Id: I2661af9ac58af30bb9314b552775046d3abf44e0
    Change-Id: I10b3bd0bb33489b8ffb26d16d002f8dd6ff405ad

[aleasto]
  Rewritten for R, where the recovery ramdisk is created via
  make dependencies, rather than $(call)s

[mainey]
  Adapt to new flag INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP

Change-Id: I058d214f0cf2d05b7621b369ef1f8a983c3ac258
2024-10-24 19:28:26 +02:00
Ricardo Cerqueira
3329a204d2
build: Squash of allowing a device to generically define its own headers
Author: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
Date:   2011-04-12 10:57:22 +0100
    Allow a device to generically define its own headers

    We have a few cases of devices including specific versions of projects
    just because of modified headers (msm_mdp.h comes to mind), and I just
    had enough of ifdeffing header files for specific cases (the P990 needs
    a lot of these).
    Now... if a target defines a TARGET_SPECIFIC_HEADER_PATH, any headers in
    there will take precedence over the standard ones; for example, on the
    p990, I have

    TARGET_SPECIFIC_HEADER_PATH := device/lge/p990/include

    which makes, for example, the
    device/lge/p990/include/hardware_legacy/AudioHardwareInterface.h be
    used instead of
    hardware/libhardware_legacy/include/hardware_legacy/AudioHardwareInterface.h
    whenever a source file uses <hardware_legacy/AudioHardwareInterface.h>

    Change-Id: I41b62668b60e3f62a6ebd3738d8d2675103a81e6a

    build: fix target header overlay

    LOCAL_C_INCLUDES as defined by the makefile should be put AFTER
    the overlay includes so the overlay always takes precedence.

    Change-Id: I489b2aab6dbacd9122d834f85e07b63ed1271f07

Author: Jan Altensen <info@stricted.net>
Date:   2020-09-10 15:18:49 +0200
    soong: add TARGET_SPECIFIC_HEADER_PATH

    Change-Id: I582ae8e6e010016b33fd9b020b723e5fc2dc442b

Change-Id: I3c885fe504ce4f646001697119cffd674db9ec49
2024-10-24 19:28:26 +02:00
Luca Stefani
94b75b4429
Add build support for XZ ramdisks
Co-authored-by: Arne Coucheron <arco68@gmail.com>
Change-Id: I61530b6da06e0038970551aa4d12bce02007ae3c
2024-10-24 19:28:26 +02:00
Arne Coucheron
fe27b5e0ed
Fix recovery image generation with LZ4 compressed ramdisk
Change-Id: I37e360de4a8273636877b4d541c597a6376a16cb
2024-10-24 19:28:26 +02:00
Tom Powell
bc0ef30e0e
releasetools: support reading release keys out of some sort of command
key passphrases may live in some sort of secure storage, support running
an arbitrary command to retrieve them.

Change-Id: I49862cf60f1b73a2356e0c492e1038beef28a95f
(cherry picked from commit 9caf8603575aecf51761feaeac6db619be76cfd3)
2024-10-24 19:27:38 +02:00
Peter Cai
44112727ed
releasetools: do not remove dynamic partitions in system-only builds
* Before this commit, the generated `dynamic_partitions_op_list` in
  FullOTA packages always tries to remove all partitions and recreate
  them upon flashing. This makes it impossible to have a system-only
  "FullOTA" because vendor partition(s) are always removed.

* This commit detects if a build is vendor-less and disables every
  dynamic partition operation except `resize`, in order to keep the
  original content around after the flash. The change should not affect
  non-dynamic-partition or builds with vendor image included.

Change-Id: I0cded7f3b2958f35103d73d19b7fb5f292f6c17f
Signed-off-by: Jesse Chan <jc@lineageos.org>
2024-10-24 19:27:38 +02:00
LuK1337
e7ee416ff9
Unset BOARD_EXT4_SHARE_DUP_BLOCKS
* This allows us to remount ext4 partitions read-write
  on devices with dynamic partitions.

This reverts the following commits:

Revert "Move BOARD_EXT4_SHARE_DUP_BLOCKS to BoardConfigMainlineCommon.mk"

This reverts commit I0eb035ba6edf44719d5de4f09fd97b5783537597.

Revert "enable BOARD_EXT4_SHARE_DUP_BLOCKS for generic_arm64"

This reverts commit 125b6d6eea.

Change-Id: I3768374d6da59f969ea44c1965f75c934edf3b57
2024-10-24 19:27:38 +02:00
Christian Oder
d76725c913
build_image: Allow disabling custom inode count calculation
This allows us to skip custom inode count calculation by setting
BOARD_*IMAGE_EXTFS_INODE_COUNT to -1, this will end up letting
mke2fs calculate appropriate inode count on its own.

While build_image only allocates exact number of needed inodes
plus 4% spare with .2% margin, mke2fs will allocate as many
inodes as it thinks is appropriate given the filesystem size.

Change-Id: If03d5edae8378be3b305346176067b01163f6f3d
2024-10-24 19:27:38 +02:00
Alessandro Astone
30f779c15b
Remove unused locale data for recovery
AOSP wants to show localized menus for rescue party and
format data. To achieve that, they produce at compile time a big
PNG file with rows of localized text. The runtime would then pick
the correct row to draw.

In order to customize our recovery UI we cannot draw pregenerated
text. Avoid generating these files to shrink recovery size.
(Saving 2.3MB on xxhdpi!)

Change-Id: Id38d239254f17eeed5491621865c747a8496ed83
2024-10-24 19:27:38 +02:00
Brint E. Kriebel
c161964bde
releasetools: Use the first entry of a mount point when reading fstab
There may be multiple entries in fstab for a mount point. Use the first
value found so the entries are prioritized in order.

Change-Id: Ibd2631413d3e00507d3a0ec84fb91755f1c7993c
Ticket: OPO-326
2024-10-24 19:27:38 +02:00
Matt Mower
8ba776d32f
Edify: Add abort message for bootloader asserts
* If a bootloader assert is not satisfied, print the
  versions that are supported by the package as well as the version
  on the device.

Change-Id: I958d49281c51bd4e60d596a727bb94cfc4a21909
2024-10-24 19:27:38 +02:00
Andrew Dodd
f0509ac9bd
ota: Disable downgrade check
We want users to be able to downgrade their packages.

Change-Id: I6bcbd4ee2a02640fe0855b0f1f197a02e914c927
2024-10-24 19:27:23 +02:00
Michael Bestas
cff3412a4e
Add blank_unblank_on_init to PRIVATE_RECOVERY_UI_PROPERTIES
...in order for it to end up in recovery properties.

Required after 139c727036

Change-Id: Ibc13eeaabbd24f04b1cea103281d6d98f7956729
2024-10-24 19:27:21 +02:00
Chirayu Desai
e7e735832d
Allow setting the recovery density separately from the aapt config
Change-Id: I817a4c01302956ec846503d9a585c43e690e45bf
2024-10-24 19:27:10 +02:00
Matt Mower
85dc11c468
build: Separate commands in recovery foreach loops
The foreach loops output a space separated list, not necessarily one
command per line. Separate commands with semicolons. Notably, this
fixes an issue with multiple device directories included in
TARGET_RECOVERY_DEVICE_DIRS.

Change-Id: I5ebdc84ecaaacabaea77b8b752141e2041622480
2024-10-24 19:27:04 +02:00
Tom Marshall
40cfceed2a
build: recovery: Support adding device-specific items
Change-Id: I25205e68282680932917016646dabd1abadbfce6
2024-10-24 19:26:42 +02:00
M1cha
82633d9de8
releasetools: ota_from_target_files: add FullOTA_PostValidate
Change-Id: I152412049f90fd546d4516cc064238c3192be553
2024-10-24 19:26:30 +02:00
TheScarastic
21f38c6d8e
Don't make recovery patch for devices with prebuilt vendor
Change-Id: I05c0155e6331bfeccd4ad545e003fa3fa3498044
2024-10-24 19:26:02 +02:00
dianlujitao
dfcb38a988
Move recovery-from-boot.p from /system to /vendor
The file was missed when moving recovery resources, but the assertion
path was changed, as a result non-Treble devices failed to build.

Fixes: Ia4045bd67ffb3d899efa8d20dab4c4299b87ee5f
Change-Id: Ib7822a9bd5b1a2ab7e762e9fb35dbb22291a3a76
2024-10-24 19:25:58 +02:00
Steve Kondik
0da100cff3
Allow override of device asserts, including multi-device support.
Set in board file with TARGET_OTA_ASSERT_DEVICE.
(cherry-picked from commit 0f452f21fc9323b9d1fe746161761cf40aaa5030)

Change-Id: I3d06bdc0e3e26bde0c0e646accd050364f9713b9

ota_from_target_files: Remove device dependent arguments

These device-specific arguments are defined at build time and are
necessary to generate the zip correctly. Don't use command line
arguments to specify them, but write all the needed information
in misc_info.txt when the target-files zip is generated.
ota_from_target_files will then read misc_info.txt and set
everything automatically.

Change-Id: Ibdbca575b76eb07b53fccfcea52a351c7e333f91
Signed-off-by: André Pinela <sheffzor@gmail.com>
2024-10-24 19:25:44 +02:00
Rashed Abdel-Tawab
a6a4d684dc
build: Automatically replace old-style kernel header includes with new header lib
This is a combination of 3 commits.
This is the 1st commit message:

build: add kernel header dependency if module uses kernel headers

Many of the QCOM components use kernel headers, but don't declare
the dependency on them.  This is fine in CAF because of the way they
build the boot.img before anything else.  In CM, we don't build the
boot.img the same, so we run into a race between the kernel build &
these modules... and the modules lose.

Warn about modules that have this missing dependency, and add it for
them so we don't have to modify each Android.mk.

Change-Id: I95f1e47b5ef440f6f5d8f64a0c3f38d9572e839e

============================================================================
This is the commit message #2:

build: Switch kernel header inclusion

The build is switching to the target INSTALLED_KERNEL_HEADERS to
declare dependencies on kernel headers.

Change-Id: I913e74681b02dfcf1eaed3d1e47ff4ab2300b12d

============================================================================
This is the commit message #3:

build: Automatically replace old-style kernel header includes with new header lib

Since we do this via soong and the result is a header library, just replace all
legacy include paths that point to the old header location with calls to the new
header library. Since we no longer have the legacy include, we can also remove
the additional dependency.

This reverts commit fa798218e5b7f96e12ab3acc9d47a3f26a140777.

Change-Id: I716955534e50831e6568ca01e480aa8b90075d92
2024-10-24 19:25:32 +02:00
dianlujitao
3bafdb4dd6
Add extra variables to _readonly_late_variables
These are modified by us at a later stage, so be sure
to allow it.

Change-Id: Ib26e83e10aeb6c107fd6e5757185c05cd6665760
2024-10-24 19:25:22 +02:00
Luca Stefani
a47c7368d7
build: Add tequila build support
Squashed also with the following changes:

  Author: Luca Stefani <luca020400@lineageos.org>
  Date:   Thu Aug 17 22:22:13 2017 +0200

    core: Include Lineage pathmap

  Change-Id: Ie25dee383cc5bc9bb6390cff2cb2460d526d80b6

  Author: Simon Shields <simon@lineageos.org>
  Date:   Fri Mar 2 12:55:47 2018 +1100

    build: unconditionally use lineage pathmap

    even if we're not building a lineage target, we need to
    use the lineage pathmap to make things like recovery and ril
    happy

  Change-Id: I974c30ad10d4ff5b7805c3df9c22010f1e002bf1

  Author: Luca Stefani <luca.stefani.ge1@gmail.com>
  Date:   Tue Jan 22 15:50:52 2019 +0100

    Don't export BUILD_NUMBER in envsetup

    * The value is meant to be set only before running an /official/ build
    * This allows us to execute consecutive make commands without
      running kati for every invocation

  Change-Id: Ifa94b839f30c7260009c8a3c91c202b50e28022e

  Author: Luca Stefani <luca020400@lineageos.org>
  Date:   Fri Aug 18 10:17:00 2017 +0200

    envsetup: Call fixup_common_out_dir

  Change-Id: I84e16b0df5822cfd8514c46d709109a13c20f86e

  Author: Adrian DC <radian.dc@gmail.com>
  Date:   Sat May 12 11:24:33 2018 +0200

    build: Include LineageOS specific properties in build.prop

     * Our properties were supposed to go to /system/etc/prop.default
        after the following commit:
        "lineage: Move to Google's method of defining system default props"
        Change-Id: I6cb0e28a7599b010b389cc541015a37010a00f4b

     * However if BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED is not true,
        only /default.prop will retain the properties contents of
        ADDITIONAL_DEFAULT_PROPERTIES and PRODUCT_SYSTEM_DEFAULT_PROPERTIES,
        and none of our versioning identification was held in the system

     * Enabling BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED globally would
        break all properties on devices that handle partitions usually
        at the device level rather than the kernel due to mounting races

     * Include the vendor/lineage/config/main.mk entrypoint to be allowed
        to extend ADDITION_BUILD_PROPERTIES as we need to define our releases

  Change-Id: I19918eece0f0dd3ee967db0339b4d09c9a6d540e
  Signed-off-by: Adrian DC <radian.dc@gmail.com>

  Author: Rashed Abdel-Tawab <rashed@linux.com>
  Date:   Thu Sep 5 21:35:38 2019 -0700

    core: Only include Lineage SE policy if repo exists

  Change-Id: If799106d2da6d8c303430e316edff365a22f7c99

  Author: dianlujitao <dianlujitao@lineageos.org>
  Date:   Thu Sep 5 21:56:36 2019 +0800

    product: Exclude AOSP apn list on Lineage build

    Change-Id: I1fd10089421a2e4b57ef565d87ad1f6036bd1898

  Author: Michael Bestas <mkbestas@lineageos.org>
  Date:   Fri Apr 12 02:10:12 2019 +0300

    build: Conditionally include AudioPackage14.mk instead of AllAudio.mk

    * AllAudio.mk doesn't contain latest material files and also
      contains multiple duplicate files. Just copy the latest
      material ones and we'll include the older files in vendor/lineage

    Change-Id: Ic7353216a3f3dc3c51006d951ac932cfd6e5f3b5

  Author: dhacker29 <dhackerdvm@gmail.com>
  Date:   Sat Jun 6 22:22:05 2015 -0400

    Remove LatinIME as it is included per target in vendor/lineage

    Change-Id: Ibce4a244ec0653a7c7798d864047ac667866a1dc

  Author: razorloves <razorloves@gmail.com>
  Date:   Mon Oct 7 05:10:56 2019 -0500

    build: Remove su inclusion

    This stops including su in all lineage userdebug/eng builds.
    Inclusion of su is conditionally handled in /vendor/lineage.

    Change-Id: Ia3ad978146f170a2b260d77afe9eb580d4b4f823

  Author: Michael Bestas <mkbestas@lineageos.org>
  Date:   Sat Nov 7 22:45:12 2020 +0200

    Stop including vendor specific clear_vars.mk

    vendor/lineage/build/core/clear_vars.mk is no-op since 16.0

    Change-Id: I7e159cc9ed5a838c9a04c1a8b7dcf925d83f0e20

Change-Id: Iab8b2ef8b644a7bea10bfd28b99d9e69539b1357
2024-10-24 19:25:10 +02:00
Chirayu Desai
a3a2ca917a
No more spam
Change-Id: If570268c50eabcbfa357918b1266855f83119233
2024-10-24 19:22:05 +02:00
Michael Bestas
fb9cae1e23
Source tequila specific envsetup
Change-Id: I39d3e711a6beab47e3284919a9a4fef15b0f40b9
2024-10-24 19:21:33 +02:00
Chirayu Desai
7fc166ebd7
envsetup: export ANDROID_BUILD_TOP earlier
Change-Id: Ia3497f61f4e9aaeeb793cecd3b4f488f0a48181a
2024-10-24 19:21:00 +02:00
34 changed files with 649 additions and 483 deletions

View file

@ -1021,6 +1021,17 @@ else
INSTALLED_KERNEL_TARGET := INSTALLED_KERNEL_TARGET :=
endif endif
ifdef INSTALLED_KERNEL_TARGET
ifneq (,$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)))
INSTALLED_RECOVERY_KERNEL_TARGET := $(INSTALLED_KERNEL_TARGET)
else ifneq (true,$(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE))
ifneq "$(or $(TARGET_KERNEL_RECOVERY_CONFIG), $(TARGET_PREBUILT_RECOVERY_KERNEL))" ""
INSTALLED_RECOVERY_KERNEL_TARGET := $(PRODUCT_OUT)/recovery_kernel
else
INSTALLED_RECOVERY_KERNEL_TARGET := $(firstword $(INSTALLED_KERNEL_TARGET))
endif
endif
endif
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# the root dir # the root dir
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_ROOT_OUT)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES)) INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_ROOT_OUT)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
@ -1197,6 +1208,10 @@ ifeq ($(BOARD_RAMDISK_USE_LZ4),true)
COMPRESSION_COMMAND_DEPS := $(LZ4) COMPRESSION_COMMAND_DEPS := $(LZ4)
COMPRESSION_COMMAND := $(LZ4) -l -12 --favor-decSpeed COMPRESSION_COMMAND := $(LZ4) -l -12 --favor-decSpeed
RAMDISK_EXT := .lz4 RAMDISK_EXT := .lz4
else ifeq ($(BOARD_RAMDISK_USE_XZ),true)
COMPRESSION_COMMAND_DEPS := $(XZ)
COMPRESSION_COMMAND := $(XZ) -f -c --check=crc32 --lzma2=dict=32MiB
RAMDISK_EXT := .xz
else else
COMPRESSION_COMMAND_DEPS := $(GZIP) COMPRESSION_COMMAND_DEPS := $(GZIP)
COMPRESSION_COMMAND := $(GZIP) COMPRESSION_COMMAND := $(GZIP)
@ -1343,10 +1358,18 @@ INTERNAL_MKBOOTIMG_VERSION_ARGS := \
--os_version $(PLATFORM_VERSION_LAST_STABLE) \ --os_version $(PLATFORM_VERSION_LAST_STABLE) \
--os_patch_level $(PLATFORM_SECURITY_PATCH) --os_patch_level $(PLATFORM_SECURITY_PATCH)
ifeq ($(strip $(BOARD_KERNEL_SEPARATED_DT)),true)
INSTALLED_DTIMAGE_TARGET := $(PRODUCT_OUT)/dt.img
INTERNAL_BOOTIMAGE_ARGS += --dt $(INSTALLED_DTIMAGE_TARGET)
BOOTIMAGE_EXTRA_DEPS := $(INSTALLED_DTIMAGE_TARGET)
endif
# Define these only if we are building boot # Define these only if we are building boot
ifdef BUILDING_BOOT_IMAGE ifdef BUILDING_BOOT_IMAGE
INSTALLED_BOOTIMAGE_TARGET := $(BUILT_BOOTIMAGE_TARGET) INSTALLED_BOOTIMAGE_TARGET := $(BUILT_BOOTIMAGE_TARGET)
ifndef BOARD_CUSTOM_BOOTIMG_MK
ifeq ($(TARGET_BOOTIMAGE_USE_EXT2),true) ifeq ($(TARGET_BOOTIMAGE_USE_EXT2),true)
$(error TARGET_BOOTIMAGE_USE_EXT2 is not supported anymore) $(error TARGET_BOOTIMAGE_USE_EXT2 is not supported anymore)
endif # TARGET_BOOTIMAGE_USE_EXT2 endif # TARGET_BOOTIMAGE_USE_EXT2
@ -1361,7 +1384,7 @@ define build_boot_board_avb_enabled
$(call build_boot_from_kernel_avb_enabled,$(1),$(kernel)) $(call build_boot_from_kernel_avb_enabled,$(1),$(kernel))
endef endef
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(AVBTOOL) $(INTERNAL_BOOTIMAGE_FILES) $(BOARD_AVB_BOOT_KEY_PATH) $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(AVBTOOL) $(INTERNAL_BOOTIMAGE_FILES) $(BOARD_AVB_BOOT_KEY_PATH) $(BOOTIMAGE_EXTRA_DEPS)
$(call pretty,"Target boot image: $@") $(call pretty,"Target boot image: $@")
$(call build_boot_board_avb_enabled,$@) $(call build_boot_board_avb_enabled,$@)
@ -1384,7 +1407,7 @@ define build_boot_supports_vboot
$(call assert-max-image-size,$(1),$(call get-bootimage-partition-size,$(1),boot)) $(call assert-max-image-size,$(1),$(call get-bootimage-partition-size,$(1),boot))
endef endef
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(VBOOT_SIGNER) $(FUTILITY) $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(VBOOT_SIGNER) $(FUTILITY) $(BOOTIMAGE_EXTRA_DEPS)
$(call pretty,"Target boot image: $@") $(call pretty,"Target boot image: $@")
$(call build_boot_supports_vboot,$@) $(call build_boot_supports_vboot,$@)
@ -1406,7 +1429,7 @@ define build_boot_novboot
$(call assert-max-image-size,$1,$(call get-bootimage-partition-size,$(1),boot)) $(call assert-max-image-size,$1,$(call get-bootimage-partition-size,$(1),boot))
endef endef
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(BOOTIMAGE_EXTRA_DEPS)
$(call pretty,"Target boot image: $@") $(call pretty,"Target boot image: $@")
$(call build_boot_novboot,$@) $(call build_boot_novboot,$@)
@ -1421,6 +1444,7 @@ bootimage-nodeps: $(MKBOOTIMG)
$(foreach b,$(INSTALLED_BOOTIMAGE_TARGET),$(call build_boot_novboot,$(b))) $(foreach b,$(INSTALLED_BOOTIMAGE_TARGET),$(call build_boot_novboot,$(b)))
endif # BOARD_AVB_ENABLE endif # BOARD_AVB_ENABLE
endif # BOARD_CUSTOM_BOOTIMG_MK not defined
endif # BUILDING_BOOT_IMAGE endif # BUILDING_BOOT_IMAGE
else # TARGET_NO_KERNEL == "true" else # TARGET_NO_KERNEL == "true"
@ -2371,6 +2395,8 @@ ifdef BUILDING_RECOVERY_IMAGE
INTERNAL_RECOVERYIMAGE_FILES := $(filter $(TARGET_RECOVERY_OUT)/%, \ INTERNAL_RECOVERYIMAGE_FILES := $(filter $(TARGET_RECOVERY_OUT)/%, \
$(ALL_DEFAULT_INSTALLED_MODULES)) $(ALL_DEFAULT_INSTALLED_MODULES))
INTERNAL_RECOVERYIMAGE_FILES += $(filter $(PRODUCT_OUT)/install/%, \
$(ALL_DEFAULT_INSTALLED_MODULES))
INSTALLED_FILES_FILE_RECOVERY := $(PRODUCT_OUT)/installed-files-recovery.txt INSTALLED_FILES_FILE_RECOVERY := $(PRODUCT_OUT)/installed-files-recovery.txt
INSTALLED_FILES_JSON_RECOVERY := $(INSTALLED_FILES_FILE_RECOVERY:.txt=.json) INSTALLED_FILES_JSON_RECOVERY := $(INSTALLED_FILES_FILE_RECOVERY:.txt=.json)
@ -2419,10 +2445,14 @@ IGNORE_RECOVERY_SEPOLICY := $(patsubst $(TARGET_RECOVERY_OUT)/%,--exclude=/%,$(r
# if building multiple boot images from multiple kernels, use the first kernel listed # if building multiple boot images from multiple kernels, use the first kernel listed
# for the recovery image # for the recovery image
recovery_kernel := $(firstword $(INSTALLED_KERNEL_TARGET)) recovery_kernel := $(INSTALLED_RECOVERY_KERNEL_TARGET)
recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img
recovery_uncompressed_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.cpio
recovery_resources_common := bootable/recovery/res recovery_resources_common := bootable/recovery/res
ifneq (,$(TARGET_RECOVERY_DENSITY))
recovery_density := $(filter %dpi,$(TARGET_RECOVERY_DENSITY))
else
# Set recovery_density to a density bucket based on TARGET_SCREEN_DENSITY, PRODUCT_AAPT_PREF_CONFIG, # Set recovery_density to a density bucket based on TARGET_SCREEN_DENSITY, PRODUCT_AAPT_PREF_CONFIG,
# or mdpi, in order of preference. We support both specific buckets (e.g. xdpi) and numbers, # or mdpi, in order of preference. We support both specific buckets (e.g. xdpi) and numbers,
# which get remapped to a bucket. # which get remapped to a bucket.
@ -2438,6 +2468,7 @@ recovery_density := $(strip \
$(if $(filter $(shell echo $$(($(recovery_density_value) >= 280))),1),xhdpi),\ $(if $(filter $(shell echo $$(($(recovery_density_value) >= 280))),1),xhdpi),\
$(if $(filter $(shell echo $$(($(recovery_density_value) >= 200))),1),hdpi,mdpi))) $(if $(filter $(shell echo $$(($(recovery_density_value) >= 200))),1),hdpi,mdpi)))
endif endif
endif
ifneq (,$(wildcard $(recovery_resources_common)-$(recovery_density))) ifneq (,$(wildcard $(recovery_resources_common)-$(recovery_density)))
recovery_resources_common := $(recovery_resources_common)-$(recovery_density) recovery_resources_common := $(recovery_resources_common)-$(recovery_density)
@ -2481,23 +2512,12 @@ RECOVERY_ERASING_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/erasing_te
RECOVERY_ERROR_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/error_text.png RECOVERY_ERROR_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/error_text.png
RECOVERY_NO_COMMAND_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/no_command_text.png RECOVERY_NO_COMMAND_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/no_command_text.png
RECOVERY_CANCEL_WIPE_DATA_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/cancel_wipe_data_text.png
RECOVERY_FACTORY_DATA_RESET_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/factory_data_reset_text.png
RECOVERY_TRY_AGAIN_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/try_again_text.png
RECOVERY_WIPE_DATA_CONFIRMATION_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/wipe_data_confirmation_text.png
RECOVERY_WIPE_DATA_MENU_HEADER_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/wipe_data_menu_header_text.png
generated_recovery_text_files := \ generated_recovery_text_files := \
$(RECOVERY_INSTALLING_TEXT_FILE) \ $(RECOVERY_INSTALLING_TEXT_FILE) \
$(RECOVERY_INSTALLING_SECURITY_TEXT_FILE) \ $(RECOVERY_INSTALLING_SECURITY_TEXT_FILE) \
$(RECOVERY_ERASING_TEXT_FILE) \ $(RECOVERY_ERASING_TEXT_FILE) \
$(RECOVERY_ERROR_TEXT_FILE) \ $(RECOVERY_ERROR_TEXT_FILE) \
$(RECOVERY_NO_COMMAND_TEXT_FILE) \ $(RECOVERY_NO_COMMAND_TEXT_FILE) \
$(RECOVERY_CANCEL_WIPE_DATA_TEXT_FILE) \
$(RECOVERY_FACTORY_DATA_RESET_TEXT_FILE) \
$(RECOVERY_TRY_AGAIN_TEXT_FILE) \
$(RECOVERY_WIPE_DATA_CONFIRMATION_TEXT_FILE) \
$(RECOVERY_WIPE_DATA_MENU_HEADER_TEXT_FILE)
resource_dir := bootable/recovery/tools/recovery_l10n/res/ resource_dir := bootable/recovery/tools/recovery_l10n/res/
resource_dir_deps := $(sort $(shell find $(resource_dir) -name *.xml -not -name .*)) resource_dir_deps := $(sort $(shell find $(resource_dir) -name *.xml -not -name .*))
@ -2515,12 +2535,6 @@ $(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_RECOVERY_BACKGROUND_TEXT_LIST := \
recovery_erasing \ recovery_erasing \
recovery_error \ recovery_error \
recovery_no_command recovery_no_command
$(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_RECOVERY_WIPE_DATA_TEXT_LIST := \
recovery_cancel_wipe_data \
recovery_factory_data_reset \
recovery_try_again \
recovery_wipe_data_menu_header \
recovery_wipe_data_confirmation
$(RECOVERY_INSTALLING_TEXT_FILE): .KATI_IMPLICIT_OUTPUTS := $(filter-out $(RECOVERY_INSTALLING_TEXT_FILE),$(generated_recovery_text_files)) $(RECOVERY_INSTALLING_TEXT_FILE): .KATI_IMPLICIT_OUTPUTS := $(filter-out $(RECOVERY_INSTALLING_TEXT_FILE),$(generated_recovery_text_files))
$(RECOVERY_INSTALLING_TEXT_FILE): $(image_generator_jar) $(resource_dir_deps) $(recovery_noto-fonts_dep) $(recovery_roboto-fonts_dep) $(zopflipng) $(RECOVERY_INSTALLING_TEXT_FILE): $(image_generator_jar) $(resource_dir_deps) $(recovery_noto-fonts_dep) $(recovery_roboto-fonts_dep) $(zopflipng)
# Prepares the font directory. # Prepares the font directory.
@ -2529,7 +2543,7 @@ $(RECOVERY_INSTALLING_TEXT_FILE): $(image_generator_jar) $(resource_dir_deps) $(
$(foreach filename,$(PRIVATE_SOURCE_FONTS), cp $(filename) $(PRIVATE_RECOVERY_FONT_FILES_DIR) &&) true $(foreach filename,$(PRIVATE_SOURCE_FONTS), cp $(filename) $(PRIVATE_RECOVERY_FONT_FILES_DIR) &&) true
@rm -rf $(dir $@) @rm -rf $(dir $@)
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
$(foreach text_name,$(PRIVATE_RECOVERY_BACKGROUND_TEXT_LIST) $(PRIVATE_RECOVERY_WIPE_DATA_TEXT_LIST), \ $(foreach text_name,$(PRIVATE_RECOVERY_BACKGROUND_TEXT_LIST), \
$(eval output_file := $(dir $@)/$(patsubst recovery_%,%_text.png,$(text_name))) \ $(eval output_file := $(dir $@)/$(patsubst recovery_%,%_text.png,$(text_name))) \
$(eval center_alignment := $(if $(filter $(text_name),$(PRIVATE_RECOVERY_BACKGROUND_TEXT_LIST)), --center_alignment)) \ $(eval center_alignment := $(if $(filter $(text_name),$(PRIVATE_RECOVERY_BACKGROUND_TEXT_LIST)), --center_alignment)) \
java -jar $(PRIVATE_IMAGE_GENERATOR_JAR) \ java -jar $(PRIVATE_IMAGE_GENERATOR_JAR) \
@ -2545,13 +2559,18 @@ RECOVERY_INSTALLING_SECURITY_TEXT_FILE :=
RECOVERY_ERASING_TEXT_FILE := RECOVERY_ERASING_TEXT_FILE :=
RECOVERY_ERROR_TEXT_FILE := RECOVERY_ERROR_TEXT_FILE :=
RECOVERY_NO_COMMAND_TEXT_FILE := RECOVERY_NO_COMMAND_TEXT_FILE :=
RECOVERY_CANCEL_WIPE_DATA_TEXT_FILE :=
RECOVERY_FACTORY_DATA_RESET_TEXT_FILE :=
RECOVERY_TRY_AGAIN_TEXT_FILE :=
RECOVERY_WIPE_DATA_CONFIRMATION_TEXT_FILE :=
RECOVERY_WIPE_DATA_MENU_HEADER_TEXT_FILE :=
endif # TARGET_RECOVERY_UI_SCREEN_WIDTH endif # TARGET_RECOVERY_UI_SCREEN_WIDTH
ifneq ($(TARGET_RECOVERY_DEVICE_DIRS),)
recovery_root_private := $(strip \
$(foreach d,$(TARGET_RECOVERY_DEVICE_DIRS), $(wildcard $(d)/recovery/root)))
else
recovery_root_private := $(strip $(wildcard $(TARGET_DEVICE_DIR)/recovery/root))
endif
ifneq ($(recovery_root_private),)
recovery_root_deps := $(shell find $(recovery_root_private) -type f)
endif
ifndef TARGET_PRIVATE_RES_DIRS ifndef TARGET_PRIVATE_RES_DIRS
TARGET_PRIVATE_RES_DIRS := $(wildcard $(TARGET_DEVICE_DIR)/recovery/res) TARGET_PRIVATE_RES_DIRS := $(wildcard $(TARGET_DEVICE_DIR)/recovery/res)
endif endif
@ -2596,7 +2615,7 @@ endif
ifeq (,$(filter true, $(BOARD_USES_FULL_RECOVERY_IMAGE) $(BOARD_USES_RECOVERY_AS_BOOT) \ ifeq (,$(filter true, $(BOARD_USES_FULL_RECOVERY_IMAGE) $(BOARD_USES_RECOVERY_AS_BOOT) \
$(BOARD_INCLUDE_RECOVERY_DTBO) $(BOARD_INCLUDE_RECOVERY_ACPIO) \ $(BOARD_INCLUDE_RECOVERY_DTBO) $(BOARD_INCLUDE_RECOVERY_ACPIO) \
$(BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT))) $(BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT) $(BOARD_RAMDISK_USE_LZ4) $(BOARD_RAMDISK_USE_XZ)))
# Named '.dat' so we don't attempt to use imgdiff for patching it. # Named '.dat' so we don't attempt to use imgdiff for patching it.
RECOVERY_RESOURCE_ZIP := $(TARGET_OUT_VENDOR)/etc/recovery-resource.dat RECOVERY_RESOURCE_ZIP := $(TARGET_OUT_VENDOR)/etc/recovery-resource.dat
ALL_DEFAULT_INSTALLED_MODULES += $(RECOVERY_RESOURCE_ZIP) ALL_DEFAULT_INSTALLED_MODULES += $(RECOVERY_RESOURCE_ZIP)
@ -2608,6 +2627,7 @@ INSTALLED_RECOVERY_BUILD_PROP_TARGET := $(TARGET_RECOVERY_ROOT_OUT)/prop.default
$(INSTALLED_RECOVERY_BUILD_PROP_TARGET): PRIVATE_RECOVERY_UI_PROPERTIES := \ $(INSTALLED_RECOVERY_BUILD_PROP_TARGET): PRIVATE_RECOVERY_UI_PROPERTIES := \
TARGET_RECOVERY_UI_ANIMATION_FPS:animation_fps \ TARGET_RECOVERY_UI_ANIMATION_FPS:animation_fps \
TARGET_RECOVERY_UI_BLANK_UNBLANK_ON_INIT:blank_unblank_on_init \
TARGET_RECOVERY_UI_MARGIN_HEIGHT:margin_height \ TARGET_RECOVERY_UI_MARGIN_HEIGHT:margin_height \
TARGET_RECOVERY_UI_MARGIN_WIDTH:margin_width \ TARGET_RECOVERY_UI_MARGIN_WIDTH:margin_width \
TARGET_RECOVERY_UI_MENU_UNUSABLE_ROWS:menu_unusable_rows \ TARGET_RECOVERY_UI_MENU_UNUSABLE_ROWS:menu_unusable_rows \
@ -2704,7 +2724,12 @@ ifndef BOARD_RECOVERY_MKBOOTIMG_ARGS
BOARD_RECOVERY_MKBOOTIMG_ARGS := $(BOARD_MKBOOTIMG_ARGS) BOARD_RECOVERY_MKBOOTIMG_ARGS := $(BOARD_MKBOOTIMG_ARGS)
endif endif
$(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP): $(MKBOOTFS) $(COMPRESSION_COMMAND_DEPS) \ ifeq ($(strip $(BOARD_KERNEL_SEPARATED_DT)),true)
INTERNAL_RECOVERYIMAGE_ARGS += --dt $(INSTALLED_DTIMAGE_TARGET)
RECOVERYIMAGE_EXTRA_DEPS := $(INSTALLED_DTIMAGE_TARGET)
endif
$(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP): $(MKBOOTFS) \
$(INTERNAL_ROOT_FILES) \ $(INTERNAL_ROOT_FILES) \
$(INSTALLED_RAMDISK_TARGET) \ $(INSTALLED_RAMDISK_TARGET) \
$(INTERNAL_RECOVERYIMAGE_FILES) \ $(INTERNAL_RECOVERYIMAGE_FILES) \
@ -2712,7 +2737,7 @@ $(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP): $(MKBOOTFS) $(COMPRESSION_COMMAND_
$(INSTALLED_2NDBOOTLOADER_TARGET) \ $(INSTALLED_2NDBOOTLOADER_TARGET) \
$(INSTALLED_RECOVERY_BUILD_PROP_TARGET) \ $(INSTALLED_RECOVERY_BUILD_PROP_TARGET) \
$(INSTALLED_RECOVERY_RAMDISK_BUILD_PROP_TARGET) \ $(INSTALLED_RECOVERY_RAMDISK_BUILD_PROP_TARGET) \
$(recovery_resource_deps) \ $(recovery_resource_deps) $(recovery_root_deps) \
$(recovery_fstab) $(recovery_fstab)
# Making recovery image # Making recovery image
mkdir -p $(TARGET_RECOVERY_OUT) mkdir -p $(TARGET_RECOVERY_OUT)
@ -2731,10 +2756,12 @@ $(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP): $(MKBOOTFS) $(COMPRESSION_COMMAND_
$(foreach recovery_text_file,$(generated_recovery_text_files), \ $(foreach recovery_text_file,$(generated_recovery_text_files), \
cp -rf $(recovery_text_file) $(TARGET_RECOVERY_ROOT_OUT)/res/images/ &&) true cp -rf $(recovery_text_file) $(TARGET_RECOVERY_ROOT_OUT)/res/images/ &&) true
cp -f $(recovery_font) $(TARGET_RECOVERY_ROOT_OUT)/res/images/font.png cp -f $(recovery_font) $(TARGET_RECOVERY_ROOT_OUT)/res/images/font.png
$(foreach item,$(recovery_root_private), \
cp -rf $(item) $(TARGET_RECOVERY_OUT)/;)
$(foreach item,$(TARGET_PRIVATE_RES_DIRS), \ $(foreach item,$(TARGET_PRIVATE_RES_DIRS), \
cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/$(newline)) cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/$(newline);)
$(foreach item,$(recovery_fstab), \ $(foreach item,$(recovery_fstab), \
cp -f $(item) $(TARGET_RECOVERY_ROOT_OUT)/system/etc/recovery.fstab) cp -f $(item) $(TARGET_RECOVERY_ROOT_OUT)/system/etc/recovery.fstab;)
$(if $(strip $(recovery_wipe)), \ $(if $(strip $(recovery_wipe)), \
cp -f $(recovery_wipe) $(TARGET_RECOVERY_ROOT_OUT)/system/etc/recovery.wipe) cp -f $(recovery_wipe) $(TARGET_RECOVERY_ROOT_OUT)/system/etc/recovery.wipe)
ln -sf prop.default $(TARGET_RECOVERY_ROOT_OUT)/default.prop ln -sf prop.default $(TARGET_RECOVERY_ROOT_OUT)/default.prop
@ -2743,8 +2770,13 @@ $(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP): $(MKBOOTFS) $(COMPRESSION_COMMAND_
$(BOARD_RECOVERY_IMAGE_PREPARE) $(BOARD_RECOVERY_IMAGE_PREPARE)
$(hide) touch $@ $(hide) touch $@
$(recovery_ramdisk): $(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP) $(recovery_uncompressed_ramdisk): $(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP)
$(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_RECOVERY_ROOT_OUT) | $(COMPRESSION_COMMAND) > $(recovery_ramdisk) @echo ----- Making uncompressed recovery ramdisk ------
$(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_RECOVERY_ROOT_OUT) > $@
$(recovery_ramdisk): $(recovery_uncompressed_ramdisk) $(COMPRESSION_COMMAND_DEPS)
@echo ----- Making compressed recovery ramdisk ------
$(COMPRESSION_COMMAND) < $(recovery_uncompressed_ramdisk) > $@
# $(1): output file # $(1): output file
# $(2): optional kernel file # $(2): optional kernel file
@ -2800,9 +2832,13 @@ $(call declare-container-license-deps,$(INSTALLED_BOOTIMAGE_TARGET),$(recoveryim
UNMOUNTED_NOTICE_VENDOR_DEPS+= $(INSTALLED_BOOTIMAGE_TARGET) UNMOUNTED_NOTICE_VENDOR_DEPS+= $(INSTALLED_BOOTIMAGE_TARGET)
endif # BOARD_USES_RECOVERY_AS_BOOT endif # BOARD_USES_RECOVERY_AS_BOOT
$(INSTALLED_RECOVERYIMAGE_TARGET): $(recoveryimage-deps) ifndef BOARD_CUSTOM_BOOTIMG_MK
$(INSTALLED_RECOVERYIMAGE_TARGET): $(recoveryimage-deps) $(RECOVERYIMAGE_EXTRA_DEPS)
$(call build-recoveryimage-target, $@, \ $(call build-recoveryimage-target, $@, \
$(if $(filter true, $(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE)),, $(recovery_kernel))) $(if $(filter true, $(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE)),, $(recovery_kernel)))
else
INTERNAL_RECOVERYIMAGE_ARGS += --kernel $(recovery_kernel)
endif # BOARD_CUSTOM_BOOTIMG_MK
ifdef RECOVERY_RESOURCE_ZIP ifdef RECOVERY_RESOURCE_ZIP
$(RECOVERY_RESOURCE_ZIP): $(INSTALLED_RECOVERYIMAGE_TARGET) | $(ZIPTIME) $(RECOVERY_RESOURCE_ZIP): $(INSTALLED_RECOVERYIMAGE_TARGET) | $(ZIPTIME)
@ -2838,6 +2874,9 @@ ifneq ($(BOARD_NAND_SPARE_SIZE),)
$(error MTD device is no longer supported and thus BOARD_NAND_SPARE_SIZE is deprecated.) $(error MTD device is no longer supported and thus BOARD_NAND_SPARE_SIZE is deprecated.)
endif endif
ifdef BOARD_CUSTOM_BOOTIMG_MK
include $(BOARD_CUSTOM_BOOTIMG_MK)
endif
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# Build debug ramdisk and debug boot image. # Build debug ramdisk and debug boot image.
@ -3425,12 +3464,14 @@ endef
# $(2): The partition's staging directory # $(2): The partition's staging directory
# $(3): Files to include in the partition # $(3): Files to include in the partition
define write-partition-file-list define write-partition-file-list
$(1): PRIVATE_FILES := $(subst $(2)/,,$(filter $(2)/%,$(3)))
$(1): PRIVATE_EXTRA_INSTALL_ZIPS := $(call relevant-extra-install-zips,$(filter $(2)/%,$(3)))
$(1): $$(HOST_OUT_EXECUTABLES)/extra_install_zips_file_list $(foreach p,$(call relevant-extra-install-zips,$(filter $(2)/%,$(3))),$(call word-colon,3,$(p))) $(1): $$(HOST_OUT_EXECUTABLES)/extra_install_zips_file_list $(foreach p,$(call relevant-extra-install-zips,$(filter $(2)/%,$(3))),$(call word-colon,3,$(p)))
@echo Writing $$@ @echo Writing $$@
rm -f $$@ rm -f $$@
echo -n > $$@ echo -n > $$@
$$(foreach f,$(subst $(2)/,,$(filter $(2)/%,$(3))),echo "$$(f)" >> $$@$$(newline)) $$(foreach f,$$(PRIVATE_FILES),echo "$$(f)" >> $$@$$(newline))
$$(HOST_OUT_EXECUTABLES)/extra_install_zips_file_list $(2) $(call relevant-extra-install-zips,$(filter $(2)/%,$(3))) >> $$@ $$(HOST_OUT_EXECUTABLES)/extra_install_zips_file_list $(2) $$(PRIVATE_EXTRA_INSTALL_ZIPS) >> $$@
endef endef
# ----------------------------------------------------------------- # -----------------------------------------------------------------
@ -3525,7 +3566,8 @@ INSTALLED_SYSTEMIMAGE := $(INSTALLED_SYSTEMIMAGE_TARGET)
ifneq ($(INSTALLED_BOOTIMAGE_TARGET),) ifneq ($(INSTALLED_BOOTIMAGE_TARGET),)
ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),) ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
ifneq ($(BOARD_USES_FULL_RECOVERY_IMAGE),true) ifneq ($(BOARD_USES_FULL_RECOVERY_IMAGE),true)
ifneq (,$(filter true,$(BOARD_INCLUDE_RECOVERY_DTBO) $(BOARD_INCLUDE_RECOVERY_ACPIO))) ifneq (,$(filter true,$(BOARD_INCLUDE_RECOVERY_DTBO) $(BOARD_INCLUDE_RECOVERY_ACPIO) \
$(BOARD_RAMDISK_USE_LZ4) $(BOARD_RAMDISK_USE_XZ)))
diff_tool := $(HOST_OUT_EXECUTABLES)/bsdiff diff_tool := $(HOST_OUT_EXECUTABLES)/bsdiff
else else
diff_tool := $(HOST_OUT_EXECUTABLES)/imgdiff diff_tool := $(HOST_OUT_EXECUTABLES)/imgdiff
@ -5846,6 +5888,9 @@ endif
ifeq ($(BOARD_RAMDISK_USE_LZ4),true) ifeq ($(BOARD_RAMDISK_USE_LZ4),true)
echo "lz4_ramdisks=true" >> $@ echo "lz4_ramdisks=true" >> $@
endif endif
ifeq ($(BOARD_RAMDISK_USE_XZ),true)
echo "xz_ramdisks=true" >> $@
endif
ifneq ($(INSTALLED_VENDOR_BOOTIMAGE_TARGET),) ifneq ($(INSTALLED_VENDOR_BOOTIMAGE_TARGET),)
echo "vendor_boot=true" >> $@ echo "vendor_boot=true" >> $@
echo "vendor_boot_size=$(BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE)" >> $@ echo "vendor_boot_size=$(BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE)" >> $@
@ -5900,6 +5945,9 @@ endif
ifeq ($(BOARD_USES_FULL_RECOVERY_IMAGE),true) ifeq ($(BOARD_USES_FULL_RECOVERY_IMAGE),true)
$(hide) echo "full_recovery_image=true" >> $@ $(hide) echo "full_recovery_image=true" >> $@
endif endif
ifdef BUILDING_VENDOR_IMAGE
$(hide) echo "board_builds_vendorimage=true" >> $@
endif
ifdef BOARD_USES_VENDORIMAGE ifdef BOARD_USES_VENDORIMAGE
$(hide) echo "board_uses_vendorimage=true" >> $@ $(hide) echo "board_uses_vendorimage=true" >> $@
endif endif
@ -6045,6 +6093,9 @@ endif
ifeq ($(BUILDING_WITH_VSDK),true) ifeq ($(BUILDING_WITH_VSDK),true)
$(hide) echo "building_with_vsdk=true" >> $@ $(hide) echo "building_with_vsdk=true" >> $@
endif endif
ifneq ($(TARGET_OTA_ASSERT_DEVICE),)
$(hide) echo "ota_override_device=$(TARGET_OTA_ASSERT_DEVICE)" >> $@
endif
$(call declare-0p-target,$(INSTALLED_FASTBOOT_INFO_TARGET)) $(call declare-0p-target,$(INSTALLED_FASTBOOT_INFO_TARGET))
@ -6299,7 +6350,7 @@ ifdef BUILDING_VENDOR_BOOT_IMAGE
endif endif
ifdef BUILDING_VENDOR_KERNEL_BOOT_IMAGE ifdef BUILDING_VENDOR_KERNEL_BOOT_IMAGE
$(BUILT_TARGET_FILES_DIR): $(INTERNAL_VENDOR_KERNEL_RAMDISK_FILES) $(BUILT_TARGET_FILES_PACKAGE): $(INSTALLED_FILES_FILE_VENDOR_KERNEL_RAMDISK)
endif endif
ifdef BUILDING_RECOVERY_IMAGE ifdef BUILDING_RECOVERY_IMAGE
@ -6412,6 +6463,7 @@ $(BUILT_TARGET_FILES_DIR): \
$(INSTALLED_PVMFW_EMBEDDED_AVBKEY_TARGET) \ $(INSTALLED_PVMFW_EMBEDDED_AVBKEY_TARGET) \
$(INSTALLED_CUSTOMIMAGES_TARGET) \ $(INSTALLED_CUSTOMIMAGES_TARGET) \
$(INSTALLED_ANDROID_INFO_TXT_TARGET) \ $(INSTALLED_ANDROID_INFO_TXT_TARGET) \
$(INSTALLED_RECOVERY_KERNEL_TARGET) \
$(INSTALLED_KERNEL_TARGET) \ $(INSTALLED_KERNEL_TARGET) \
$(INSTALLED_RAMDISK_TARGET) \ $(INSTALLED_RAMDISK_TARGET) \
$(INSTALLED_DTBIMAGE_TARGET) \ $(INSTALLED_DTBIMAGE_TARGET) \
@ -6455,12 +6507,12 @@ ifneq (true,$(BOARD_INCLUDE_RECOVERY_RAMDISK_IN_VENDOR_BOOT))
$(hide) $(call package_files-copy-root, \ $(hide) $(call package_files-copy-root, \
$(TARGET_RECOVERY_ROOT_OUT),$(zip_root)/$(PRIVATE_RECOVERY_OUT)/RAMDISK) $(TARGET_RECOVERY_ROOT_OUT),$(zip_root)/$(PRIVATE_RECOVERY_OUT)/RAMDISK)
endif endif
ifdef INSTALLED_KERNEL_TARGET @# OTA install helpers
ifneq (,$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT))) $(hide) $(call package_files-copy-root, \
cp $(INSTALLED_KERNEL_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/ $(PRODUCT_OUT)/install,$(zip_root)/INSTALL)
else ifneq (true,$(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE)) ifdef INSTALLED_RECOVERY_KERNEL_TARGET
cp $(firstword $(INSTALLED_KERNEL_TARGET)) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/kernel # The python script that wraps it all up wants it to be named kernel, so do that
endif cp $(INSTALLED_RECOVERY_KERNEL_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/kernel
endif endif
ifneq (truetrue,$(strip $(BUILDING_VENDOR_BOOT_IMAGE))$(strip $(BOARD_USES_RECOVERY_AS_BOOT))) ifneq (truetrue,$(strip $(BUILDING_VENDOR_BOOT_IMAGE))$(strip $(BOARD_USES_RECOVERY_AS_BOOT)))
ifdef INSTALLED_2NDBOOTLOADER_TARGET ifdef INSTALLED_2NDBOOTLOADER_TARGET
@ -6490,6 +6542,9 @@ endif
ifdef BOARD_KERNEL_PAGESIZE ifdef BOARD_KERNEL_PAGESIZE
echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/$(PRIVATE_RECOVERY_OUT)/pagesize echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/$(PRIVATE_RECOVERY_OUT)/pagesize
endif endif
ifeq ($(strip $(BOARD_KERNEL_SEPARATED_DT)),true)
$(hide) $(ACP) $(INSTALLED_DTIMAGE_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/dt
endif
endif # not (BUILDING_VENDOR_BOOT_IMAGE and BOARD_USES_RECOVERY_AS_BOOT) endif # not (BUILDING_VENDOR_BOOT_IMAGE and BOARD_USES_RECOVERY_AS_BOOT)
endif # INSTALLED_RECOVERYIMAGE_TARGET defined or BOARD_USES_RECOVERY_AS_BOOT is true endif # INSTALLED_RECOVERYIMAGE_TARGET defined or BOARD_USES_RECOVERY_AS_BOOT is true
@# Components of the boot image @# Components of the boot image
@ -6520,6 +6575,9 @@ endif
ifdef BOARD_KERNEL_PAGESIZE ifdef BOARD_KERNEL_PAGESIZE
echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/BOOT/pagesize echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/BOOT/pagesize
endif endif
ifeq ($(strip $(BOARD_KERNEL_SEPARATED_DT)),true)
$(hide) $(ACP) $(INSTALLED_DTIMAGE_TARGET) $(zip_root)/BOOT/dt
endif
endif # INSTALLED_VENDOR_BOOTIMAGE_TARGET == "" && BOARD_USES_GENERIC_KERNEL_IMAGE != true endif # INSTALLED_VENDOR_BOOTIMAGE_TARGET == "" && BOARD_USES_GENERIC_KERNEL_IMAGE != true
endif # BOARD_USES_RECOVERY_AS_BOOT not true endif # BOARD_USES_RECOVERY_AS_BOOT not true
$(hide) $(foreach t,$(INSTALLED_RADIOIMAGE_TARGET),\ $(hide) $(foreach t,$(INSTALLED_RADIOIMAGE_TARGET),\
@ -6569,6 +6627,14 @@ ifdef BOARD_KERNEL_PAGESIZE
echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/VENDOR_KERNEL_BOOT/pagesize echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/VENDOR_KERNEL_BOOT/pagesize
endif endif
endif # INSTALLED_VENDOR_BOOTIMAGE_TARGET endif # INSTALLED_VENDOR_BOOTIMAGE_TARGET
ifdef BOARD_CUSTOM_BOOTIMG
@# Prebuilt boot images
$(hide) mkdir -p $(zip_root)/BOOTABLE_IMAGES
$(hide) $(ACP) $(INSTALLED_BOOTIMAGE_TARGET) $(zip_root)/BOOTABLE_IMAGES/
ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
$(hide) $(ACP) $(INSTALLED_RECOVERYIMAGE_TARGET) $(zip_root)/BOOTABLE_IMAGES/
endif
endif
ifdef BUILDING_SYSTEM_IMAGE ifdef BUILDING_SYSTEM_IMAGE
@# Contents of the system image @# Contents of the system image
$(hide) $(call package_files-copy-root, \ $(hide) $(call package_files-copy-root, \
@ -6942,6 +7008,7 @@ PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$(dir $(ZIP2ZIP)):$$PATH \
$(OTA_FROM_TARGET_FILES) \ $(OTA_FROM_TARGET_FILES) \
--verbose \ --verbose \
--path $(HOST_OUT) \ --path $(HOST_OUT) \
--backup=$(backuptool) \
$(if $(OEM_OTA_CONFIG), --oem_settings $(OEM_OTA_CONFIG)) \ $(if $(OEM_OTA_CONFIG), --oem_settings $(OEM_OTA_CONFIG)) \
$(if $(BOOT_VAR_OTA_CONFIG), --boot_variable_file $(BOOT_VAR_OTA_CONFIG)) \ $(if $(BOOT_VAR_OTA_CONFIG), --boot_variable_file $(BOOT_VAR_OTA_CONFIG)) \
$(2) \ $(2) \
@ -6959,6 +7026,16 @@ INTERNAL_OTA_METADATA := $(PRODUCT_OUT)/ota_metadata
$(call declare-0p-target,$(INTERNAL_OTA_METADATA)) $(call declare-0p-target,$(INTERNAL_OTA_METADATA))
ifeq ($(TARGET_BUILD_VARIANT),user)
$(INTERNAL_OTA_PACKAGE_TARGET): backuptool := false
else
ifneq ($(TEQUILA_BUILD),)
$(INTERNAL_OTA_PACKAGE_TARGET): backuptool := true
else
$(INTERNAL_OTA_PACKAGE_TARGET): backuptool := false
endif
endif
$(INTERNAL_OTA_PACKAGE_TARGET): KEY_CERT_PAIR := $(DEFAULT_KEY_CERT_PAIR) $(INTERNAL_OTA_PACKAGE_TARGET): KEY_CERT_PAIR := $(DEFAULT_KEY_CERT_PAIR)
$(INTERNAL_OTA_PACKAGE_TARGET): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_OTA_METADATA) $(INTERNAL_OTA_PACKAGE_TARGET): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_OTA_METADATA)
$(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_DIR) $(OTA_FROM_TARGET_FILES) $(INTERNAL_OTATOOLS_FILES) $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_DIR) $(OTA_FROM_TARGET_FILES) $(INTERNAL_OTATOOLS_FILES)
@ -7317,7 +7394,7 @@ ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION))
# BOARD_SUPER_PARTITION_SIZE must be defined to build super image. # BOARD_SUPER_PARTITION_SIZE must be defined to build super image.
ifneq ($(BOARD_SUPER_PARTITION_SIZE),) ifneq ($(BOARD_SUPER_PARTITION_SIZE),)
ifneq (true,$(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS)) ifeq ($(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)),1)
# For real devices and for dist builds, build super image from target files to an intermediate directory. # For real devices and for dist builds, build super image from target files to an intermediate directory.
INTERNAL_SUPERIMAGE_DIST_TARGET := $(call intermediates-dir-for,PACKAGING,super.img)/super.img INTERNAL_SUPERIMAGE_DIST_TARGET := $(call intermediates-dir-for,PACKAGING,super.img)/super.img
@ -7335,7 +7412,7 @@ endif
.PHONY: superimage_dist .PHONY: superimage_dist
superimage_dist: $(INTERNAL_SUPERIMAGE_DIST_TARGET) superimage_dist: $(INTERNAL_SUPERIMAGE_DIST_TARGET)
endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS != "true" endif # $(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)) == 1
endif # BOARD_SUPER_PARTITION_SIZE != "" endif # BOARD_SUPER_PARTITION_SIZE != ""
endif # PRODUCT_BUILD_SUPER_PARTITION == "true" endif # PRODUCT_BUILD_SUPER_PARTITION == "true"
@ -7344,7 +7421,7 @@ endif # PRODUCT_BUILD_SUPER_PARTITION == "true"
ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION)) ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION))
ifneq ($(BOARD_SUPER_PARTITION_SIZE),) ifneq ($(BOARD_SUPER_PARTITION_SIZE),)
ifneq (true,$(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS)) ifeq ($(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)),1)
# Build super.img by using $(INSTALLED_*IMAGE_TARGET) to $(1) # Build super.img by using $(INSTALLED_*IMAGE_TARGET) to $(1)
# $(1): built image path # $(1): built image path
@ -7399,7 +7476,7 @@ superimage-nodeps supernod: | $(INSTALLED_SUPERIMAGE_DEPENDENCIES)
$(call build-superimage-target,$(INSTALLED_SUPERIMAGE_TARGET),\ $(call build-superimage-target,$(INSTALLED_SUPERIMAGE_TARGET),\
$(call intermediates-dir-for,PACKAGING,superimage-nodeps)/misc_info.txt) $(call intermediates-dir-for,PACKAGING,superimage-nodeps)/misc_info.txt)
endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS != "true" endif # $(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)) == 1
endif # BOARD_SUPER_PARTITION_SIZE != "" endif # BOARD_SUPER_PARTITION_SIZE != ""
endif # PRODUCT_BUILD_SUPER_PARTITION == "true" endif # PRODUCT_BUILD_SUPER_PARTITION == "true"

View file

@ -29,6 +29,7 @@ $(call add_soong_config_namespace,ANDROID)
$(call add_soong_config_var,ANDROID,BOARD_USES_ODMIMAGE) $(call add_soong_config_var,ANDROID,BOARD_USES_ODMIMAGE)
$(call add_soong_config_var,ANDROID,BOARD_USES_RECOVERY_AS_BOOT) $(call add_soong_config_var,ANDROID,BOARD_USES_RECOVERY_AS_BOOT)
$(call add_soong_config_var,ANDROID,CHECK_DEV_TYPE_VIOLATIONS) $(call add_soong_config_var,ANDROID,CHECK_DEV_TYPE_VIOLATIONS)
$(call add_soong_config_var,ANDROID,PLATFORM_SEPOLICY_VERSION)
$(call add_soong_config_var,ANDROID,PLATFORM_SEPOLICY_COMPAT_VERSIONS) $(call add_soong_config_var,ANDROID,PLATFORM_SEPOLICY_COMPAT_VERSIONS)
$(call add_soong_config_var,ANDROID,PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT) $(call add_soong_config_var,ANDROID,PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT)
$(call add_soong_config_var,ANDROID,TARGET_DYNAMIC_64_32_DRMSERVER) $(call add_soong_config_var,ANDROID,TARGET_DYNAMIC_64_32_DRMSERVER)
@ -36,7 +37,7 @@ $(call add_soong_config_var,ANDROID,TARGET_ENABLE_MEDIADRM_64)
$(call add_soong_config_var,ANDROID,TARGET_DYNAMIC_64_32_MEDIASERVER) $(call add_soong_config_var,ANDROID,TARGET_DYNAMIC_64_32_MEDIASERVER)
# PRODUCT_PRECOMPILED_SEPOLICY defaults to true. Explicitly check if it's "false" or not. # PRODUCT_PRECOMPILED_SEPOLICY defaults to true. Explicitly check if it's "false" or not.
$(call add_soong_config_var_value,ANDROID,PRODUCT_PRECOMPILED_SEPOLICY,$(if $(filter false,$(PRODUCT_PRECOMPILED_SEPOLICY)),false,true)) $(call soong_config_set_bool,ANDROID,PRODUCT_PRECOMPILED_SEPOLICY,$(if $(filter false,$(PRODUCT_PRECOMPILED_SEPOLICY)),false,true))
ifdef ART_DEBUG_OPT_FLAG ifdef ART_DEBUG_OPT_FLAG
$(call soong_config_set,art_module,art_debug_opt_flag,$(ART_DEBUG_OPT_FLAG)) $(call soong_config_set,art_module,art_debug_opt_flag,$(ART_DEBUG_OPT_FLAG))

View file

@ -45,7 +45,8 @@ endif
my_soong_problems := my_soong_problems :=
# Automatically replace the old-style kernel header include with a dependency # Automatically replace the old-style kernel header include with a dependency
# on the generated_kernel_headers header library # on the generated_kernel_headers header library when building inline
ifeq ($(INLINE_KERNEL_BUILDING),true)
ifneq (,$(findstring $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include,$(LOCAL_C_INCLUDES))) ifneq (,$(findstring $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include,$(LOCAL_C_INCLUDES)))
LOCAL_C_INCLUDES := $(patsubst $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include,,$(LOCAL_C_INCLUDES)) LOCAL_C_INCLUDES := $(patsubst $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include,,$(LOCAL_C_INCLUDES))
LOCAL_HEADER_LIBRARIES += generated_kernel_headers LOCAL_HEADER_LIBRARIES += generated_kernel_headers
@ -64,6 +65,12 @@ ifneq (,$(findstring $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr,$(LOCAL_ADDITION
LOCAL_ADDITIONAL_DEPENDENCIES := $(patsubst $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr,,$(LOCAL_ADDITIONAL_DEPENDENCIES)) LOCAL_ADDITIONAL_DEPENDENCIES := $(patsubst $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr,,$(LOCAL_ADDITIONAL_DEPENDENCIES))
endif endif
# Replace device_kernel_headers with generated_kernel_headers
ifneq (,$(findstring device_kernel_headers,$(LOCAL_HEADER_LIBRARIES)))
LOCAL_HEADER_LIBRARIES := $(patsubst device_kernel_headers,generated_kernel_headers,$(LOCAL_HEADER_LIBRARIES))
endif
endif
# The following LOCAL_ variables will be modified in this file. # The following LOCAL_ variables will be modified in this file.
# Because the same LOCAL_ variables may be used to define modules for both 1st arch and 2nd arch, # Because the same LOCAL_ variables may be used to define modules for both 1st arch and 2nd arch,
# we can't modify them in place. # we can't modify them in place.
@ -1427,6 +1434,11 @@ my_tracked_gen_files :=
$(foreach f,$(my_tracked_src_files),$(eval my_src_file_obj_$(s):=)) $(foreach f,$(my_tracked_src_files),$(eval my_src_file_obj_$(s):=))
my_tracked_src_files := my_tracked_src_files :=
## Allow a device's own headers to take precedence over global ones
ifneq ($(TARGET_SPECIFIC_HEADER_PATH),)
my_c_includes := $(TOPDIR)$(TARGET_SPECIFIC_HEADER_PATH) $(my_c_includes)
endif
my_c_includes += $(TOPDIR)$(LOCAL_PATH) $(intermediates) $(generated_sources_dir) my_c_includes += $(TOPDIR)$(LOCAL_PATH) $(intermediates) $(generated_sources_dir)
my_c_includes := $(foreach inc,$(my_c_includes),$(call clean-path,$(inc))) my_c_includes := $(foreach inc,$(my_c_includes),$(call clean-path,$(inc)))

View file

@ -316,6 +316,19 @@ $(call soong_config_define_internal,$1,$2) \
$(eval SOONG_CONFIG_$(strip $1)_$(strip $2):=$(strip $3)) $(eval SOONG_CONFIG_$(strip $1)_$(strip $2):=$(strip $3))
endef endef
# soong_config_set_bool is the same as soong_config_set, but it will
# also type the variable as a bool, so that when using select() expressions
# in blueprint files they can use boolean values instead of strings.
# It will only accept "true" for its value, any other value will be
# treated as false.
# $1 is the namespace. $2 is the variable name. $3 is the variable value.
# Ex: $(call soong_config_set_bool,acme,COOL_FEATURE,true)
define soong_config_set_bool
$(call soong_config_define_internal,$1,$2) \
$(eval SOONG_CONFIG_$(strip $1)_$(strip $2):=$(filter true,$3))
$(eval SOONG_CONFIG_TYPE_$(strip $1)_$(strip $2):=bool)
endef
# soong_config_append appends to the value of the variable in the given Soong # soong_config_append appends to the value of the variable in the given Soong
# config namespace. If the variable does not exist, it will be defined. If the # config namespace. If the variable does not exist, it will be defined. If the
# namespace does not exist, it will be defined. # namespace does not exist, it will be defined.
@ -1247,6 +1260,28 @@ BUILD_WARNING_BAD_OPTIONAL_USES_LIBS_ALLOWLIST := LegacyCamera Gallery2
# in the source tree. # in the source tree.
dont_bother_goals := out product-graph dont_bother_goals := out product-graph
ifeq ($(TARGET_SYSTEM_PROP),)
TARGET_SYSTEM_PROP := $(wildcard $(TARGET_DEVICE_DIR)/system.prop)
endif
ifeq ($(TARGET_SYSTEM_EXT_PROP),)
TARGET_SYSTEM_EXT_PROP := $(wildcard $(TARGET_DEVICE_DIR)/system_ext.prop)
endif
ifeq ($(TARGET_PRODUCT_PROP),)
TARGET_PRODUCT_PROP := $(wildcard $(TARGET_DEVICE_DIR)/product.prop)
endif
ifeq ($(TARGET_ODM_PROP),)
TARGET_ODM_PROP := $(wildcard $(TARGET_DEVICE_DIR)/odm.prop)
endif
.KATI_READONLY := \
TARGET_SYSTEM_PROP \
TARGET_SYSTEM_EXT_PROP \
TARGET_PRODUCT_PROP \
TARGET_ODM_PROP \
include $(BUILD_SYSTEM)/sysprop_config.mk include $(BUILD_SYSTEM)/sysprop_config.mk
# Make ANDROID Soong config variables visible to Android.mk files, for # Make ANDROID Soong config variables visible to Android.mk files, for
@ -1261,19 +1296,23 @@ $(eval include device/tequila/sepolicy/common/sepolicy.mk)
endif endif
endif endif
SOONG_VARIABLES := $(SOONG_OUT_DIR)/soong.$(TARGET_PRODUCT).variables
SOONG_EXTRA_VARIABLES := $(SOONG_OUT_DIR)/soong.$(TARGET_PRODUCT).extra.variables
ifeq ($(CALLED_FROM_SETUP),true) ifeq ($(CALLED_FROM_SETUP),true)
include $(BUILD_SYSTEM)/ninja_config.mk include $(BUILD_SYSTEM)/ninja_config.mk
include $(BUILD_SYSTEM)/soong_config.mk include $(BUILD_SYSTEM)/soong_config.mk
endif endif
SOONG_VARIABLES :=
SOONG_EXTRA_VARIABLES :=
-include external/ltp/android/ltp_package_list.mk -include external/ltp/android/ltp_package_list.mk
DEFAULT_DATA_OUT_MODULES := ltp $(ltp_packages) DEFAULT_DATA_OUT_MODULES := ltp $(ltp_packages)
.KATI_READONLY := DEFAULT_DATA_OUT_MODULES .KATI_READONLY := DEFAULT_DATA_OUT_MODULES
ifneq ($(TEQUILA_BUILD),)
# Include any vendor specific config.mk file # Include any vendor specific config.mk file
-include vendor/*/build/core/config.mk -include vendor/*/build/core/config.mk
endif
include $(BUILD_SYSTEM)/dumpvar.mk include $(BUILD_SYSTEM)/dumpvar.mk

View file

@ -3932,6 +3932,7 @@ $(foreach source,$(ENFORCE_RRO_SOURCES), \
$(eval enforce_rro_partition := $(word 6,$(_o))) \ $(eval enforce_rro_partition := $(word 6,$(_o))) \
$(eval include $(BUILD_SYSTEM)/generate_enforce_rro.mk) \ $(eval include $(BUILD_SYSTEM)/generate_enforce_rro.mk) \
$(eval ALL_MODULES.$$(enforce_rro_source_module).REQUIRED_FROM_TARGET += $$(LOCAL_PACKAGE_NAME)) \ $(eval ALL_MODULES.$$(enforce_rro_source_module).REQUIRED_FROM_TARGET += $$(LOCAL_PACKAGE_NAME)) \
$(eval ENFORCE_RRO_PACKAGES_$$(call to-upper,$(enforce_rro_partition)) += $$(LOCAL_PACKAGE_NAME)) \
) )
endef endef

View file

@ -209,12 +209,6 @@ endif
BUILD_WITHOUT_PV := true BUILD_WITHOUT_PV := true
ifneq ($(TEQUILA_BUILD),)
# ------------------------------------------------------------
# Include vendor specific additions to build properties
-include vendor/tequila/build/core/main.mk
endif
# ------------------------------------------------------------ # ------------------------------------------------------------
# Define a function that, given a list of module tags, returns # Define a function that, given a list of module tags, returns
# non-empty if that module should be installed in /system. # non-empty if that module should be installed in /system.
@ -258,6 +252,8 @@ $(readonly-final-product-vars)
ifneq ($(PRODUCT_ENFORCE_RRO_TARGETS),) ifneq ($(PRODUCT_ENFORCE_RRO_TARGETS),)
ENFORCE_RRO_SOURCES := ENFORCE_RRO_SOURCES :=
ENFORCE_RRO_PACKAGES_PRODUCT :=
ENFORCE_RRO_PACKAGES_VENDOR :=
endif endif
# Color-coded warnings including current module info # Color-coded warnings including current module info
@ -331,6 +327,22 @@ endef
# ------------------------------------------------------------------- # -------------------------------------------------------------------
ifneq ($(PRODUCT_ENFORCE_RRO_TARGETS),) ifneq ($(PRODUCT_ENFORCE_RRO_TARGETS),)
$(call generate_all_enforce_rro_packages) $(call generate_all_enforce_rro_packages)
_modules_with_rro_suffix :=
$(foreach m,$(PRODUCT_PACKAGES), \
$(eval _modules_with_rro_suffix += $$(m)__$(PRODUCT_NAME)__auto_generated_rro_%))
include $(CLEAR_VARS)
LOCAL_MODULE := enforce_rro_packages_product
LOCAL_MODULE_TAGS := optional
LOCAL_REQUIRED_MODULES := $(filter $(_modules_with_rro_suffix),$(ENFORCE_RRO_PACKAGES_PRODUCT))
include $(BUILD_PHONY_PACKAGE)
include $(CLEAR_VARS)
LOCAL_MODULE := enforce_rro_packages_vendor
LOCAL_MODULE_TAGS := optional
LOCAL_REQUIRED_MODULES := $(filter $(_modules_with_rro_suffix),$(ENFORCE_RRO_PACKAGES_VENDOR))
include $(BUILD_PHONY_PACKAGE)
endif endif
# ------------------------------------------------------------------- # -------------------------------------------------------------------

View file

@ -93,6 +93,4 @@ FRAMEWORKS_BASE_SUBDIRS := \
FRAMEWORKS_BASE_JAVA_SRC_DIRS := \ FRAMEWORKS_BASE_JAVA_SRC_DIRS := \
$(addprefix frameworks/base/,$(FRAMEWORKS_BASE_SUBDIRS)) $(addprefix frameworks/base/,$(FRAMEWORKS_BASE_SUBDIRS))
ifneq ($(TEQUILA_BUILD),)
-include vendor/tequila/build/core/pathmap.mk -include vendor/tequila/build/core/pathmap.mk
endif

View file

@ -1,5 +1,4 @@
SOONG_MAKEVARS_MK := $(SOONG_OUT_DIR)/make_vars-$(TARGET_PRODUCT).mk SOONG_MAKEVARS_MK := $(SOONG_OUT_DIR)/make_vars-$(TARGET_PRODUCT).mk
SOONG_VARIABLES := $(SOONG_OUT_DIR)/soong.$(TARGET_PRODUCT).variables
SOONG_ANDROID_MK := $(SOONG_OUT_DIR)/Android-$(TARGET_PRODUCT).mk SOONG_ANDROID_MK := $(SOONG_OUT_DIR)/Android-$(TARGET_PRODUCT).mk
include $(BUILD_SYSTEM)/art_config.mk include $(BUILD_SYSTEM)/art_config.mk
@ -30,6 +29,7 @@ $(call json_start)
$(call add_json_str, Make_suffix, -$(TARGET_PRODUCT)) $(call add_json_str, Make_suffix, -$(TARGET_PRODUCT))
$(call add_json_str, BuildId, $(BUILD_ID)) $(call add_json_str, BuildId, $(BUILD_ID))
$(call add_json_str, BuildFingerprintFile, build_fingerprint.txt)
$(call add_json_str, BuildNumberFile, build_number.txt) $(call add_json_str, BuildNumberFile, build_number.txt)
$(call add_json_str, BuildHostnameFile, build_hostname.txt) $(call add_json_str, BuildHostnameFile, build_hostname.txt)
$(call add_json_str, BuildThumbprintFile, build_thumbprint.txt) $(call add_json_str, BuildThumbprintFile, build_thumbprint.txt)
@ -147,12 +147,16 @@ $(call add_json_list, NativeCoverageExcludePaths, $(NATIVE_COVERAGE_EXCLU
$(call add_json_bool, ArtUseReadBarrier, $(call invert_bool,$(filter false,$(PRODUCT_ART_USE_READ_BARRIER)))) $(call add_json_bool, ArtUseReadBarrier, $(call invert_bool,$(filter false,$(PRODUCT_ART_USE_READ_BARRIER))))
$(call add_json_str, BtConfigIncludeDir, $(BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR)) $(call add_json_str, BtConfigIncludeDir, $(BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR))
$(call add_json_list, DeviceKernelHeaders, $(TARGET_DEVICE_KERNEL_HEADERS) $(TARGET_BOARD_KERNEL_HEADERS) $(TARGET_PRODUCT_KERNEL_HEADERS)) $(call add_json_list, DeviceKernelHeaders, $(TARGET_DEVICE_KERNEL_HEADERS) $(TARGET_BOARD_KERNEL_HEADERS) $(TARGET_PRODUCT_KERNEL_HEADERS))
$(call add_json_str, TargetSpecificHeaderPath, $(TARGET_SPECIFIC_HEADER_PATH))
$(call add_json_str, VendorApiLevel, $(BOARD_API_LEVEL)) $(call add_json_str, VendorApiLevel, $(BOARD_API_LEVEL))
$(call add_json_list, ExtraVndkVersions, $(PRODUCT_EXTRA_VNDK_VERSIONS)) $(call add_json_list, ExtraVndkVersions, $(PRODUCT_EXTRA_VNDK_VERSIONS))
$(call add_json_list, DeviceSystemSdkVersions, $(BOARD_SYSTEMSDK_VERSIONS)) $(call add_json_list, DeviceSystemSdkVersions, $(BOARD_SYSTEMSDK_VERSIONS))
$(call add_json_str, RecoverySnapshotVersion, $(RECOVERY_SNAPSHOT_VERSION)) $(call add_json_str, RecoverySnapshotVersion, $(RECOVERY_SNAPSHOT_VERSION))
$(call add_json_list, Platform_systemsdk_versions, $(PLATFORM_SYSTEMSDK_VERSIONS)) $(call add_json_list, Platform_systemsdk_versions, $(PLATFORM_SYSTEMSDK_VERSIONS))
$(call add_json_bool, Malloc_low_memory, $(findstring true,$(MALLOC_SVELTE) $(MALLOC_LOW_MEMORY))) $(call add_json_bool, Malloc_low_memory, $(findstring true,$(MALLOC_SVELTE) $(MALLOC_LOW_MEMORY)))
$(call add_json_bool, Malloc_low_memory_libc32, $(if $(MALLOC_SVELTE_FOR_LIBC32),\
$(filter true,$(MALLOC_SVELTE_FOR_LIBC32)),\
$(findstring true,$(MALLOC_SVELTE) $(MALLOC_LOW_MEMORY))))
$(call add_json_bool, Malloc_zero_contents, $(call invert_bool,$(filter false,$(MALLOC_ZERO_CONTENTS)))) $(call add_json_bool, Malloc_zero_contents, $(call invert_bool,$(filter false,$(MALLOC_ZERO_CONTENTS))))
$(call add_json_bool, Malloc_pattern_fill_contents, $(MALLOC_PATTERN_FILL_CONTENTS)) $(call add_json_bool, Malloc_pattern_fill_contents, $(MALLOC_PATTERN_FILL_CONTENTS))
$(call add_json_str, Override_rs_driver, $(OVERRIDE_RS_DRIVER)) $(call add_json_str, Override_rs_driver, $(OVERRIDE_RS_DRIVER))
@ -262,6 +266,18 @@ $(foreach namespace,$(sort $(SOONG_CONFIG_NAMESPACES)),\
$(call end_json_map)) $(call end_json_map))
$(call end_json_map) $(call end_json_map)
# Add the types of the variables in VendorVars. Since this is much newer
# than VendorVars, which has a history of just using string values for everything,
# variables are assumed to be strings by default. For strings, SOONG_CONFIG_TYPE_*
# will not be set, and they will not have an entry in the VendorVarTypes map.
$(call add_json_map, VendorVarTypes)
$(foreach namespace,$(sort $(SOONG_CONFIG_NAMESPACES)),\
$(call add_json_map, $(namespace))\
$(foreach key,$(sort $(SOONG_CONFIG_$(namespace))),\
$(if $(SOONG_CONFIG_TYPE_$(namespace)_$(key)),$(call add_json_str,$(key),$(subst ",\",$(SOONG_CONFIG_TYPE_$(namespace)_$(key))))))\
$(call end_json_map))
$(call end_json_map)
$(call add_json_bool, EnforceProductPartitionInterface, $(filter true,$(PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE))) $(call add_json_bool, EnforceProductPartitionInterface, $(filter true,$(PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE)))
$(call add_json_str, DeviceCurrentApiLevelForVendorModules, $(BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES)) $(call add_json_str, DeviceCurrentApiLevelForVendorModules, $(BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES))
@ -297,6 +313,7 @@ $(call add_json_bool, BuildBrokenVendorPropertyNamespace, $(filter true,$(BUILD
$(call add_json_bool, BuildBrokenIncorrectPartitionImages, $(filter true,$(BUILD_BROKEN_INCORRECT_PARTITION_IMAGES))) $(call add_json_bool, BuildBrokenIncorrectPartitionImages, $(filter true,$(BUILD_BROKEN_INCORRECT_PARTITION_IMAGES)))
$(call add_json_list, BuildBrokenInputDirModules, $(BUILD_BROKEN_INPUT_DIR_MODULES)) $(call add_json_list, BuildBrokenInputDirModules, $(BUILD_BROKEN_INPUT_DIR_MODULES))
$(call add_json_bool, BuildBrokenDontCheckSystemSdk, $(filter true,$(BUILD_BROKEN_DONT_CHECK_SYSTEMSDK))) $(call add_json_bool, BuildBrokenDontCheckSystemSdk, $(filter true,$(BUILD_BROKEN_DONT_CHECK_SYSTEMSDK)))
$(call add_json_bool, BuildBrokenDupSysprop, $(filter true,$(BUILD_BROKEN_DUP_SYSPROP)))
$(call add_json_list, BuildWarningBadOptionalUsesLibsAllowlist, $(BUILD_WARNING_BAD_OPTIONAL_USES_LIBS_ALLOWLIST)) $(call add_json_list, BuildWarningBadOptionalUsesLibsAllowlist, $(BUILD_WARNING_BAD_OPTIONAL_USES_LIBS_ALLOWLIST))
@ -346,6 +363,22 @@ $(call add_json_bool, BoardUseVbmetaDigestInFingerprint, $(filter true,$(BOARD_U
$(call add_json_list, OemProperties, $(PRODUCT_OEM_PROPERTIES)) $(call add_json_list, OemProperties, $(PRODUCT_OEM_PROPERTIES))
$(call add_json_list, SystemPropFiles, $(TARGET_SYSTEM_PROP))
$(call add_json_list, SystemExtPropFiles, $(TARGET_SYSTEM_EXT_PROP))
$(call add_json_list, ProductPropFiles, $(TARGET_PRODUCT_PROP))
$(call add_json_list, OdmPropFiles, $(TARGET_ODM_PROP))
# Do not set ArtTargetIncludeDebugBuild into any value if PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD is not set,
# to have the same behavior from runtime_libart.mk.
ifneq ($(PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD),)
$(call add_json_bool, ArtTargetIncludeDebugBuild, $(PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD))
endif
_config_enable_uffd_gc := \
$(firstword $(OVERRIDE_ENABLE_UFFD_GC) $(PRODUCT_ENABLE_UFFD_GC) default)
$(call add_json_str, EnableUffdGc, $(_config_enable_uffd_gc))
_config_enable_uffd_gc :=
$(call json_end) $(call json_end)
$(file >$(SOONG_VARIABLES).tmp,$(json_contents)) $(file >$(SOONG_VARIABLES).tmp,$(json_contents))
@ -356,4 +389,6 @@ $(shell if ! cmp -s $(SOONG_VARIABLES).tmp $(SOONG_VARIABLES); then \
rm $(SOONG_VARIABLES).tmp; \ rm $(SOONG_VARIABLES).tmp; \
fi) fi)
include $(BUILD_SYSTEM)/soong_extra_config.mk
endif # CONFIGURE_SOONG endif # CONFIGURE_SOONG

108
core/soong_extra_config.mk Normal file
View file

@ -0,0 +1,108 @@
$(call json_start)
$(call add_json_str, DeviceCpuVariantRuntime, $(TARGET_CPU_VARIANT_RUNTIME))
$(call add_json_str, DeviceAbiList, $(TARGET_CPU_ABI_LIST))
$(call add_json_str, DeviceAbiList32, $(TARGET_CPU_ABI_LIST_32_BIT))
$(call add_json_str, DeviceAbiList64, $(TARGET_CPU_ABI_LIST_64_BIT))
$(call add_json_str, DeviceSecondaryCpuVariantRuntime, $(TARGET_2ND_CPU_VARIANT_RUNTIME))
$(call add_json_str, Dex2oatTargetCpuVariantRuntime, $(DEX2OAT_TARGET_CPU_VARIANT_RUNTIME))
$(call add_json_str, Dex2oatTargetInstructionSetFeatures, $(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES))
$(call add_json_str, SecondaryDex2oatCpuVariantRuntime, $($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT_RUNTIME))
$(call add_json_str, SecondaryDex2oatInstructionSetFeatures, $($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES))
$(call add_json_str, BoardPlatform, $(TARGET_BOARD_PLATFORM))
$(call add_json_str, BoardShippingApiLevel, $(BOARD_SHIPPING_API_LEVEL))
$(call add_json_str, ShippingApiLevel, $(PRODUCT_SHIPPING_API_LEVEL))
$(call add_json_str, ShippingVendorApiLevel, $(PRODUCT_SHIPPING_VENDOR_API_LEVEL))
$(call add_json_str, ProductModel, $(PRODUCT_MODEL))
$(call add_json_str, ProductModelForAttestation, $(PRODUCT_MODEL_FOR_ATTESTATION))
$(call add_json_str, ProductBrandForAttestation, $(PRODUCT_BRAND_FOR_ATTESTATION))
$(call add_json_str, ProductNameForAttestation, $(PRODUCT_NAME_FOR_ATTESTATION))
$(call add_json_str, ProductDeviceForAttestation, $(PRODUCT_DEVICE_FOR_ATTESTATION))
$(call add_json_str, ProductManufacturerForAttestation, $(PRODUCT_MANUFACTURER_FOR_ATTESTATION))
$(call add_json_str, SystemBrand, $(PRODUCT_SYSTEM_BRAND))
$(call add_json_str, SystemDevice, $(PRODUCT_SYSTEM_DEVICE))
$(call add_json_str, SystemManufacturer, $(PRODUCT_SYSTEM_MANUFACTURER))
$(call add_json_str, SystemModel, $(PRODUCT_SYSTEM_MODEL))
$(call add_json_str, SystemName, $(PRODUCT_SYSTEM_NAME))
# Collapses ?= and = operators for system property variables. Also removes double quotes to prevent
# malformed JSON. This change aligns with the existing behavior of sysprop.mk, which passes property
# variables to the echo command, effectively discarding surrounding double quotes.
define collapse-prop-pairs
$(subst ",,$(call collapse-pairs,$(call collapse-pairs,$$($(1)),?=),=))
endef
$(call add_json_list, PRODUCT_SYSTEM_PROPERTIES, $(call collapse-prop-pairs,PRODUCT_SYSTEM_PROPERTIES))
$(call add_json_list, PRODUCT_SYSTEM_DEFAULT_PROPERTIES, $(call collapse-prop-pairs,PRODUCT_SYSTEM_DEFAULT_PROPERTIES))
$(call add_json_list, PRODUCT_SYSTEM_EXT_PROPERTIES, $(call collapse-prop-pairs,PRODUCT_SYSTEM_EXT_PROPERTIES))
$(call add_json_list, PRODUCT_VENDOR_PROPERTIES, $(call collapse-prop-pairs,PRODUCT_VENDOR_PROPERTIES))
$(call add_json_list, PRODUCT_PRODUCT_PROPERTIES, $(call collapse-prop-pairs,PRODUCT_PRODUCT_PROPERTIES))
$(call add_json_list, PRODUCT_ODM_PROPERTIES, $(call collapse-prop-pairs,PRODUCT_ODM_PROPERTIES))
$(call add_json_list, PRODUCT_PROPERTY_OVERRIDES, $(call collapse-prop-pairs,PRODUCT_PROPERTY_OVERRIDES))
$(call add_json_list, PRODUCT_BUILD_PROP_OVERRIDES, $(call collapse-prop-pairs,PRODUCT_BUILD_PROP_OVERRIDES))
$(call add_json_str, BootloaderBoardName, $(TARGET_BOOTLOADER_BOARD_NAME))
$(call add_json_bool, SdkBuild, $(filter sdk sdk_addon,$(MAKECMDGOALS)))
$(call add_json_str, SystemServerCompilerFilter, $(PRODUCT_SYSTEM_SERVER_COMPILER_FILTER))
$(call add_json_bool, Product16KDeveloperOption, $(filter true,$(PRODUCT_16K_DEVELOPER_OPTION)))
$(call add_json_str, RecoveryDefaultRotation, $(TARGET_RECOVERY_DEFAULT_ROTATION))
$(call add_json_str, RecoveryOverscanPercent, $(TARGET_RECOVERY_OVERSCAN_PERCENT))
$(call add_json_str, RecoveryPixelFormat, $(TARGET_RECOVERY_PIXEL_FORMAT))
ifdef AB_OTA_UPDATER
$(call add_json_bool, AbOtaUpdater, $(filter true,$(AB_OTA_UPDATER)))
$(call add_json_str, AbOtaPartitions, $(subst $(space),$(comma),$(sort $(AB_OTA_PARTITIONS))))
endif
ifdef PRODUCT_USE_DYNAMIC_PARTITIONS
$(call add_json_bool, UseDynamicPartitions, $(filter true,$(PRODUCT_USE_DYNAMIC_PARTITIONS)))
endif
ifdef PRODUCT_RETROFIT_DYNAMIC_PARTITIONS
$(call add_json_bool, RetrofitDynamicPartitions, $(filter true,$(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS)))
endif
$(call add_json_bool, DontUseVabcOta, $(filter true,$(BOARD_DONT_USE_VABC_OTA)))
$(call add_json_bool, FullTreble, $(filter true,$(PRODUCT_FULL_TREBLE)))
$(call add_json_bool, NoBionicPageSizeMacro, $(filter true,$(PRODUCT_NO_BIONIC_PAGE_SIZE_MACRO)))
$(call add_json_bool, PropertySplitEnabled, $(filter true,$(BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED)))
$(call add_json_str, ScreenDensity, $(TARGET_SCREEN_DENSITY))
$(call add_json_bool, UsesVulkan, $(filter true,$(TARGET_USES_VULKAN)))
$(call add_json_bool, ZygoteForce64, $(filter true,$(ZYGOTE_FORCE_64)))
$(call add_json_str, VendorSecurityPatch, $(VENDOR_SECURITY_PATCH))
$(call add_json_str, VendorImageFileSystemType, $(BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE))
$(call add_json_list, BuildVersionTags, $(BUILD_VERSION_TAGS))
$(call add_json_bool, ProductNotDebuggableInUserdebug, $(PRODUCT_NOT_DEBUGGABLE_IN_USERDEBUG))
$(call add_json_bool, UsesProductImage, $(filter true,$(BOARD_USES_PRODUCTIMAGE)))
$(call add_json_bool, TargetBoots16K, $(filter true,$(TARGET_BOOTS_16K)))
$(call json_end)
$(shell mkdir -p $(dir $(SOONG_EXTRA_VARIABLES)))
$(file >$(SOONG_EXTRA_VARIABLES).tmp,$(json_contents))
$(shell if ! cmp -s $(SOONG_EXTRA_VARIABLES).tmp $(SOONG_EXTRA_VARIABLES); then \
mv $(SOONG_EXTRA_VARIABLES).tmp $(SOONG_EXTRA_VARIABLES); \
else \
rm $(SOONG_EXTRA_VARIABLES).tmp; \
fi)

View file

@ -29,38 +29,32 @@ POST_PROCESS_PROPS := $(HOST_OUT_EXECUTABLES)/post_process_props$(HOST_EXECUTABL
# $(1): Partition name # $(1): Partition name
# $(2): Output file name # $(2): Output file name
define generate-common-build-props define generate-common-build-props
bash -c '\
$(or $(PRODUCT_BUILD_PROP_OVERRIDES),:);\
echo "####################################" >> $(2);\ echo "####################################" >> $(2);\
echo "# from generate-common-build-props" >> $(2);\ echo "# from generate-common-build-props" >> $(2);\
echo "# These properties identify this partition image." >> $(2);\ echo "# These properties identify this partition image." >> $(2);\
echo "####################################" >> $(2);\ echo "####################################" >> $(2);\
$(if $(filter system,$(1)),\ echo "ro.product.$(1).brand=$(PRODUCT_BRAND)" >> $(2);\
echo "ro.product.$(1).brand=$(PRODUCT_SYSTEM_BRAND)" >> $(2);\ echo "ro.product.$(1).device=$${DeviceName:-$(TARGET_DEVICE)}" >> $(2);\
echo "ro.product.$(1).device=$(PRODUCT_SYSTEM_DEVICE)" >> $(2);\ echo "ro.product.$(1).manufacturer=$(PRODUCT_MANUFACTURER)" >> $(2);\
echo "ro.product.$(1).manufacturer=$(PRODUCT_SYSTEM_MANUFACTURER)" >> $(2);\ echo "ro.product.$(1).model=$${ProductModel:-$(PRODUCT_MODEL)}" >> $(2);\
echo "ro.product.$(1).model=$(PRODUCT_SYSTEM_MODEL)" >> $(2);\ echo "ro.product.$(1).name=$${DeviceProduct:-$(TARGET_PRODUCT)}" >> $(2);\
echo "ro.product.$(1).name=$(PRODUCT_SYSTEM_NAME)" >> $(2);\ if [ -n "$(strip $(PRODUCT_MODEL_FOR_ATTESTATION))" ]; then \
,\ echo "ro.product.model_for_attestation=$(PRODUCT_MODEL_FOR_ATTESTATION)" >> $(2);\
echo "ro.product.$(1).brand=$(PRODUCT_BRAND)" >> $(2);\ fi; \
echo "ro.product.$(1).device=$(TARGET_DEVICE)" >> $(2);\ if [ -n "$(strip $(PRODUCT_BRAND_FOR_ATTESTATION))" ]; then \
echo "ro.product.$(1).manufacturer=$(PRODUCT_MANUFACTURER)" >> $(2);\ echo "ro.product.brand_for_attestation=$(PRODUCT_BRAND_FOR_ATTESTATION)" >> $(2);\
echo "ro.product.$(1).model=$(PRODUCT_MODEL)" >> $(2);\ fi; \
echo "ro.product.$(1).name=$(TARGET_PRODUCT)" >> $(2);\ if [ -n "$(strip $(PRODUCT_NAME_FOR_ATTESTATION))" ]; then \
if [ -n "$(strip $(PRODUCT_MODEL_FOR_ATTESTATION))" ]; then \ echo "ro.product.name_for_attestation=$(PRODUCT_NAME_FOR_ATTESTATION)" >> $(2);\
echo "ro.product.model_for_attestation=$(PRODUCT_MODEL_FOR_ATTESTATION)" >> $(2);\ fi; \
fi; \ if [ -n "$(strip $(PRODUCT_DEVICE_FOR_ATTESTATION))" ]; then \
if [ -n "$(strip $(PRODUCT_BRAND_FOR_ATTESTATION))" ]; then \ echo "ro.product.device_for_attestation=$(PRODUCT_DEVICE_FOR_ATTESTATION)" >> $(2);\
echo "ro.product.brand_for_attestation=$(PRODUCT_BRAND_FOR_ATTESTATION)" >> $(2);\ fi; \
fi; \ if [ -n "$(strip $(PRODUCT_MANUFACTURER_FOR_ATTESTATION))" ]; then \
if [ -n "$(strip $(PRODUCT_NAME_FOR_ATTESTATION))" ]; then \ echo "ro.product.manufacturer_for_attestation=$(PRODUCT_MANUFACTURER_FOR_ATTESTATION)" >> $(2);\
echo "ro.product.name_for_attestation=$(PRODUCT_NAME_FOR_ATTESTATION)" >> $(2);\ fi; \
fi; \
if [ -n "$(strip $(PRODUCT_DEVICE_FOR_ATTESTATION))" ]; then \
echo "ro.product.device_for_attestation=$(PRODUCT_DEVICE_FOR_ATTESTATION)" >> $(2);\
fi; \
if [ -n "$(strip $(PRODUCT_MANUFACTURER_FOR_ATTESTATION))" ]; then \
echo "ro.product.manufacturer_for_attestation=$(PRODUCT_MANUFACTURER_FOR_ATTESTATION)" >> $(2);\
fi; \
)\
$(if $(filter true,$(ZYGOTE_FORCE_64)),\ $(if $(filter true,$(ZYGOTE_FORCE_64)),\
$(if $(filter vendor,$(1)),\ $(if $(filter vendor,$(1)),\
echo "ro.$(1).product.cpu.abilist=$(TARGET_CPU_ABI_LIST_64_BIT)" >> $(2);\ echo "ro.$(1).product.cpu.abilist=$(TARGET_CPU_ABI_LIST_64_BIT)" >> $(2);\
@ -76,10 +70,7 @@ define generate-common-build-props
)\ )\
echo "ro.$(1).build.date=`$(DATE_FROM_FILE)`" >> $(2);\ echo "ro.$(1).build.date=`$(DATE_FROM_FILE)`" >> $(2);\
echo "ro.$(1).build.date.utc=`$(DATE_FROM_FILE) +%s`" >> $(2);\ echo "ro.$(1).build.date.utc=`$(DATE_FROM_FILE) +%s`" >> $(2);\
# Allow optional assignments for ARC forward-declarations (b/249168657) echo "ro.$(1).build.fingerprint?=$${BuildFingerprint:-$(BUILD_FINGERPRINT_FROM_FILE)}" >> $(2);\
# TODO: Remove any tag-related inconsistencies once the goals from
# go/arc-android-sigprop-changes have been achieved.
echo "ro.$(1).build.fingerprint?=$(BUILD_FINGERPRINT_FROM_FILE)" >> $(2);\
echo "ro.$(1).build.id?=$(BUILD_ID)" >> $(2);\ echo "ro.$(1).build.id?=$(BUILD_ID)" >> $(2);\
echo "ro.$(1).build.tags?=$(BUILD_VERSION_TAGS)" >> $(2);\ echo "ro.$(1).build.tags?=$(BUILD_VERSION_TAGS)" >> $(2);\
echo "ro.$(1).build.type=$(TARGET_BUILD_VARIANT)" >> $(2);\ echo "ro.$(1).build.type=$(TARGET_BUILD_VARIANT)" >> $(2);\
@ -87,6 +78,7 @@ define generate-common-build-props
echo "ro.$(1).build.version.release=$(PLATFORM_VERSION_LAST_STABLE)" >> $(2);\ echo "ro.$(1).build.version.release=$(PLATFORM_VERSION_LAST_STABLE)" >> $(2);\
echo "ro.$(1).build.version.release_or_codename=$(PLATFORM_VERSION)" >> $(2);\ echo "ro.$(1).build.version.release_or_codename=$(PLATFORM_VERSION)" >> $(2);\
echo "ro.$(1).build.version.sdk=$(PLATFORM_SDK_VERSION)" >> $(2);\ echo "ro.$(1).build.version.sdk=$(PLATFORM_SDK_VERSION)" >> $(2);\
';\
endef endef
@ -226,50 +218,11 @@ KNOWN_OEM_THUMBPRINT_PROPERTIES:=
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# system/build.prop # system/build.prop
# #
# Note: parts of this file that can't be generated by the build-properties # system/build.prop is built by Soong. See system-build.prop module in
# macro are manually created as separate files and then fed into the macro # build/soong/Android.bp.
buildinfo_prop := $(call intermediates-dir-for,ETC,buildinfo.prop)/buildinfo.prop
ifdef TARGET_SYSTEM_PROP
system_prop_file := $(TARGET_SYSTEM_PROP)
else
system_prop_file := $(wildcard $(TARGET_DEVICE_DIR)/system.prop)
endif
_prop_files_ := \
$(buildinfo_prop) \
$(system_prop_file)
# Order matters here. When there are duplicates, the last one wins.
# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
_prop_vars_ := \
ADDITIONAL_SYSTEM_PROPERTIES \
PRODUCT_SYSTEM_PROPERTIES
# TODO(b/117892318): deprecate this
_prop_vars_ += \
PRODUCT_SYSTEM_DEFAULT_PROPERTIES
ifndef property_overrides_split_enabled
_prop_vars_ += \
ADDITIONAL_VENDOR_PROPERTIES \
PRODUCT_VENDOR_PROPERTIES
endif
INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop
$(eval $(call build-properties,\
system,\
$(INSTALLED_BUILD_PROP_TARGET),\
$(_prop_files_),\
$(_prop_vars_),\
$(PRODUCT_SYSTEM_PROPERTY_BLACKLIST),\
$(empty),\
$(empty)))
$(eval $(call declare-1p-target,$(INSTALLED_BUILD_PROP_TARGET)))
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# vendor/build.prop # vendor/build.prop
# #
@ -313,83 +266,18 @@ $(eval $(call declare-1p-target,$(INSTALLED_VENDOR_BUILD_PROP_TARGET)))
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# product/etc/build.prop # product/etc/build.prop
# #
# product/etc/build.prop is built by Soong. See product-build.prop module in
_prop_files_ := $(if $(TARGET_PRODUCT_PROP),\ # build/soong/Android.bp.
$(TARGET_PRODUCT_PROP),\
$(wildcard $(TARGET_DEVICE_DIR)/product.prop))
# Order matters here. When there are duplicates, the last one wins.
# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
_prop_vars_ := \
ADDITIONAL_PRODUCT_PROPERTIES \
PRODUCT_PRODUCT_PROPERTIES
INSTALLED_PRODUCT_BUILD_PROP_TARGET := $(TARGET_OUT_PRODUCT)/etc/build.prop INSTALLED_PRODUCT_BUILD_PROP_TARGET := $(TARGET_OUT_PRODUCT)/etc/build.prop
ifdef PRODUCT_OEM_PROPERTIES
import_oem_prop := $(call intermediates-dir-for,ETC,import_oem_prop)/oem.prop
$(import_oem_prop):
$(hide) echo "####################################" >> $@; \
echo "# PRODUCT_OEM_PROPERTIES" >> $@; \
echo "####################################" >> $@;
$(hide) $(foreach prop,$(PRODUCT_OEM_PROPERTIES), \
echo "import /oem/oem.prop $(prop)" >> $@;)
_footers_ := $(import_oem_prop)
else
_footers_ :=
endif
# Skip common /product properties generation if device released before R and
# has no product partition. This is the first part of the check.
ifeq ($(call math_lt,$(if $(PRODUCT_SHIPPING_API_LEVEL),$(PRODUCT_SHIPPING_API_LEVEL),30),30), true)
_skip_common_properties := true
endif
# The second part of the check - always generate common properties for the
# devices with product partition regardless of shipping level.
ifneq ($(BOARD_USES_PRODUCTIMAGE),)
_skip_common_properties :=
endif
$(eval $(call build-properties,\
product,\
$(INSTALLED_PRODUCT_BUILD_PROP_TARGET),\
$(_prop_files_),\
$(_prop_vars_),\
$(empty),\
$(_footers_),\
$(_skip_common_properties)))
$(eval $(call declare-1p-target,$(INSTALLED_PRODUCT_BUILD_PROP_TARGET)))
_skip_common_properties :=
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# odm/etc/build.prop # odm/etc/build.prop
# #
_prop_files_ := $(if $(TARGET_ODM_PROP),\ # odm/etc/build.prop is built by Soong. See odm-build.prop module in
$(TARGET_ODM_PROP),\ # build/soong/Android.bp.
$(wildcard $(TARGET_DEVICE_DIR)/odm.prop))
# Order matters here. When there are duplicates, the last one wins.
# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
_prop_vars_ := \
ADDITIONAL_ODM_PROPERTIES \
PRODUCT_ODM_PROPERTIES
INSTALLED_ODM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM)/etc/build.prop INSTALLED_ODM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM)/etc/build.prop
$(eval $(call build-properties,\
odm,\
$(INSTALLED_ODM_BUILD_PROP_TARGET),\
$(_prop_files_),\
$(_prop_vars_),\
$(empty),\
$(empty),\
$(empty)))
$(eval $(call declare-1p-target,$(INSTALLED_ODM_BUILD_PROP_TARGET)))
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# vendor_dlkm/etc/build.prop # vendor_dlkm/etc/build.prop
@ -442,25 +330,10 @@ $(eval $(call declare-1p-target,$(INSTALLED_SYSTEM_DLKM_BUILD_PROP_TARGET)))
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# system_ext/etc/build.prop # system_ext/etc/build.prop
# #
_prop_files_ := $(if $(TARGET_SYSTEM_EXT_PROP),\ # system_ext/etc/build.prop is built by Soong. See system-build.prop module in
$(TARGET_SYSTEM_EXT_PROP),\ # build/soong/Android.bp.
$(wildcard $(TARGET_DEVICE_DIR)/system_ext.prop))
# Order matters here. When there are duplicates, the last one wins.
# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
_prop_vars_ := PRODUCT_SYSTEM_EXT_PROPERTIES
INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET := $(TARGET_OUT_SYSTEM_EXT)/etc/build.prop INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET := $(TARGET_OUT_SYSTEM_EXT)/etc/build.prop
$(eval $(call build-properties,\
system_ext,\
$(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET),\
$(_prop_files_),\
$(_prop_vars_),\
$(empty),\
$(empty),\
$(empty)))
$(eval $(call declare-1p-target,$(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET)))
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# ramdisk/boot/etc/build.prop # ramdisk/boot/etc/build.prop

View file

@ -15,57 +15,9 @@ $(foreach name, $(_additional_prop_var_names),\
) )
_additional_prop_var_names := _additional_prop_var_names :=
# $(KATI_obsolete_var ADDITIONAL_SYSTEM_PROPERTIES,Use build/soong/scripts/gen_build_prop.py instead)
# ----------------------------------------------------------------- $(KATI_obsolete_var ADDITIONAL_ODM_PROPERTIES,Use build/soong/scripts/gen_build_prop.py instead)
# Add the product-defined properties to the build properties. $(KATI_obsolete_var ADDITIONAL_PRODUCT_PROPERTIES,Use build/soong/scripts/gen_build_prop.py instead)
ifneq ($(BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED), true)
ADDITIONAL_SYSTEM_PROPERTIES += $(PRODUCT_PROPERTY_OVERRIDES)
else
ifndef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
ADDITIONAL_SYSTEM_PROPERTIES += $(PRODUCT_PROPERTY_OVERRIDES)
endif
endif
ADDITIONAL_SYSTEM_PROPERTIES += ro.treble.enabled=${PRODUCT_FULL_TREBLE}
# Set ro.llndk.api_level to show the maximum vendor API level that the LLNDK in
# the system partition supports.
ifdef RELEASE_BOARD_API_LEVEL
ADDITIONAL_SYSTEM_PROPERTIES += ro.llndk.api_level=$(RELEASE_BOARD_API_LEVEL)
endif
# Sets ro.actionable_compatible_property.enabled to know on runtime whether the
# allowed list of actionable compatible properties is enabled or not.
ADDITIONAL_SYSTEM_PROPERTIES += ro.actionable_compatible_property.enabled=true
# Add the system server compiler filter if they are specified for the product.
ifneq (,$(PRODUCT_SYSTEM_SERVER_COMPILER_FILTER))
ADDITIONAL_PRODUCT_PROPERTIES += dalvik.vm.systemservercompilerfilter=$(PRODUCT_SYSTEM_SERVER_COMPILER_FILTER)
endif
# Add the 16K developer option if it is defined for the product.
ifeq ($(PRODUCT_16K_DEVELOPER_OPTION),true)
ADDITIONAL_PRODUCT_PROPERTIES += ro.product.build.16k_page.enabled=true
else
ADDITIONAL_PRODUCT_PROPERTIES += ro.product.build.16k_page.enabled=false
endif
# Enable core platform API violation warnings on userdebug and eng builds.
ifneq ($(TARGET_BUILD_VARIANT),user)
ADDITIONAL_SYSTEM_PROPERTIES += persist.debug.dalvik.vm.core_platform_api_policy=just-warn
endif
# Define ro.sanitize.<name> properties for all global sanitizers.
ADDITIONAL_SYSTEM_PROPERTIES += $(foreach s,$(SANITIZE_TARGET),ro.sanitize.$(s)=true)
# Sets the default value of ro.postinstall.fstab.prefix to /system.
# Device board config should override the value to /product when needed by:
#
# PRODUCT_PRODUCT_PROPERTIES += ro.postinstall.fstab.prefix=/product
#
# It then uses ${ro.postinstall.fstab.prefix}/etc/fstab.postinstall to
# mount system_other partition.
ADDITIONAL_SYSTEM_PROPERTIES += ro.postinstall.fstab.prefix=/system
# Add cpu properties for bionic and ART. # Add cpu properties for bionic and ART.
ADDITIONAL_VENDOR_PROPERTIES += ro.bionic.arch=$(TARGET_ARCH) ADDITIONAL_VENDOR_PROPERTIES += ro.bionic.arch=$(TARGET_ARCH)
@ -178,118 +130,16 @@ ADDITIONAL_VENDOR_PROPERTIES += \
ro.build.ab_update=$(AB_OTA_UPDATER) ro.build.ab_update=$(AB_OTA_UPDATER)
endif endif
ADDITIONAL_PRODUCT_PROPERTIES += ro.build.characteristics=$(TARGET_AAPT_CHARACTERISTICS)
ifeq ($(AB_OTA_UPDATER),true) ifeq ($(AB_OTA_UPDATER),true)
ADDITIONAL_PRODUCT_PROPERTIES += ro.product.ab_ota_partitions=$(subst $(space),$(comma),$(sort $(AB_OTA_PARTITIONS)))
ADDITIONAL_VENDOR_PROPERTIES += ro.vendor.build.ab_ota_partitions=$(subst $(space),$(comma),$(sort $(AB_OTA_PARTITIONS))) ADDITIONAL_VENDOR_PROPERTIES += ro.vendor.build.ab_ota_partitions=$(subst $(space),$(comma),$(sort $(AB_OTA_PARTITIONS)))
endif endif
# Set this property for VTS to skip large page size tests on unsupported devices.
ADDITIONAL_PRODUCT_PROPERTIES += \
ro.product.cpu.pagesize.max=$(TARGET_MAX_PAGE_SIZE_SUPPORTED)
ifeq ($(PRODUCT_NO_BIONIC_PAGE_SIZE_MACRO),true)
ADDITIONAL_PRODUCT_PROPERTIES += ro.product.build.no_bionic_page_size_macro=true
endif
user_variant := $(filter user userdebug,$(TARGET_BUILD_VARIANT)) user_variant := $(filter user userdebug,$(TARGET_BUILD_VARIANT))
enable_target_debugging := true
enable_dalvik_lock_contention_logging := true
ifneq (,$(user_variant))
# Target is secure in user builds.
ADDITIONAL_SYSTEM_PROPERTIES += ro.secure=1
ADDITIONAL_SYSTEM_PROPERTIES += security.perf_harden=1
ifeq ($(user_variant),user)
ADDITIONAL_SYSTEM_PROPERTIES += ro.adb.secure=1
endif
ifneq ($(user_variant),userdebug)
# Disable debugging in plain user builds.
enable_target_debugging :=
enable_dalvik_lock_contention_logging :=
else
# Disable debugging in userdebug builds if PRODUCT_NOT_DEBUGGABLE_IN_USERDEBUG
# is set.
ifneq (,$(strip $(PRODUCT_NOT_DEBUGGABLE_IN_USERDEBUG)))
enable_target_debugging :=
endif
endif
# Disallow mock locations by default for user builds
ADDITIONAL_SYSTEM_PROPERTIES += ro.allow.mock.location=0
else # !user_variant
# Turn on checkjni for non-user builds.
ADDITIONAL_SYSTEM_PROPERTIES += ro.kernel.android.checkjni=1
# Set device insecure for non-user builds.
ADDITIONAL_SYSTEM_PROPERTIES += ro.secure=0
# Allow mock locations by default for non user builds
ADDITIONAL_SYSTEM_PROPERTIES += ro.allow.mock.location=1
endif # !user_variant
ifeq (true,$(strip $(enable_dalvik_lock_contention_logging)))
# Enable Dalvik lock contention logging.
ADDITIONAL_SYSTEM_PROPERTIES += dalvik.vm.lockprof.threshold=500
endif # !enable_dalvik_lock_contention_logging
ifeq (true,$(strip $(enable_target_debugging)))
# Target is more debuggable and adbd is on by default
ADDITIONAL_SYSTEM_PROPERTIES += ro.debuggable=1
else # !enable_target_debugging
# Target is less debuggable and adbd is off by default
ADDITIONAL_SYSTEM_PROPERTIES += ro.debuggable=0
endif # !enable_target_debugging
enable_target_debugging:=
enable_dalvik_lock_contention_logging:=
ifneq ($(filter sdk sdk_addon,$(MAKECMDGOALS)),)
_is_sdk_build := true
endif
ifeq ($(TARGET_BUILD_VARIANT),eng)
ifneq ($(filter ro.setupwizard.mode=ENABLED, $(call collapse-pairs, $(ADDITIONAL_SYSTEM_PROPERTIES))),)
# Don't require the setup wizard on eng builds
ADDITIONAL_SYSTEM_PROPERTIES := $(filter-out ro.setupwizard.mode=%,\
$(call collapse-pairs, $(ADDITIONAL_SYSTEM_PROPERTIES))) \
ro.setupwizard.mode=OPTIONAL
endif
ifndef _is_sdk_build
# To speedup startup of non-preopted builds, don't verify or compile the boot image.
ADDITIONAL_SYSTEM_PROPERTIES += dalvik.vm.image-dex2oat-filter=extract
endif
# b/323566535
ADDITIONAL_SYSTEM_PROPERTIES += init.svc_debug.no_fatal.zygote=true
endif
ifdef _is_sdk_build
ADDITIONAL_SYSTEM_PROPERTIES += xmpp.auto-presence=true
ADDITIONAL_SYSTEM_PROPERTIES += ro.config.nocheckin=yes
endif
_is_sdk_build :=
ADDITIONAL_SYSTEM_PROPERTIES += net.bt.name=Android
# This property is set by flashing debug boot image, so default to false.
ADDITIONAL_SYSTEM_PROPERTIES += ro.force.debuggable=0
config_enable_uffd_gc := \ config_enable_uffd_gc := \
$(firstword $(OVERRIDE_ENABLE_UFFD_GC) $(PRODUCT_ENABLE_UFFD_GC) default) $(firstword $(OVERRIDE_ENABLE_UFFD_GC) $(PRODUCT_ENABLE_UFFD_GC) default)
# This is a temporary system property that controls the ART module. The plan is
# to remove it by Aug 2025, at which time Mainline updates of the ART module
# will ignore it as well.
# If the value is "default", it will be mangled by post_process_props.py.
ADDITIONAL_PRODUCT_PROPERTIES += ro.dalvik.vm.enable_uffd_gc=$(config_enable_uffd_gc)
ADDITIONAL_SYSTEM_PROPERTIES := $(strip $(ADDITIONAL_SYSTEM_PROPERTIES))
ADDITIONAL_PRODUCT_PROPERTIES := $(strip $(ADDITIONAL_PRODUCT_PROPERTIES))
ADDITIONAL_VENDOR_PROPERTIES := $(strip $(ADDITIONAL_VENDOR_PROPERTIES)) ADDITIONAL_VENDOR_PROPERTIES := $(strip $(ADDITIONAL_VENDOR_PROPERTIES))
.KATI_READONLY += \ .KATI_READONLY += \
ADDITIONAL_SYSTEM_PROPERTIES \
ADDITIONAL_PRODUCT_PROPERTIES \
ADDITIONAL_VENDOR_PROPERTIES ADDITIONAL_VENDOR_PROPERTIES

View file

@ -522,11 +522,11 @@ function _lunch_meat()
# Note this is the string "release", not the value of the variable. # Note this is the string "release", not the value of the variable.
export TARGET_BUILD_TYPE=release export TARGET_BUILD_TYPE=release
local uses_qcom_hardware=$(get_build_var BOARD_USES_QCOM_HARDWARE) local no_kernel=$(_get_build_var_cached TARGET_NO_KERNEL)
if [ "$uses_qcom_hardware" = true ]; then if [[ "$no_kernel" == "true" ]]; then
export INLINE_KERNEL_BUILDING=true unset INLINE_KERNEL_BUILDING
else else
unset INLINE_KERNEL_BUILDING export INLINE_KERNEL_BUILDING=true
fi fi
[[ -n "${ANDROID_QUIET_BUILD:-}" ]] || echo [[ -n "${ANDROID_QUIET_BUILD:-}" ]] || echo
@ -536,7 +536,7 @@ function _lunch_meat()
set_stuff_for_environment set_stuff_for_environment
[[ -n "${ANDROID_QUIET_BUILD:-}" ]] || printconfig [[ -n "${ANDROID_QUIET_BUILD:-}" ]] || printconfig
if [[ -z "${ANDROID_QUIET_BUILD}" && -z "${CALYX_BUILD}" ]]; then if [[ -z "${ANDROID_QUIET_BUILD}" && -z "${TEQUILA_BUILD}" ]]; then
local spam_for_lunch=$(gettop)/build/make/tools/envsetup/spam_for_lunch local spam_for_lunch=$(gettop)/build/make/tools/envsetup/spam_for_lunch
if [[ -x $spam_for_lunch ]]; then if [[ -x $spam_for_lunch ]]; then
$spam_for_lunch $spam_for_lunch

View file

@ -114,11 +114,11 @@ function _wrap_build()
echo -n "${color_failed}#### failed to build some targets " echo -n "${color_failed}#### failed to build some targets "
fi fi
if [ $hours -gt 0 ] ; then if [ $hours -gt 0 ] ; then
printf "(%02g:%02g:%02g (hh:mm:ss))" $hours $mins $secs printf "(%02d:%02d:%02d (hh:mm:ss))" $hours $mins $secs
elif [ $mins -gt 0 ] ; then elif [ $mins -gt 0 ] ; then
printf "(%02g:%02g (mm:ss))" $mins $secs printf "(%02d:%02d (mm:ss))" $mins $secs
elif [ $secs -gt 0 ] ; then elif [ $secs -gt 0 ] ; then
printf "(%s seconds)" $secs printf "(%d seconds)" $secs
fi fi
echo " ####${color_reset}" echo " ####${color_reset}"
echo echo

View file

@ -9,8 +9,6 @@ include build/make/target/product/build_variables.mk
TARGET_NO_BOOTLOADER := true TARGET_NO_BOOTLOADER := true
TARGET_NO_RECOVERY := true TARGET_NO_RECOVERY := true
BOARD_EXT4_SHARE_DUP_BLOCKS := true
TARGET_USERIMAGES_USE_EXT4 := true TARGET_USERIMAGES_USE_EXT4 := true
# Mainline devices must have /system_ext, /vendor and /product partitions. # Mainline devices must have /system_ext, /vendor and /product partitions.

View file

@ -19,7 +19,9 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_product.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_product.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_product.mk)
# Default AOSP sounds # Default AOSP sounds
ifeq ($(TEQUILA_BUILD),)
$(call inherit-product-if-exists, frameworks/base/data/sounds/AllAudio.mk) $(call inherit-product-if-exists, frameworks/base/data/sounds/AllAudio.mk)
endif
# Additional settings used in all AOSP builds # Additional settings used in all AOSP builds
PRODUCT_PRODUCT_PROPERTIES += \ PRODUCT_PRODUCT_PROPERTIES += \

View file

@ -25,3 +25,4 @@ PRODUCT_PACKAGES += \
product_compatibility_matrix.xml \ product_compatibility_matrix.xml \
product_manifest.xml \ product_manifest.xml \
selinux_policy_product \ selinux_policy_product \
product-build.prop \

View file

@ -279,6 +279,7 @@ PRODUCT_PACKAGES += \
storaged \ storaged \
surfaceflinger \ surfaceflinger \
svc \ svc \
system-build.prop \
task_profiles.json \ task_profiles.json \
tc \ tc \
telecom \ telecom \
@ -471,7 +472,6 @@ PRODUCT_PACKAGES_DEBUG := \
ss \ ss \
start_with_lockagent \ start_with_lockagent \
strace \ strace \
su \
sanitizer-status \ sanitizer-status \
tracepath \ tracepath \
tracepath6 \ tracepath6 \
@ -480,6 +480,11 @@ PRODUCT_PACKAGES_DEBUG := \
unwind_reg_info \ unwind_reg_info \
unwind_symbols \ unwind_symbols \
ifeq ($(TEQUILA_BUILD),)
PRODUCT_PACKAGES_DEBUG += \
su
endif
# The set of packages whose code can be loaded by the system server. # The set of packages whose code can be loaded by the system server.
PRODUCT_SYSTEM_SERVER_APPS += \ PRODUCT_SYSTEM_SERVER_APPS += \
SettingsProvider \ SettingsProvider \

View file

@ -24,6 +24,7 @@ PRODUCT_PACKAGES += \
SatelliteClient \ SatelliteClient \
selinux_policy_system_ext \ selinux_policy_system_ext \
system_ext_manifest.xml \ system_ext_manifest.xml \
system_ext-build.prop \
# Base modules when shipping api level is less than or equal to 34 # Base modules when shipping api level is less than or equal to 34
PRODUCT_PACKAGES_SHIPPING_API_LEVEL_34 += \ PRODUCT_PACKAGES_SHIPPING_API_LEVEL_34 += \

View file

@ -72,6 +72,7 @@ PRODUCT_PACKAGES += \
passwd_vendor \ passwd_vendor \
selinux_policy_nonsystem \ selinux_policy_nonsystem \
shell_and_utilities_vendor \ shell_and_utilities_vendor \
odm-build.prop \
# Base modules when shipping api level is less than or equal to 34 # Base modules when shipping api level is less than or equal to 34
PRODUCT_PACKAGES_SHIPPING_API_LEVEL_34 += \ PRODUCT_PACKAGES_SHIPPING_API_LEVEL_34 += \

View file

@ -45,7 +45,9 @@ PRODUCT_VENDOR_PROPERTIES := \
PRODUCT_LOCALES := en_US PRODUCT_LOCALES := en_US
# Get some sounds # Get some sounds
ifeq ($(TEQUILA_BUILD),)
$(call inherit-product-if-exists, frameworks/base/data/sounds/AllAudio.mk) $(call inherit-product-if-exists, frameworks/base/data/sounds/AllAudio.mk)
endif
# Get a list of languages. # Get a list of languages.
$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk)

View file

@ -28,12 +28,16 @@ PRODUCT_PACKAGES += \
Contacts \ Contacts \
DeskClock \ DeskClock \
Gallery2 \ Gallery2 \
LatinIME \
Music \ Music \
preinstalled-packages-platform-handheld-product.xml \ preinstalled-packages-platform-handheld-product.xml \
QuickSearchBox \ QuickSearchBox \
SettingsIntelligence \ SettingsIntelligence \
frameworks-base-overlays frameworks-base-overlays
ifeq ($(TEQUILA_BUILD),)
PRODUCT_PACKAGES += \
LatinIME
endif
PRODUCT_PACKAGES_DEBUG += \ PRODUCT_PACKAGES_DEBUG += \
frameworks-base-overlays-debug frameworks-base-overlays-debug

View file

@ -69,7 +69,6 @@ PRODUCT_PACKAGES += \
Telecom \ Telecom \
TelephonyProvider \ TelephonyProvider \
TeleService \ TeleService \
Traceur \
UserDictionaryProvider \ UserDictionaryProvider \
VpnDialogs \ VpnDialogs \
vr \ vr \
@ -95,3 +94,7 @@ PRODUCT_VENDOR_PROPERTIES += \
ro.carrier?=unknown \ ro.carrier?=unknown \
ro.config.notification_sound?=OnTheHunt.ogg \ ro.config.notification_sound?=OnTheHunt.ogg \
ro.config.alarm_alert?=Alarm_Classic.ogg ro.config.alarm_alert?=Alarm_Classic.ogg
# Traceur for debug only
PRODUCT_PACKAGES_ENG += \
Traceur

View file

@ -30,9 +30,11 @@ fn read_partition_paths() -> Vec<PathBuf> {
.collect() .collect()
} }
/// Determine all paths that contain an aconfig protobuf file. /// Determines all paths that contain an aconfig protobuf file,
/// filtering out nonexistent partition protobuf files.
pub fn parsed_flags_proto_paths() -> Result<Vec<PathBuf>> { pub fn parsed_flags_proto_paths() -> Result<Vec<PathBuf>> {
let mut result: Vec<PathBuf> = read_partition_paths(); let mut result: Vec<PathBuf> =
read_partition_paths().into_iter().filter(|s| s.exists()).collect();
for dir in fs::read_dir("/apex")? { for dir in fs::read_dir("/apex")? {
let dir = dir?; let dir = dir?;

View file

@ -339,15 +339,11 @@ locate(FileRecord* rec, const vector<string>& search)
} }
int err; int err;
string full;
for (vector<string>::const_iterator it=search.begin(); for (vector<string>::const_iterator it=search.begin();
it!=search.end(); it++) { it!=search.end(); it++) {
string full = path_append(*it, rec->sourceName);
struct stat st; struct stat st;
if (rec->sourceName.length() != 0 && rec->sourceName[0] == '/')
full = rec->sourceName;
else
full = path_append(*it, rec->sourceName);
err = stat(full.c_str(), &st); err = stat(full.c_str(), &st);
if (err == 0) { if (err == 0) {
rec->sourceBase = *it; rec->sourceBase = *it;
@ -360,7 +356,7 @@ locate(FileRecord* rec, const vector<string>& search)
} }
fprintf(stderr, "%s:%d: couldn't locate source file: %s\n", fprintf(stderr, "%s:%d: couldn't locate source file: %s\n",
rec->listFile.c_str(), rec->listLine, full.c_str()); rec->listFile.c_str(), rec->listLine, rec->sourceName.c_str());
return 1; return 1;
} }

View file

@ -787,9 +787,16 @@ def AddSuperEmpty(output_zip):
img = OutputFile(output_zip, OPTIONS.input_tmp, "IMAGES", "super_empty.img") img = OutputFile(output_zip, OPTIONS.input_tmp, "IMAGES", "super_empty.img")
if os.path.exists(img.name): if os.path.exists(img.name):
logger.info("super_empty.img already exists; no need to rebuild...") logger.info("super_empty.img already exists; no need to rebuild...")
return else:
build_super_image.BuildSuperImage(OPTIONS.info_dict, img.name) build_super_image.BuildSuperImage(OPTIONS.info_dict, img.name)
img.Write() img.Write()
unsparse_img = OutputFile(output_zip, OPTIONS.input_tmp, "IMAGES", "unsparse_super_empty.img")
if os.path.exists(unsparse_img.name):
logger.info("unsparse_super_empty.img already exists; no need to rebuild...")
else:
build_super_image.BuildSuperImage(OPTIONS.info_dict, unsparse_img.name, force_non_sparse=True)
unsparse_img.Write()
def AddSuperSplit(output_zip): def AddSuperSplit(output_zip):

View file

@ -312,7 +312,7 @@ def BuildImageMkfs(in_dir, prop_dict, out_file, target_out, fs_config):
base_fs_file = ConvertBlockMapToBaseFs(prop_dict["base_fs_file"]) base_fs_file = ConvertBlockMapToBaseFs(prop_dict["base_fs_file"])
build_command.extend(["-d", base_fs_file]) build_command.extend(["-d", base_fs_file])
build_command.extend(["-L", prop_dict["mount_point"]]) build_command.extend(["-L", prop_dict["mount_point"]])
if "extfs_inode_count" in prop_dict: if "extfs_inode_count" in prop_dict and int(prop_dict["extfs_inode_count"]) >= 0:
build_command.extend(["-i", prop_dict["extfs_inode_count"]]) build_command.extend(["-i", prop_dict["extfs_inode_count"]])
if "extfs_rsv_pct" in prop_dict: if "extfs_rsv_pct" in prop_dict:
build_command.extend(["-M", prop_dict["extfs_rsv_pct"]]) build_command.extend(["-M", prop_dict["extfs_rsv_pct"]])
@ -606,19 +606,20 @@ def BuildImage(in_dir, prop_dict, out_file, target_out=None):
size = common.RoundUpTo4K(size) size = common.RoundUpTo4K(size)
else: else:
size = ((size + block_size - 1) // block_size) * block_size size = ((size + block_size - 1) // block_size) * block_size
extfs_inode_count = prop_dict["extfs_inode_count"] if int(prop_dict["extfs_inode_count"]) >= 0:
inodes = int(fs_dict.get("Inode count", extfs_inode_count)) extfs_inode_count = prop_dict["extfs_inode_count"]
inodes -= int(fs_dict.get("Free inodes", "0")) inodes = int(fs_dict.get("Inode count", extfs_inode_count))
# add .2% margin or 1 inode, whichever is greater inodes -= int(fs_dict.get("Free inodes", "0"))
spare_inodes = inodes * 2 // 1000 # add .2% margin or 1 inode, whichever is greater
min_spare_inodes = 1 spare_inodes = inodes * 2 // 1000
if spare_inodes < min_spare_inodes: min_spare_inodes = 1
spare_inodes = min_spare_inodes if spare_inodes < min_spare_inodes:
inodes += spare_inodes spare_inodes = min_spare_inodes
prop_dict["extfs_inode_count"] = str(inodes) inodes += spare_inodes
prop_dict["extfs_inode_count"] = str(inodes)
logger.info(
"Allocating %d Inodes for %s.", inodes, out_file)
prop_dict["partition_size"] = str(size) prop_dict["partition_size"] = str(size)
logger.info(
"Allocating %d Inodes for %s.", inodes, out_file)
elif fs_type.startswith("f2fs") and prop_dict.get("f2fs_compress") == "true": elif fs_type.startswith("f2fs") and prop_dict.get("f2fs_compress") == "true":
prop_dict["partition_size"] = str(size) prop_dict["partition_size"] = str(size)
prop_dict["image_size"] = str(size) prop_dict["image_size"] = str(size)

View file

@ -62,14 +62,14 @@ def GetArgumentsForImage(partition, group, image=None):
image_size = sparse_img.GetImagePartitionSize(image) if image else 0 image_size = sparse_img.GetImagePartitionSize(image) if image else 0
cmd = ["--partition", cmd = ["--partition",
"{}:readonly:{}:{}".format(partition, image_size, group)] "{}:none:{}:{}".format(partition, image_size, group)]
if image: if image:
cmd += ["--image", "{}={}".format(partition, image)] cmd += ["--image", "{}={}".format(partition, image)]
return cmd return cmd
def BuildSuperImageFromDict(info_dict, output): def BuildSuperImageFromDict(info_dict, output, force_non_sparse=False):
cmd = [info_dict["lpmake"], cmd = [info_dict["lpmake"],
"--metadata-size", "65536", "--metadata-size", "65536",
@ -133,7 +133,7 @@ def BuildSuperImageFromDict(info_dict, output):
cmd += GetArgumentsForImage(partition + "_b", group + "_b", other_image) cmd += GetArgumentsForImage(partition + "_b", group + "_b", other_image)
if info_dict.get("build_non_sparse_super_partition") != "true": if info_dict.get("build_non_sparse_super_partition") != "true" and not force_non_sparse:
cmd.append("--sparse") cmd.append("--sparse")
cmd += ["--output", output] cmd += ["--output", output]
@ -178,11 +178,11 @@ def BuildSuperImageFromTargetFiles(inp, out):
return BuildSuperImageFromExtractedTargetFiles(input_tmp, out) return BuildSuperImageFromExtractedTargetFiles(input_tmp, out)
def BuildSuperImage(inp, out): def BuildSuperImage(inp, out, force_non_sparse=False):
if isinstance(inp, dict): if isinstance(inp, dict):
logger.info("Building super image from info dict...") logger.info("Building super image from info dict...")
return BuildSuperImageFromDict(inp, out) return BuildSuperImageFromDict(inp, out, force_non_sparse=False)
if isinstance(inp, str): if isinstance(inp, str):
if os.path.isdir(inp): if os.path.isdir(inp):

View file

@ -445,7 +445,7 @@ class BuildInfo(object):
"system_other"] = self._partition_fingerprints["system"] "system_other"] = self._partition_fingerprints["system"]
# These two should be computed only after setting self._oem_props. # These two should be computed only after setting self._oem_props.
self._device = self.GetOemProperty("ro.product.device") self._device = info_dict.get("ota_override_device", self.GetOemProperty("ro.product.device"))
self._fingerprint = self.CalculateFingerprint() self._fingerprint = self.CalculateFingerprint()
check_fingerprint(self._fingerprint) check_fingerprint(self._fingerprint)
@ -675,7 +675,7 @@ class BuildInfo(object):
return self.GetBuildProp(key) return self.GetBuildProp(key)
def GetPartitionFingerprint(self, partition): def GetPartitionFingerprint(self, partition):
return self._partition_fingerprints.get(partition, None) return self._partition_fingerprints.get(partition, self.CalculateFingerprint())
def CalculatePartitionFingerprint(self, partition): def CalculatePartitionFingerprint(self, partition):
try: try:
@ -832,11 +832,14 @@ def ExtractFromInputFile(input_file, fn):
class RamdiskFormat(object): class RamdiskFormat(object):
LZ4 = 1 LZ4 = 1
GZ = 2 GZ = 2
XZ = 3
def GetRamdiskFormat(info_dict): def GetRamdiskFormat(info_dict):
if info_dict.get('lz4_ramdisks') == 'true': if info_dict.get('lz4_ramdisks') == 'true':
ramdisk_format = RamdiskFormat.LZ4 ramdisk_format = RamdiskFormat.LZ4
elif info_dict.get('xz_ramdisks') == 'true':
ramdisk_format = RamdiskFormat.XZ
else: else:
ramdisk_format = RamdiskFormat.GZ ramdisk_format = RamdiskFormat.GZ
return ramdisk_format return ramdisk_format
@ -942,7 +945,11 @@ def LoadInfoDict(input_file, repacking=False):
makeint(b.replace(".img", "_size")) makeint(b.replace(".img", "_size"))
# Load recovery fstab if applicable. # Load recovery fstab if applicable.
d["fstab"] = _FindAndLoadRecoveryFstab(d, input_file, read_helper) if isinstance(input_file, str) and zipfile.is_zipfile(input_file):
with zipfile.ZipFile(input_file, 'r', allowZip64=True) as input_zip:
d["fstab"] = _FindAndLoadRecoveryFstab(d, input_zip, read_helper)
else:
d["fstab"] = _FindAndLoadRecoveryFstab(d, input_file, read_helper)
ramdisk_format = GetRamdiskFormat(d) ramdisk_format = GetRamdiskFormat(d)
# Tries to load the build props for all partitions with care_map, including # Tries to load the build props for all partitions with care_map, including
@ -1221,9 +1228,10 @@ def LoadRecoveryFSTab(read_helper, fstab_version, recovery_fstab_path):
context = i context = i
mount_point = pieces[1] mount_point = pieces[1]
d[mount_point] = Partition(mount_point=mount_point, fs_type=pieces[2], if not d.get(mount_point):
device=pieces[0], length=length, context=context, d[mount_point] = Partition(mount_point=mount_point, fs_type=pieces[2],
slotselect=slotselect) device=pieces[0], length=length, context=context,
slotselect=slotselect)
return d return d
@ -1673,10 +1681,13 @@ def _MakeRamdisk(sourcedir, fs_config_file=None,
if ramdisk_format == RamdiskFormat.LZ4: if ramdisk_format == RamdiskFormat.LZ4:
p2 = Run(["lz4", "-l", "-12", "--favor-decSpeed"], stdin=p1.stdout, p2 = Run(["lz4", "-l", "-12", "--favor-decSpeed"], stdin=p1.stdout,
stdout=ramdisk_img.file.fileno()) stdout=ramdisk_img.file.fileno())
elif ramdisk_format == RamdiskFormat.XZ:
p2 = Run(["xz", "-f", "-c", "--check=crc32", "--lzma2=dict=32MiB"], stdin=p1.stdout,
stdout=ramdisk_img.file.fileno())
elif ramdisk_format == RamdiskFormat.GZ: elif ramdisk_format == RamdiskFormat.GZ:
p2 = Run(["gzip"], stdin=p1.stdout, stdout=ramdisk_img.file.fileno()) p2 = Run(["gzip"], stdin=p1.stdout, stdout=ramdisk_img.file.fileno())
else: else:
raise ValueError("Only support lz4 or gzip ramdisk format.") raise ValueError("Only support lz4, xz or gzip ramdisk format.")
p2.wait() p2.wait()
p1.wait() p1.wait()
@ -1764,6 +1775,11 @@ def _BuildBootableImage(image_name, sourcedir, fs_config_file,
cmd.append("--pagesize") cmd.append("--pagesize")
cmd.append(open(fn).read().rstrip("\n")) cmd.append(open(fn).read().rstrip("\n"))
fn = os.path.join(sourcedir, "dt")
if os.access(fn, os.F_OK):
cmd.append("--dt")
cmd.append(fn)
if partition_name == "recovery": if partition_name == "recovery":
args = info_dict.get("recovery_mkbootimg_args") args = info_dict.get("recovery_mkbootimg_args")
if not args: if not args:
@ -2861,6 +2877,7 @@ class PasswordManager(object):
def __init__(self): def __init__(self):
self.editor = os.getenv("EDITOR") self.editor = os.getenv("EDITOR")
self.pwfile = os.getenv("ANDROID_PW_FILE") self.pwfile = os.getenv("ANDROID_PW_FILE")
self.secure_storage_cmd = os.getenv("ANDROID_SECURE_STORAGE_CMD", None)
def GetPasswords(self, items): def GetPasswords(self, items):
"""Get passwords corresponding to each string in 'items', """Get passwords corresponding to each string in 'items',
@ -2880,7 +2897,19 @@ class PasswordManager(object):
missing = [] missing = []
for i in items: for i in items:
if i not in current or not current[i]: if i not in current or not current[i]:
missing.append(i) # Attempt to load using ANDROID_SECURE_STORAGE_CMD
if self.secure_storage_cmd:
try:
os.environ["TMP__KEY_FILE_NAME"] = str(i)
ps = subprocess.Popen(self.secure_storage_cmd, shell=True, stdout=subprocess.PIPE)
output = ps.communicate()[0]
if ps.returncode == 0:
current[i] = output.decode('utf-8')
except Exception as e:
print(e)
pass
if i not in current or not current[i]:
missing.append(i)
# Are all the passwords already in the file? # Are all the passwords already in the file?
if not missing: if not missing:
return current return current
@ -3171,6 +3200,11 @@ class DeviceSpecificParams(object):
used to install the image for the device's baseband processor.""" used to install the image for the device's baseband processor."""
return self._DoCall("FullOTA_InstallEnd") return self._DoCall("FullOTA_InstallEnd")
def FullOTA_PostValidate(self):
"""Called after installing and validating /system; typically this is
used to resize the system partition after a block based installation."""
return self._DoCall("FullOTA_PostValidate")
def IncrementalOTA_Assertions(self): def IncrementalOTA_Assertions(self):
"""Called after emitting the block of assertions at the top of an """Called after emitting the block of assertions at the top of an
incremental OTA package. Implementations can add whatever incremental OTA package. Implementations can add whatever
@ -3785,40 +3819,19 @@ def MakeRecoveryPatch(input_dir, output_sink, recovery_img, boot_img,
full_recovery_image = info_dict.get("full_recovery_image") == "true" full_recovery_image = info_dict.get("full_recovery_image") == "true"
board_uses_vendorimage = info_dict.get("board_uses_vendorimage") == "true" board_uses_vendorimage = info_dict.get("board_uses_vendorimage") == "true"
board_builds_vendorimage = info_dict.get("board_builds_vendorimage") == "true"
if board_uses_vendorimage: if board_builds_vendorimage or not board_uses_vendorimage:
# In this case, the output sink is rooted at VENDOR
recovery_img_path = "etc/recovery.img" recovery_img_path = "etc/recovery.img"
recovery_resource_dat_path = "VENDOR/etc/recovery-resource.dat"
sh_dir = "bin"
else: else:
# In this case the output sink is rooted at SYSTEM logger.warning('Recovery patch generation is disable when prebuilt vendor image is used.')
recovery_img_path = "vendor/etc/recovery.img" return None
recovery_resource_dat_path = "SYSTEM/vendor/etc/recovery-resource.dat"
sh_dir = "vendor/bin"
if full_recovery_image: if full_recovery_image:
output_sink(recovery_img_path, recovery_img.data) output_sink(recovery_img_path, recovery_img.data)
else: else:
include_recovery_dtbo = info_dict.get("include_recovery_dtbo") == "true" d = Difference(recovery_img, boot_img)
include_recovery_acpio = info_dict.get("include_recovery_acpio") == "true"
path = os.path.join(input_dir, recovery_resource_dat_path)
# Use bsdiff to handle mismatching entries (Bug: 72731506)
if include_recovery_dtbo or include_recovery_acpio:
diff_program = ["bsdiff"]
bonus_args = ""
assert not os.path.exists(path)
else:
diff_program = ["imgdiff"]
if os.path.exists(path):
diff_program.append("-b")
diff_program.append(path)
bonus_args = "--bonus /vendor/etc/recovery-resource.dat"
else:
bonus_args = ""
d = Difference(recovery_img, boot_img, diff_program=diff_program)
_, _, patch = d.ComputePatch() _, _, patch = d.ComputePatch()
output_sink("recovery-from-boot.p", patch) output_sink("recovery-from-boot.p", patch)
@ -3856,7 +3869,7 @@ fi
else: else:
sh = """#!/vendor/bin/sh sh = """#!/vendor/bin/sh
if ! applypatch --check %(recovery_type)s:%(recovery_device)s:%(recovery_size)d:%(recovery_sha1)s; then if ! applypatch --check %(recovery_type)s:%(recovery_device)s:%(recovery_size)d:%(recovery_sha1)s; then
applypatch %(bonus_args)s \\ applypatch \\
--patch /vendor/recovery-from-boot.p \\ --patch /vendor/recovery-from-boot.p \\
--source %(boot_type)s:%(boot_device)s:%(boot_size)d:%(boot_sha1)s \\ --source %(boot_type)s:%(boot_device)s:%(boot_size)d:%(boot_sha1)s \\
--target %(recovery_type)s:%(recovery_device)s:%(recovery_size)d:%(recovery_sha1)s && \\ --target %(recovery_type)s:%(recovery_device)s:%(recovery_size)d:%(recovery_sha1)s && \\
@ -3872,16 +3885,11 @@ fi
'boot_type': boot_type, 'boot_type': boot_type,
'boot_device': boot_device + '$(getprop ro.boot.slot_suffix)', 'boot_device': boot_device + '$(getprop ro.boot.slot_suffix)',
'recovery_type': recovery_type, 'recovery_type': recovery_type,
'recovery_device': recovery_device + '$(getprop ro.boot.slot_suffix)', 'recovery_device': recovery_device + '$(getprop ro.boot.slot_suffix)'}
'bonus_args': bonus_args}
# The install script location moved from /system/etc to /system/bin in the L # The install script location moved from /system/etc to /system/bin in the L
# release. In the R release it is in VENDOR/bin or SYSTEM/vendor/bin. # release. In the R release it is in VENDOR/bin or SYSTEM/vendor/bin.
sh_location = os.path.join(sh_dir, "install-recovery.sh") output_sink("bin/install-recovery.sh", sh.encode())
logger.info("putting script in %s", sh_location)
output_sink(sh_location, sh.encode())
class DynamicPartitionUpdate(object): class DynamicPartitionUpdate(object):
@ -3920,10 +3928,14 @@ class DynamicGroupUpdate(object):
class DynamicPartitionsDifference(object): class DynamicPartitionsDifference(object):
def __init__(self, info_dict, block_diffs, progress_dict=None, def __init__(self, info_dict, block_diffs, progress_dict=None,
source_info_dict=None): source_info_dict=None, build_without_vendor=False):
if progress_dict is None: if progress_dict is None:
progress_dict = {} progress_dict = {}
self._have_super_empty = \
info_dict.get("build_super_empty_partition") == "true"
self._build_without_vendor = build_without_vendor
self._remove_all_before_apply = False self._remove_all_before_apply = False
if source_info_dict is None: if source_info_dict is None:
self._remove_all_before_apply = True self._remove_all_before_apply = True
@ -4020,8 +4032,13 @@ class DynamicPartitionsDifference(object):
ZipWrite(output_zip, op_list_path, "dynamic_partitions_op_list") ZipWrite(output_zip, op_list_path, "dynamic_partitions_op_list")
script.Comment('Update dynamic partition metadata') script.Comment('Update dynamic partition metadata')
script.AppendExtra('assert(update_dynamic_partitions(' if self._have_super_empty:
'package_extract_file("dynamic_partitions_op_list")));') script.AppendExtra('assert(update_dynamic_partitions('
'package_extract_file("dynamic_partitions_op_list"), '
'package_extract_file("unsparse_super_empty.img")));')
else:
script.AppendExtra('assert(update_dynamic_partitions('
'package_extract_file("dynamic_partitions_op_list")));')
if write_verify_script: if write_verify_script:
for p, u in self._partition_updates.items(): for p, u in self._partition_updates.items():
@ -4048,6 +4065,17 @@ class DynamicPartitionsDifference(object):
def comment(line): def comment(line):
self._op_list.append("# %s" % line) self._op_list.append("# %s" % line)
if self._build_without_vendor:
comment('System-only build, keep original vendor partition')
# When building without vendor, we do not want to override
# any partition already existing. In this case, we can only
# resize, but not remove / create / re-create any other
# partition.
for p, u in self._partition_updates.items():
comment('Resize partition %s to %s' % (p, u.tgt_size))
append('resize %s %s' % (p, u.tgt_size))
return
if self._remove_all_before_apply: if self._remove_all_before_apply:
comment('Remove all existing dynamic partitions and groups before ' comment('Remove all existing dynamic partitions and groups before '
'applying full OTA') 'applying full OTA')
@ -4130,8 +4158,14 @@ def GetBootImageBuildProp(boot_img, ramdisk_format=RamdiskFormat.LZ4):
p2 = Run(['gzip', '-d'], stdin=input_stream.fileno(), p2 = Run(['gzip', '-d'], stdin=input_stream.fileno(),
stdout=output_stream.fileno()) stdout=output_stream.fileno())
p2.wait() p2.wait()
elif ramdisk_format == RamdiskFormat.XZ:
with open(ramdisk, 'rb') as input_stream:
with open(uncompressed_ramdisk, 'wb') as output_stream:
p2 = Run(['xz', '-d'], stdin=input_stream.fileno(),
stdout=output_stream.fileno())
p2.wait()
else: else:
logger.error('Only support lz4 or gzip ramdisk format.') logger.error('Only support lz4, xz or gzip ramdisk format.')
return None return None
abs_uncompressed_ramdisk = os.path.abspath(uncompressed_ramdisk) abs_uncompressed_ramdisk = os.path.abspath(uncompressed_ramdisk)

View file

@ -137,20 +137,39 @@ class EdifyGenerator(object):
def AssertDevice(self, device): def AssertDevice(self, device):
"""Assert that the device identifier is the given string.""" """Assert that the device identifier is the given string."""
cmd = ('getprop("ro.product.device") == "%s" || ' cmd = ('assert(' +
'abort("E%d: This package is for \\"%s\\" devices; ' ' || \0'.join(['getprop("ro.product.device") == "%s" || getprop("ro.build.product") == "%s"'
'this is a \\"" + getprop("ro.product.device") + "\\".");') % ( % (i, i) for i in device.split(",")]) +
device, common.ErrorCode.DEVICE_MISMATCH, device) ' || abort("E%d: This package is for device: %s; ' +
self.script.append(cmd) 'this device is " + getprop("ro.product.device") + ".");' +
');') % (common.ErrorCode.DEVICE_MISMATCH, device)
self.script.append(self.WordWrap(cmd))
def AssertSomeBootloader(self, *bootloaders): def AssertSomeBootloader(self, *bootloaders):
"""Asert that the bootloader version is one of *bootloaders.""" """Assert that the bootloader version is one of *bootloaders."""
cmd = ("assert(" + cmd = ("assert(" +
" ||\0".join(['getprop("ro.bootloader") == "%s"' % (b,) " ||\0".join(['getprop("ro.bootloader") == "%s"' % (b,)
for b in bootloaders]) + for b in bootloaders]) +
' || abort("This package supports bootloader(s): ' +
", ".join(["%s" % (b,) for b in bootloaders]) +
'; this device has bootloader " + getprop("ro.bootloader") + ".");' +
");") ");")
self.script.append(self.WordWrap(cmd)) self.script.append(self.WordWrap(cmd))
def RunBackup(self, command, dynamic=False):
systemEntry = self.fstab["/system"]
if dynamic:
for p in ["vendor", "product", "system_ext"]:
fstabEntry = self.fstab.get("/"+p, None)
if fstabEntry:
self.script.append('map_partition("%s");' % (fstabEntry.device,))
self.script.append(('run_program("/tmp/install/bin/backuptool.sh", "%s", map_partition("%s"), "%s");' % (
command, systemEntry.device, systemEntry.fs_type)))
else:
self.script.append(('run_program("/tmp/install/bin/backuptool.sh", "%s", "%s", "%s");' % (
command, systemEntry.device, systemEntry.fs_type)))
def ShowProgress(self, frac, dur): def ShowProgress(self, frac, dur):
"""Update the progress bar, advancing it over 'frac' over the next """Update the progress bar, advancing it over 'frac' over the next
'dur' seconds. 'dur' may be zero to advance it via SetProgress 'dur' seconds. 'dur' may be zero to advance it via SetProgress
@ -243,6 +262,17 @@ class EdifyGenerator(object):
p.mount_point, mount_flags)) p.mount_point, mount_flags))
self.mounts.add(p.mount_point) self.mounts.add(p.mount_point)
def Unmount(self, mount_point):
"""Unmount the partition with the given mount_point."""
if mount_point in self.mounts:
self.mounts.remove(mount_point)
self.script.append('unmount("%s");' % (mount_point,))
def UnpackPackageDir(self, src, dst):
"""Unpack a given directory from the OTA package into the given
destination directory."""
self.script.append('package_extract_dir("%s", "%s");' % (src, dst))
def Comment(self, comment): def Comment(self, comment):
"""Write a comment into the update script.""" """Write a comment into the update script."""
self.script.append("") self.script.append("")
@ -381,6 +411,21 @@ class EdifyGenerator(object):
assert not entry.slotselect, \ assert not entry.slotselect, \
"Use %s because %s is slot suffixed" % (fn, lst[1]) "Use %s because %s is slot suffixed" % (fn, lst[1])
def SetPermissionsRecursive(self, fn, uid, gid, dmode, fmode, selabel,
capabilities):
"""Recursively set path ownership and permissions."""
if capabilities is None:
capabilities = "0x0"
cmd = 'set_metadata_recursive("%s", "uid", %d, "gid", %d, ' \
'"dmode", 0%o, "fmode", 0%o' \
% (fn, uid, gid, dmode, fmode)
if not fn.startswith("/tmp"):
cmd += ', "capabilities", "%s"' % capabilities
if selabel is not None:
cmd += ', "selabel", "%s"' % selabel
cmd += ');'
self.script.append(cmd)
def WriteRawImage(self, mount_point, fn, mapfn=None): def WriteRawImage(self, mount_point, fn, mapfn=None):
"""Write the given package file into the partition for the given """Write the given package file into the partition for the given
mount point.""" mount point."""

View file

@ -49,13 +49,19 @@ def main(argv):
board_uses_vendorimage = OPTIONS.info_dict.get( board_uses_vendorimage = OPTIONS.info_dict.get(
"board_uses_vendorimage") == "true" "board_uses_vendorimage") == "true"
board_builds_vendorimage = OPTIONS.info_dict.get(
"board_builds_vendorimage") == "true"
target_files_dir = None
if board_uses_vendorimage: if board_builds_vendorimage:
target_files_dir = "VENDOR" target_files_dir = "VENDOR"
else: elif not board_uses_vendorimage:
target_files_dir = "SYSTEM" target_files_dir = "SYSTEM/vendor"
def output_sink(fn, data): def output_sink(fn, data):
if target_files_dir is None:
return
with open(os.path.join(output_dir, target_files_dir, with open(os.path.join(output_dir, target_files_dir,
*fn.split("/")), "wb") as f: *fn.split("/")), "wb") as f:
f.write(data) f.write(data)

View file

@ -109,6 +109,15 @@ def GetBlockDifferences(target_zip, source_zip, target_info, source_info,
return block_diff_dict return block_diff_dict
def CopyInstallTools(output_zip):
install_path = os.path.join(OPTIONS.input_tmp, "INSTALL")
for root, subdirs, files in os.walk(install_path):
for f in files:
install_source = os.path.join(root, f)
install_target = os.path.join("install", os.path.relpath(root, install_path), f)
output_zip.write(install_source, install_target)
def WriteFullOTAPackage(input_zip, output_file): def WriteFullOTAPackage(input_zip, output_file):
target_info = common.BuildInfo(OPTIONS.info_dict, OPTIONS.oem_dicts) target_info = common.BuildInfo(OPTIONS.info_dict, OPTIONS.oem_dicts)
@ -143,9 +152,9 @@ def WriteFullOTAPackage(input_zip, output_file):
assert HasRecoveryPatch(input_zip, info_dict=OPTIONS.info_dict) assert HasRecoveryPatch(input_zip, info_dict=OPTIONS.info_dict)
# Assertions (e.g. downgrade check, device properties check). # Assertions (e.g. downgrade check, device properties check).
ts = target_info.GetBuildProp("ro.build.date.utc") #ts = target_info.GetBuildProp("ro.build.date.utc")
ts_text = target_info.GetBuildProp("ro.build.date") #ts_text = target_info.GetBuildProp("ro.build.date")
script.AssertOlderBuild(ts, ts_text) #script.AssertOlderBuild(ts, ts_text)
target_info.WriteDeviceAssertions(script, OPTIONS.oem_no_mount) target_info.WriteDeviceAssertions(script, OPTIONS.oem_no_mount)
device_specific.FullOTA_Assertions() device_specific.FullOTA_Assertions()
@ -177,6 +186,8 @@ def WriteFullOTAPackage(input_zip, output_file):
recovery_img = common.GetBootableImage("recovery.img", "recovery.img", recovery_img = common.GetBootableImage("recovery.img", "recovery.img",
OPTIONS.input_tmp, "RECOVERY") OPTIONS.input_tmp, "RECOVERY")
common.CheckSize(recovery_img.data, "recovery.img", target_info)
common.ZipWriteStr(output_zip, "recovery.img", recovery_img.data)
if OPTIONS.two_step: if OPTIONS.two_step:
if not target_info.get("multistage_support"): if not target_info.get("multistage_support"):
assert False, "two-step packages not supported by this build" assert False, "two-step packages not supported by this build"
@ -184,7 +195,6 @@ def WriteFullOTAPackage(input_zip, output_file):
assert fs.fs_type.upper() == "EMMC", \ assert fs.fs_type.upper() == "EMMC", \
"two-step packages only supported on devices with EMMC /misc partitions" "two-step packages only supported on devices with EMMC /misc partitions"
bcb_dev = {"bcb_dev": fs.device} bcb_dev = {"bcb_dev": fs.device}
common.ZipWriteStr(output_zip, "recovery.img", recovery_img.data)
script.AppendExtra(""" script.AppendExtra("""
if get_stage("%(bcb_dev)s") == "2/3" then if get_stage("%(bcb_dev)s") == "2/3" then
""" % bcb_dev) """ % bcb_dev)
@ -206,6 +216,14 @@ else if get_stage("%(bcb_dev)s") == "3/3" then
device_specific.FullOTA_InstallBegin() device_specific.FullOTA_InstallBegin()
CopyInstallTools(output_zip)
script.UnpackPackageDir("install", "/tmp/install")
script.SetPermissionsRecursive("/tmp/install", 0, 0, 0o755, 0o644, None, None)
script.SetPermissionsRecursive("/tmp/install/bin", 0, 0, 0o755, 0o755, None, None)
if OPTIONS.backuptool:
script.RunBackup("backup", target_info.get('use_dynamic_partitions') == "true")
# All other partitions as well as the data wipe use 10% of the progress, and # All other partitions as well as the data wipe use 10% of the progress, and
# the update of the system partition takes the remaining progress. # the update of the system partition takes the remaining progress.
system_progress = 0.9 - (len(block_diff_dict) - 1) * 0.1 system_progress = 0.9 - (len(block_diff_dict) - 1) * 0.1
@ -215,12 +233,22 @@ else if get_stage("%(bcb_dev)s") == "3/3" then
progress_dict["system"] = system_progress progress_dict["system"] = system_progress
if target_info.get('use_dynamic_partitions') == "true": if target_info.get('use_dynamic_partitions') == "true":
# Add non-sparse super empty image to OTA package if it exists
if target_info.get('build_super_empty_partition') == "true":
unsparse_super_empty_image_name = "unsparse_super_empty.img"
unsparse_super_empty_image_path = os.path.join(OPTIONS.input_tmp, "IMAGES",
unsparse_super_empty_image_name)
unsparse_super_empty_image = common.File.FromLocalFile(
unsparse_super_empty_image_name, unsparse_super_empty_image_path)
common.ZipWriteStr(output_zip, unsparse_super_empty_image_name,
unsparse_super_empty_image.data)
# Use empty source_info_dict to indicate that all partitions / groups must # Use empty source_info_dict to indicate that all partitions / groups must
# be re-added. # be re-added.
dynamic_partitions_diff = common.DynamicPartitionsDifference( dynamic_partitions_diff = common.DynamicPartitionsDifference(
info_dict=OPTIONS.info_dict, info_dict=OPTIONS.info_dict,
block_diffs=block_diff_dict.values(), block_diffs=block_diff_dict.values(),
progress_dict=progress_dict) progress_dict=progress_dict,
build_without_vendor=(not HasPartition(input_zip, "vendor")))
dynamic_partitions_diff.WriteScript(script, output_zip, dynamic_partitions_diff.WriteScript(script, output_zip,
write_verify_script=OPTIONS.verify) write_verify_script=OPTIONS.verify)
else: else:
@ -236,6 +264,12 @@ else if get_stage("%(bcb_dev)s") == "3/3" then
common.CheckSize(boot_img.data, "boot.img", target_info) common.CheckSize(boot_img.data, "boot.img", target_info)
common.ZipWriteStr(output_zip, "boot.img", boot_img.data) common.ZipWriteStr(output_zip, "boot.img", boot_img.data)
device_specific.FullOTA_PostValidate()
if OPTIONS.backuptool:
script.ShowProgress(0.02, 10)
script.RunBackup("restore", target_info.get('use_dynamic_partitions') == "true")
script.WriteRawImage("/boot", "boot.img") script.WriteRawImage("/boot", "boot.img")
script.ShowProgress(0.1, 10) script.ShowProgress(0.1, 10)
@ -676,12 +710,17 @@ def _WriteRecoveryImageToBoot(script, output_zip):
def HasRecoveryPatch(target_files_zip, info_dict): def HasRecoveryPatch(target_files_zip, info_dict):
board_uses_vendorimage = info_dict.get("board_uses_vendorimage") == "true" board_uses_vendorimage = info_dict.get("board_uses_vendorimage") == "true"
board_builds_vendorimage = info_dict.get("board_builds_vendorimage") == "true"
target_files_dir = None
if board_uses_vendorimage: if board_builds_vendorimage:
target_files_dir = "VENDOR" target_files_dir = "VENDOR"
else: elif not board_uses_vendorimage:
target_files_dir = "SYSTEM/vendor" target_files_dir = "SYSTEM/vendor"
if target_files_dir is None:
return True
patch = "%s/recovery-from-boot.p" % target_files_dir patch = "%s/recovery-from-boot.p" % target_files_dir
img = "%s/etc/recovery.img" % target_files_dir img = "%s/etc/recovery.img" % target_files_dir

View file

@ -144,6 +144,10 @@ Non-A/B OTA specific options
that any changes made to the system partition are done using the new that any changes made to the system partition are done using the new
recovery (new kernel, etc.). recovery (new kernel, etc.).
--backup <boolean>
Enable or disable the execution of backuptool.sh.
Disabled by default.
A/B OTA specific options A/B OTA specific options
--disable_fec_computation --disable_fec_computation
@ -304,6 +308,7 @@ OPTIONS.worker_threads = multiprocessing.cpu_count() // 2
if OPTIONS.worker_threads == 0: if OPTIONS.worker_threads == 0:
OPTIONS.worker_threads = 1 OPTIONS.worker_threads = 1
OPTIONS.two_step = False OPTIONS.two_step = False
OPTIONS.backuptool = False
OPTIONS.include_secondary = False OPTIONS.include_secondary = False
OPTIONS.block_based = True OPTIONS.block_based = True
OPTIONS.updater_binary = None OPTIONS.updater_binary = None
@ -1221,6 +1226,8 @@ def main(argv):
"integers are allowed." % (a, o)) "integers are allowed." % (a, o))
elif o in ("-2", "--two_step"): elif o in ("-2", "--two_step"):
OPTIONS.two_step = True OPTIONS.two_step = True
elif o == "--backup":
OPTIONS.backuptool = True
elif o == "--include_secondary": elif o == "--include_secondary":
OPTIONS.include_secondary = True OPTIONS.include_secondary = True
elif o == "--no_signing": elif o == "--no_signing":
@ -1336,6 +1343,7 @@ def main(argv):
"extra_script=", "extra_script=",
"worker_threads=", "worker_threads=",
"two_step", "two_step",
"backup=",
"include_secondary", "include_secondary",
"no_signing", "no_signing",
"block", "block",

View file

@ -45,7 +45,7 @@ OPTIONS.boot_variable_file = None
METADATA_NAME = 'META-INF/com/android/metadata' METADATA_NAME = 'META-INF/com/android/metadata'
METADATA_PROTO_NAME = 'META-INF/com/android/metadata.pb' METADATA_PROTO_NAME = 'META-INF/com/android/metadata.pb'
UNZIP_PATTERN = ['IMAGES/*', 'META/*', 'OTA/*', UNZIP_PATTERN = ['IMAGES/*', 'INSTALL/*', 'META/*', 'OTA/*',
'RADIO/*', '*/build.prop', '*/default.prop', '*/build.default', "*/etc/vintf/*"] 'RADIO/*', '*/build.prop', '*/default.prop', '*/build.default', "*/etc/vintf/*"]
SECURITY_PATCH_LEVEL_PROP_NAME = "ro.build.version.security_patch" SECURITY_PATCH_LEVEL_PROP_NAME = "ro.build.version.security_patch"
TARGET_FILES_IMAGES_SUBDIR = ["IMAGES", "PREBUILT_IMAGES", "RADIO"] TARGET_FILES_IMAGES_SUBDIR = ["IMAGES", "PREBUILT_IMAGES", "RADIO"]
@ -223,9 +223,13 @@ def UpdateDeviceState(device_state, build_info, boot_variable_values,
partition_devices = set() partition_devices = set()
partition_fingerprints = set() partition_fingerprints = set()
for runtime_build_info in build_info_set: for runtime_build_info in build_info_set:
partition_devices.add( try:
runtime_build_info.GetPartitionBuildProp('ro.product.device', partition_devices.add(
partition)) runtime_build_info.GetPartitionBuildProp('ro.product.device',
partition))
except common.ExternalError:
partition_devices.add(
runtime_build_info.GetBuildProp('ro.product.device'))
partition_fingerprints.add( partition_fingerprints.add(
runtime_build_info.GetPartitionFingerprint(partition)) runtime_build_info.GetPartitionFingerprint(partition))

View file

@ -1221,6 +1221,7 @@ def BuildKeyMap(misc_info, key_mapping_options):
devkeydir + "/platform": d + "/platform", devkeydir + "/platform": d + "/platform",
devkeydir + "/networkstack": d + "/networkstack", devkeydir + "/networkstack": d + "/networkstack",
devkeydir + "/sdk_sandbox": d + "/sdk_sandbox", devkeydir + "/sdk_sandbox": d + "/sdk_sandbox",
devkeydir + "/bluetooth": d + "/bluetooth",
}) })
else: else:
OPTIONS.key_map[s] = d OPTIONS.key_map[s] = d