dragonboards: fstab: Mount /data as F2FS partition

API level 33+ expects /data to be mounted as F2FS partition
to pass certain F2FS Cts tests.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Change-Id: I5f6a6a9645fce7a0f889c9d4d39e1b4db9633cdc
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index 08c5c57..ac375bc 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -19,7 +19,8 @@
 TARGET_NO_RECOVERY := true
 
 BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := erofs
-TARGET_USERIMAGES_USE_EXT4 := true
+TARGET_USERIMAGES_USE_F2FS := true
+BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs
 TARGET_COPY_OUT_VENDOR := vendor
 BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := erofs
 TARGET_COPY_OUT_SYSTEM_EXT := system_ext
diff --git a/device-common.mk b/device-common.mk
index a197f86..b530c0d 100644
--- a/device-common.mk
+++ b/device-common.mk
@@ -68,6 +68,11 @@
     system_ext \
     vendor
 
+# Tools to build f2fs images
+PRODUCT_HOST_PACKAGES := \
+    fsck.f2fs \
+    make_f2fs
+
 ifeq ($(TARGET_SDCARD_BOOT), true)
   ifneq ($(filter 5.4 5.10 5.15, $(TARGET_KERNEL_USE)),)
     PRODUCT_COPY_FILES += \
diff --git a/fstab.common b/fstab.common
index c618b7a..6772e38 100644
--- a/fstab.common
+++ b/fstab.common
@@ -1,5 +1,5 @@
 system		/system		erofs	ro				wait,logical,first_stage_mount,slotselect
-/dev/block/platform/soc@0/1d84000.ufshc/by-name/userdata /data		ext4	discard,noatime,noauto_da_alloc,data=ordered,user_xattr,barrier=1,inlinecrypt	latemount,wait,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,keydirectory=/metadata/vold/metadata_encryption,quota
+/dev/block/platform/soc@0/1d84000.ufshc/by-name/userdata	/data		f2fs	nodev,noatime,nosuid,inlinecrypt,reserve_root=32768	latemount,wait,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,keydirectory=/metadata/vold/metadata_encryption,quota,check,fscompress,checkpoint=fs
 /dev/block/platform/soc@0/1d84000.ufshc/by-name/metadata	/metadata	ext4	noatime,nosuid,nodev,discard					wait,formattable,first_stage_mount,check
 /dev/block/platform/soc@0/1d84000.ufshc/by-name/misc /misc emmc defaults defaults
 /devices/platform/soc@0/8804000.sdhci/mmc_host/mmc*	auto	auto	defaults	voldmanaged=sdcard1:auto
diff --git a/shared/utils/sdcard-boot/fstab.mmc b/shared/utils/sdcard-boot/fstab.mmc
index 387a0cd..1f689e8 100644
--- a/shared/utils/sdcard-boot/fstab.mmc
+++ b/shared/utils/sdcard-boot/fstab.mmc
@@ -1,5 +1,5 @@
 system		/system		erofs	ro				wait,logical,first_stage_mount,slotselect
-/dev/block/platform/soc@0/8804000.mmc/by-name/userdata	/data		ext4	discard,noatime,noauto_da_alloc,data=ordered,user_xattr,barrier=1,inlinecrypt	latemount,wait,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,keydirectory=/metadata/vold/metadata_encryption,quota
+/dev/block/platform/soc@0/8804000.mmc/by-name/userdata	/data		f2fs	nodev,noatime,nosuid,inlinecrypt,reserve_root=32768	latemount,wait,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,keydirectory=/metadata/vold/metadata_encryption,quota,check,fscompress,checkpoint=fs
 /dev/block/platform/soc@0/8804000.mmc/by-name/metadata	/metadata	ext4	noatime,nosuid,nodev,discard					wait,formattable,first_stage_mount,check
 /dev/block/platform/soc@0/8804000.mmc/by-name/misc /misc emmc defaults defaults
 /devices/platform/soc@0/a8f8800.usb/*/usb*		auto	auto	defaults	voldmanaged=usb1:auto
diff --git a/shared/utils/sdcard-boot/fstab.sdhci b/shared/utils/sdcard-boot/fstab.sdhci
index c385ba6..746f516 100644
--- a/shared/utils/sdcard-boot/fstab.sdhci
+++ b/shared/utils/sdcard-boot/fstab.sdhci
@@ -1,5 +1,5 @@
 system		/system		erofs	ro				wait,logical,first_stage_mount,slotselect
-/dev/block/platform/soc@0/8804000.sdhci/by-name/userdata	/data		ext4	discard,noatime,noauto_da_alloc,data=ordered,user_xattr,barrier=1,inlinecrypt	latemount,wait,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,keydirectory=/metadata/vold/metadata_encryption,quota
+/dev/block/platform/soc@0/8804000.sdhci/by-name/userdata	/data		f2fs	nodev,noatime,nosuid,inlinecrypt,reserve_root=32768	latemount,wait,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,keydirectory=/metadata/vold/metadata_encryption,quota,check,fscompress,checkpoint=fs
 /dev/block/platform/soc@0/8804000.sdhci/by-name/metadata	/metadata	ext4	noatime,nosuid,nodev,discard					wait,formattable,first_stage_mount,check
 /dev/block/platform/soc@0/8804000.sdhci/by-name/misc /misc emmc defaults defaults
 /devices/platform/soc@0/a8f8800.usb/*/usb*		auto	auto	defaults	voldmanaged=usb1:auto