1# 2# Copyright (C) 2022 The Android Open-Source Project 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16# This file enables baseline features, such as io_uring, 17# userspace merge, etc. But sets compression method to none. 18# This .mk file also removes snapuserd from vendor ramdisk, 19# as T launching devices will have init_boot which has snapuserd 20# in generic ramdisk. 21# 22# T and U launching devices should include this .mk file, and configure 23# compression algorithm by setting 24# PRODUCT_VIRTUAL_AB_COMPRESSION_METHOD to lz4, gz or brotli. Complete 25# set of supported algorithms can be found in 26# system/core/fs_mgr/libsnapshot/cow_writer.cpp 27 28PRODUCT_VIRTUAL_AB_OTA := true 29 30PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.enabled=true 31 32PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.compression.enabled=true 33PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.userspace.snapshots.enabled=true 34PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.batch_writes=true 35 36# Optional assignments, low memory devices may benefit from overriding these. 37PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.io_uring.enabled?=true 38PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.compression.xor.enabled?=true 39 40# Low memory device configurations. If memory usage and cpu utilization is 41# a bottleneck during OTA, the below configurations can be added to a 42# device's .mk file improve performance for low mem devices. 43# 44# PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.read_ahead_size=16 45# warning: enabling o_direct on devices with low CMA could lead to failures 46# PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.o_direct.enabled=true 47# PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.merge_thread_priority=19 48# PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.worker_thread_priority=0 49# PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.num_worker_threads=3 50# PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.num_merge_threads=1 51# PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.num_verify_threads=1 52# PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.cow_op_merge_size=16 53# PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.verify_threshold_size=1073741824 54# PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.verify_block_size=1048576 55 56 57# Enabling this property will skip verification post OTA reboot. 58# Verification allows the device to safely roll back if any boot failures 59# are detected. If the verification is disabled, update_verifier to will 60# try to verify using bufferred read if care_map.pb is present in 61# /metadata/ota/. This will increase the boot time and may also impact 62# memory usage as all the blocks in dynamic partitions are read into page-cache. 63# If care_map.pb isn't present, update-verifier will skip the verification. 64# PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.skip_verification =true 65 66# Enabling this property, will improve OTA install time 67# but will use an additional CPU core 68# PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.compression.threads=true 69ifndef PRODUCT_VIRTUAL_AB_COMPRESSION_FACTOR 70 PRODUCT_VIRTUAL_AB_COMPRESSION_FACTOR := 65536 71endif 72 73PRODUCT_VIRTUAL_AB_COMPRESSION := true 74PRODUCT_VIRTUAL_AB_COMPRESSION_METHOD ?= none 75PRODUCT_PACKAGES += \ 76 snapuserd \ 77 78