hikey960: Enabling dynamic partitions for HiKey960 am: 6d0db31172 am: 9c6767a79f am: fbf053749a am: e5d46d81be am: 8889af87ff

Original change: https://android-review.googlesource.com/c/device/linaro/hikey/+/1546260

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1bca68877fb28c9cb1b60d6146305424e9907b66
diff --git a/fstab.ramdisk960 b/fstab.ramdisk960
index 6192881..098386d 100644
--- a/fstab.ramdisk960
+++ b/fstab.ramdisk960
@@ -1,4 +1,4 @@
-system /system ext4 noatime,ro,errors=panic wait,logical,first_stage_mount
-vendor /vendor ext4 noatime,ro,errors=panic wait,logical,first_stage_mount
-system_ext /system_ext ext4 noatime,ro,errors=panic wait,logical,first_stage_mount
-product /product ext4 noatime,ro,errors=panic wait,logical,first_stage_mount
+system /system ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect
+vendor /vendor ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect
+system_ext /system_ext ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect
+product /product ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect
diff --git a/hikey960/BoardConfig.mk b/hikey960/BoardConfig.mk
index 789b18f..d17a5b9 100644
--- a/hikey960/BoardConfig.mk
+++ b/hikey960/BoardConfig.mk
@@ -10,7 +10,7 @@
 
 BOARD_KERNEL_CMDLINE := androidboot.hardware=hikey960 firmware_class.path=/vendor/firmware efi=noruntime init=/init
 BOARD_KERNEL_CMDLINE += androidboot.boot_devices=soc/ff3b0000.ufs
-BOARD_KERNEL_CMDLINE += loglevel=15
+BOARD_KERNEL_CMDLINE += loglevel=15 androidboot.slot_suffix=_a
 
 ifeq ($(TARGET_BUILTIN_EDID), true)
 BOARD_KERNEL_CMDLINE += drm_kms_helper.edid_firmware=edid/1920x1080.bin
@@ -60,10 +60,4 @@
 BOARD_HIKEY960_DYNAMIC_PARTITIONS_PARTITION_LIST := system vendor system_ext product
 BOARD_HIKEY960_DYNAMIC_PARTITIONS_SIZE := 4915724288
 
-# !!! This HACK needs to be removed !!!
-# Until the ptable is updated, we flash super.img to system
-# but this is deprecated. We need to update the ptable and
-# roll that out. Then this can be removed.
-BOARD_SUPER_PARTITION_METADATA_DEVICE := system
-
 TARGET_RECOVERY_FSTAB := device/linaro/hikey/hikey960/fstab.hikey960
diff --git a/hikey960/device-hikey960.mk b/hikey960/device-hikey960.mk
index f1946ee..d901035 100644
--- a/hikey960/device-hikey960.mk
+++ b/hikey960/device-hikey960.mk
@@ -14,6 +14,16 @@
 # limitations under the License.
 #
 
+# Enable Virtual A/B
+AB_OTA_UPDATER := true
+AB_OTA_PARTITIONS += \
+    product \
+    system \
+    system_ext \
+    vendor
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota.mk)
+
 PRODUCT_COPY_FILES +=	$(TARGET_PREBUILT_KERNEL):kernel \
 			$(TARGET_PREBUILT_DTB):hi3660-hikey960.dtb
 
diff --git a/installer/hikey960/flash-all.sh b/installer/hikey960/flash-all.sh
index dda34d3..2828089 100755
--- a/installer/hikey960/flash-all.sh
+++ b/installer/hikey960/flash-all.sh
@@ -24,6 +24,6 @@
 fastboot flash trustfirmware   "${INSTALLER_DIR}"/hisi-bl31.bin
 fastboot flash boot "${ANDROID_PRODUCT_OUT}"/boot.img
 fastboot flash dts "${ANDROID_PRODUCT_OUT}"/dt.img
-fastboot flash system "${ANDROID_PRODUCT_OUT}"/super.img
+fastboot flash super "${ANDROID_PRODUCT_OUT}"/super.img
 fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img
 fastboot reboot
diff --git a/installer/hikey960/prm_ptable.img b/installer/hikey960/prm_ptable.img
index c81ffcf..e7b9b03 100644
--- a/installer/hikey960/prm_ptable.img
+++ b/installer/hikey960/prm_ptable.img
Binary files differ
diff --git a/installer/hikey960/uefi-flash-all.sh b/installer/hikey960/uefi-flash-all.sh
index ce40203..9c7301d 100755
--- a/installer/hikey960/uefi-flash-all.sh
+++ b/installer/hikey960/uefi-flash-all.sh
@@ -44,7 +44,7 @@
 	fastboot flash fip "${INSTALLER_DIR}"/fip.bin
 
 	fastboot flash boot "${ANDROID_PRODUCT_OUT}"/boot.img
-	fastboot flash system "${ANDROID_PRODUCT_OUT}"/super.img
+	fastboot flash super "${ANDROID_PRODUCT_OUT}"/super.img
 	fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img
 }