sm6225-common: Setup virtual A/B OTAs
Change-Id: I3de5b9d35d3e6c1d4a81a0dc9ff00cc0413597d5
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index cf0b676..f6d6f69 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -9,6 +9,23 @@
COMMON_PATH := device/xiaomi/sm6225-common
+# A/B
+AB_OTA_PARTITIONS += \
+ boot \
+ dtbo \
+ init_boot \
+ odm \
+ product \
+ recovery \
+ system \
+ system_dlkm \
+ system_ext \
+ vbmeta \
+ vbmeta_system \
+ vendor \
+ vendor_boot \
+ vendor_dlkm
+
# Architecture
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
diff --git a/common.mk b/common.mk
index c4ee39f..15c5234 100644
--- a/common.mk
+++ b/common.mk
@@ -20,6 +20,28 @@
# Inherit the proprietary files
$(call inherit-product, vendor/xiaomi/sm6225-common/sm6225-common-vendor.mk)
+# A/B
+$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_ramdisk.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/vabc_features.mk)
+
+PRODUCT_VIRTUAL_AB_COMPRESSION_METHOD := lz4
+
+AB_OTA_POSTINSTALL_CONFIG += \
+ RUN_POSTINSTALL_system=true \
+ POSTINSTALL_PATH_system=system/bin/otapreopt_script \
+ FILESYSTEM_TYPE_system=ext4 \
+ POSTINSTALL_OPTIONAL_system=true
+
+AB_OTA_POSTINSTALL_CONFIG += \
+ RUN_POSTINSTALL_vendor=true \
+ POSTINSTALL_PATH_vendor=bin/checkpoint_gc \
+ FILESYSTEM_TYPE_vendor=ext4 \
+ POSTINSTALL_OPTIONAL_vendor=true
+
+PRODUCT_PACKAGES += \
+ checkpoint_gc \
+ otapreopt_script
+
# Fastbootd
PRODUCT_PACKAGES += \
fastbootd
@@ -44,3 +66,12 @@
# Soong namespaces
PRODUCT_SOONG_NAMESPACES += \
$(LOCAL_PATH)
+
+# Update engine
+PRODUCT_PACKAGES += \
+ update_engine \
+ update_engine_sideload \
+ update_verifier
+
+PRODUCT_PACKAGES_DEBUG += \
+ update_engine_client