sm6225-common: Setup A/B partitions

Change-Id: I5a8a92927a30a16898a11b1e5faee84147945e6f
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index 508639c..173fa5f 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 d82f363..63ac10d 100644
--- a/common.mk
+++ b/common.mk
@@ -19,6 +19,22 @@
 # A/B
 $(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/launch_with_vendor_ramdisk.mk)
 
+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
+
 # Shipping API Level
 BOARD_SHIPPING_API_LEVEL := 33