Hello,
I am using the following branch to build the images for hikey970.
https://android.googlesource.com/platform/manifest/+/pie-dr1-dev
In order to boot the userdata partition using f2fs, I carried out the following steps:
1. Enabled the f2fs configs in the kernel
CONFIG_F2FS_FS=y
CONFIG_F2FS_STAT_FS=y
CONFIG_F2FS_FS_XATTR=y
CONFIG_F2FS_FS_POSIX_ACL=y
CONFIG_F2FS_FS_SECURITY=y
CONFIG_F2FS_CHECK_FS=y
CONFIG_F2FS_FS_ENCRYPTION=y
CONFIG_F2FS_IO_TRACE=y
CONFIG_F2FS_FAULT_INJECTION=y
2. Modified the default fstab to the following
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
#/dev/block/platform/soc/ff3b0000.ufs/by-name/system_a /system ext4 ro wait
/dev/block/sdd12 /system ext4 ro wait
#/dev/block/platform/soc/ff3b0000.ufs/by-name/cache /cache ext4 discard,noauto_da_alloc,data=ordered,user_xattr,discard,barrier=1 wait
/dev/block/sdd5 /cache ext4 discard,noauto_da_alloc,data=ordered,user_xattr,discard,barrier=1 wait
#/dev/block/platform/soc/ff3b0000.ufs/by-name/userdata /data ext4 discard,noauto_da_alloc,data=ordered,user_xattr,discard,barrier=1 wait
#/dev/block/sdd15 /data ext4 discard,noauto_da_alloc,data=ordered,user_xattr,discard,barrier=1 wait
/dev/block/sdd15 /data f2fs discard,noatime,nosuid,nodev wait,check,fileencryption=software,quota
#/dev/block/sdd13 /data f2fs discard,noatime,nosuid,nodev wait,check,fileencryption=software,quota
#/dev/block/sdd15 /data ext4 discard,noatime,noauto_da_alloc,data=ordered,user_xattr,barrier=1 wait,formattable
/devices/platform/soc/ff37f000.dwmmc1/mmc_host/mmc* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata
/devices/platform/soc/soc:hisi_dwc3/ff100000.dwc3/xhci-hcd.*.auto/usb* auto auto defaults voldmanaged=usbdisk:auto,encryptable=userdata
3. Built the AOSP using the following command
make -j$(nproc) BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE=f2fs TARGET_USERIMAGES_USE_F2FS=true
It is observed that after booting, the /data partition is not mounted. But It can be mounted manually using the mount command after booting:
hikey970:/data # root@nand:/mnt/storage2/nishad/f2fs/Hikey_Dir/out/target/product/hikey960# adb shell
hikey970:/ $ su
hikey970:/ # df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 2979360 4028 2975332 1% /
tmpfs 3016084 296 3015788 1% /dev
tmpfs 3016084 0 3016084 0% /mnt
/dev/block/sdd12 4725116 1267380 3457736 27% /system
/dev/block/sdd5 237536 176 237360 1% /cache
hikey970:/ # mount -t f2fs /dev/block/sdd
sdd sdd1 sdd10 sdd11 sdd12 sdd13 sdd14 sdd15 sdd2 sdd3 sdd4 sdd5 sdd6 sdd7 sdd8 sdd9
hikey970:/ # mount -t f2fs /dev/block/sdd15 data/
hikey970:/ # df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 2.8G 3.9M 2.8G 1% /
tmpfs 2.8G 296K 2.8G 1% /dev
tmpfs 2.8G 0 2.8G 0% /mnt
/dev/block/sdd12 4.5G 1.2G 3.2G 27% /system
/dev/block/sdd5 232M 176K 232M 1% /cache
/dev/block/sdd15 24G 165M 24G 1% /data
hikey970:/ # cd data/
hikey970:/data # mkdir 1234
hikey970:/data # ls
1234 nativetest nativetest64
hikey970:/data #
Why does the f2fs partition not mount while board boot-up?
Thank you for your time,
Regards,
Nishad