Android data分区格式F2FS改为EXT4

1. 主板型号:AIO-3399J

2. 芯片型号:RK3399

3. 操作系统版本:Android 7.1

4. Linux版本:v4.4.103

5. 需要的功能: 将RK3399的跟目录下的data文件系统f2fs,无法挂载 mount data分区,更换data文件系统ext4后,Android系统对userdata分区进行了加密,启动Android系统需要密码。

Android data分区格式F2FS改为EXT4_第1张图片

Android data分区格式F2FS改为EXT4_第2张图片

6. 遇到的问题:

(1)将rk3399的/data分区修改成ext4

6.1 修改device.mk,recovery.emmc.fstab,fstab.rk30board.bootmode.emmc,fstab.rk30board.bootmode.unknown的data文件格式ext4!

vela@Apollo:/media/vela/nick/firefly-rk3399-nougat$ git diff device/rockchip/common/device.mk
diff --git a/device/rockchip/common/device.mk b/device/rockchip/common/device.mk
index 46cec73..5ad7356 100755
--- a/device/rockchip/common/device.mk
+++ b/device/rockchip/common/device.mk
@@ -49,7 +49,7 @@ PRODUCT_PROPERTY_OVERRIDES += \
     ro.rksdk.version=RK30_ANDROID$(PLATFORM_VERSION)-SDK-v1.00.00
 
 # Filesystem management tools
-PRODUCT_PACKAGES += \
+#PRODUCT_PACKAGES += \
     fsck.f2fs \
     mkfs.f2fs \
     fsck_f2fs
vela@Apollo:/media/vela/nick/firefly-rk3399-nougat$ git diff device/rockchip/rk3399/device.mk
diff --git a/device/rockchip/rk3399/device.mk b/device/rockchip/rk3399/device.mk
index 776fed1..3806099 100755
--- a/device/rockchip/rk3399/device.mk
+++ b/device/rockchip/rk3399/device.mk
@@ -24,12 +24,12 @@ PRODUCT_PACKAGES += \
     RetailDemo
 
 #enable this for support f2fs with data partion
-BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs
+#BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs
 # This ensures the needed build tools are available.
 # TODO: make non-linux builds happy with external/f2fs-tool; system/extras/f2fs_utils
-ifeq ($(HOST_OS),linux)
-TARGET_USERIMAGES_USE_F2FS := true
-endif
+#ifeq ($(HOST_OS),linux)
+#TARGET_USERIMAGES_USE_F2FS := true
+#endif
 
 PRODUCT_COPY_FILES += \
     $(LOCAL_PATH)/rk3399_firefly_box/init.rc:root/init.rc
@@ -73,8 +73,8 @@ PRODUCT_COPY_FILES += \
 else
 PRODUCT_COPY_FILES += \
     $(LOCAL_PATH)/fstab.rk30board.bootmode.unknown:root/fstab.rk30board.bootmode.unknown \
-    $(LOCAL_PATH)/fstab.rk30board.bootmode.emmc:root/fstab.rk30board.bootmode.emmc \
-    $(LOCAL_PATH)/fstab.rk30board.bootmode.nvme:root/fstab.rk30board.bootmode.nvme
+    $(LOCAL_PATH)/fstab.rk30board.bootmode.emmc:root/fstab.rk30board.bootmode.emmc 
+    #$(LOCAL_PATH)/fstab.rk30board.bootmode.nvme:root/fstab.rk30board.bootmode.nvme
 endif
 # debug-logs
 ifeq ($(MIXIN_DEBUG_LOGS),true)
vela@Apollo:/media/vela/nick/firefly-rk3399-nougat$ git diff device/rockchip/rk3399/recovery.emmc.fstab
diff --git a/device/rockchip/rk3399/recovery.emmc.fstab b/device/rockchip/rk3399/recovery.emmc.fstab
index b880ef7..be5e2f6 100755
--- a/device/rockchip/rk3399/recovery.emmc.fstab
+++ b/device/rockchip/rk3399/recovery.emmc.fstab
@@ -5,7 +5,7 @@
 /dev/block/platform/fe330000.sdhci/by-name/system                /system              ext4             defaults   
 /dev/block/platform/fe330000.sdhci/by-name/cache                 /cache               ext4             defaults   
 /dev/block/platform/fe330000.sdhci/by-name/metadata              /metadata            ext4             defaults   
-/dev/block/platform/fe330000.sdhci/by-name/userdata              /data                f2fs             defaults   
+/dev/block/platform/fe330000.sdhci/by-name/userdata              /data                ext4             defaults   
 /dev/block/platform/fe330000.sdhci/by-name/cust                  /cust                ext4             defaults   
 /dev/block/platform/fe330000.sdhci/by-name/custom                /custom              ext4             defaults   
 /dev/block/platform/fe330000.sdhci/by-name/misc                  /misc                emmc             defaults   
vela@Apollo:/media/vela/nick/firefly-rk3399-nougat$ git diff device/rockchip/rk3399/fstab.rk30board.bootmode.emmc
diff --git a/device/rockchip/rk3399/fstab.rk30board.bootmode.emmc b/device/rockchip/rk3399/fstab.rk30board.bootmode.emmc
index 9fbfaba..87101ca 100755
--- a/device/rockchip/rk3399/fstab.rk30board.bootmode.emmc
+++ b/device/rockchip/rk3399/fstab.rk30board.bootmode.emmc
@@ -8,11 +8,11 @@
 #/dev/block/platform/fe330000.sdhci/by-name/system         /system             ext4      ro,noatime,nodiratime,noauto_da_alloc                                  wait,check,verify
 /dev/block/platform/fe330000.sdhci/by-name/cache          /cache              ext4      noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard                wait,check
 /dev/block/platform/fe330000.sdhci/by-name/metadata       /metadata           ext4      noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard                wait,check
-/dev/block/platform/fe330000.sdhci/by-name/userdata       /data               f2fs      noatime,nodiratime,nosuid,nodev,discard,inline_xattr                   wait,check,notrim,encryptable=/metadata/key_file
+/dev/block/platform/fe330000.sdhci/by-name/userdata       /data               f2fs      noatime,nodiratime,nosuid,nodev                   wait,check,encryptable=/metadata/key_file
 #data for f2fs nobarrier
 #/dev/block/platform/fe330000.sdhci/by-name/userdata       /data               f2fs      noatime,nodiratime,nosuid,nodev,discard,inline_xattr,nobarrier   wait,check,notrim,encryptable=/metadata/key_file
 #data for ext4
-#/dev/block/platform/fe330000.sdhci/by-name/userdata       /data               ext4      noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard,errors=panic   wait,check,encryptable=/metadata/key_file
+/dev/block/platform/fe330000.sdhci/by-name/userdata       /data               ext4      noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard,errors=panic   wait,check,encryptable=/metadata/key_file
 /dev/block/platform/fe330000.sdhci/by-name/misc          /misc                emmc        defaults      defaults
 # sdcard
 /devices/platform/fe320000.dwmmc/mmc_host*                auto  auto    defaults        voldmanaged=sdcard1:auto,encryptable=userdata
vela@Apollo:/media/vela/nick/firefly-rk3399-nougat$ git diff device/rockchip/rk3399/fstab.rk30board.bootmode.unknown
diff --git a/device/rockchip/rk3399/fstab.rk30board.bootmode.unknown b/device/rockchip/rk3399/fstab.rk30board.bootmode.unknown
index 82068de..b9e0165 100755
--- a/device/rockchip/rk3399/fstab.rk30board.bootmode.unknown
+++ b/device/rockchip/rk3399/fstab.rk30board.bootmode.unknown
@@ -9,6 +9,8 @@
 /dev/block/rknand_cache                    /cache              ext4      noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard                       wait
 /dev/block/rknand_metadata                 /metadata           ext4      noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard                       wait,check
 /dev/block/rknand_userdata                 /data               ext4      noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard,errors=panic          wait,check,encryptable=/metadata/key_file
+/dev/block/rknand_userdata                 /data               f2fs      noatime,nodiratime,nosuid,nodev,errors=recover                                wait,check,encryptable=/metadata/key_filer
+
 /dev/block/rknand_misc                    /misc              mtd       defaults         defaults
 
 /devices/ff0c0000.rksdmmc/mmc_host/mmc*          auto       auto       defaults        voldmanaged=sdcard1:auto,encryptable=userdata

6.2 重新编译make clean,编译Android镜像文件并烧写,查看k3399平台/data文件格式。

Android data分区格式F2FS改为EXT4_第3张图片

7. EXT4是Linux的标准文件系统,但相对与F2FS I/O读写速度较慢。

Android data分区格式F2FS改为EXT4_第4张图片

 

你可能感兴趣的:(Android系统架构)