問題:裝置是不帶電池的,關機的時候是直接斷電的,如果data分割槽是f2fs的檔案系統格式,這種操作是有一定機率性損壞檔案系統了導致開不了機。f2fs改為ext4就可以減小異常掉電後資料丟失的機率。
異常開機:
正常開機會有很多init的資訊:
措施:data分割槽改成ext4的格式檔案系統:
Android7.1+rk3288:
device/rockchip/rk3288:
diff --git a/device.mk b/device.mk
index 5d05a56..cdf512e 100755
--- a/device.mk
+++ b/device.mk
@@ -25,13 +25,13 @@ PRODUCT_PACKAGES += \
displayd
#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)/init.rk3288.rc:root/init.rk3288.rc \
diff --git a/fstab.rk30board.bootmode.emmc.rk3288 b/fstab.rk30board.bootmode.emmc.rk3288
old mode 100644
new mode 100755
index e753b7d..1bc021b
--- a/fstab.rk30board.bootmode.emmc.rk3288
+++ b/fstab.rk30board.bootmode.emmc.rk3288
@@ -9,8 +9,9 @@
/dev/block/platform/ff0f0000.dwmmc/by-name/vendor0 /vendor ext4 ro,noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait
/dev/block/platform/ff0f0000.dwmmc/by-name/cache /cache ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait,check
/dev/block/platform/ff0f0000.dwmmc/by-name/metadata /metadata ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait,check
-/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data f2fs noatime,nodiratime,nosuid,nodev,discard,inline_xattr wait,check,notrim,encryptable=/metadata/key_file
-#/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard,errors=panic wait,check,encryptable=/metadata/key_file
+#/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data f2fs noatime,nodiratime,nosuid,nodev,discard,inline_xattr wait,check,notrim,encryptable=/metadata/key_file
+/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data f2fs noatime,nodiratime,nosuid,nodev
wait,check,notrim,encryptable=/metadata/key_file
+/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard,errors=panic wait,check,encryptable=/metadata/key_file
/dev/block/platform/ff0f0000.dwmmc/by-name/misc /misc emmc defaults defaults
# /dev/block/platform/ff0f0000.dwmmc/by-name/radical_update /radical_update ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait
diff --git a/fstab.rk30board.bootmode.emmc.rk3288w b/fstab.rk30board.bootmode.emmc.rk3288w
old mode 100644
new mode 100755
index 05d7f16..8129ddd
--- a/fstab.rk30board.bootmode.emmc.rk3288w
+++ b/fstab.rk30board.bootmode.emmc.rk3288w
@@ -9,8 +9,9 @@
/dev/block/platform/ff0f0000.dwmmc/by-name/vendor1 /vendor ext4 ro,noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait
/dev/block/platform/ff0f0000.dwmmc/by-name/cache /cache ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait,check
/dev/block/platform/ff0f0000.dwmmc/by-name/metadata /metadata ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait,check
-/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data f2fs noatime,nodiratime,nosuid,nodev,discard,inline_xattr wait,check,notrim,encryptable=/metadata/key_file
-#/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard,errors=panic wait,check,encryptable=/metadata/key_file
+#/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data f2fs noatime,nodiratime,nosuid,nodev,discard,inline_xattr wait,check,notrim,encryptable=/metadata/key_file
+/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data f2fs noatime,nodiratime,nosuid,nodev
wait,check,notrim,encryptable=/metadata/key_file
+/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard,errors=panic wait,check,encryptable=/metadata/key_file
/dev/block/platform/ff0f0000.dwmmc/by-name/misc /misc emmc defaults defaults
# /dev/block/platform/ff0f0000.dwmmc/by-name/radical_update /radical_update ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait
diff --git a/recovery.emmc.fstab b/recovery.emmc.fstab
old mode 100644
new mode 100755
index 572d70e..2981c59
--- a/recovery.emmc.fstab
+++ b/recovery.emmc.fstab
@@ -5,7 +5,7 @@
/dev/block/platform/ff0f0000.dwmmc/by-name/system /system ext4 defaults defaults
/dev/block/platform/ff0f0000.dwmmc/by-name/cache /cache ext4 defaults defaults
/dev/block/platform/ff0f0000.dwmmc/by-name/metadata /metadata ext4 defaults defaults
-/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data f2fs defaults defaults
+/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data ext4 defaults defaults
/dev/block/platform/ff0f0000.dwmmc/by-name/cust /cust ext4 defaults defaults
/dev/block/platform/ff0f0000.dwmmc/by-name/custom /custom ext4 defaults defaults
/dev/block/platform/ff0f0000.dwmmc/by-name/radical_update /radical_update ext4 defaults defaults
@@ -18,4 +18,4 @@
/dev/block/platform/ff0f0000.dwmmc/by-name/recovery /recovery emmc defaults defaults
/dev/block/platform/ff0f0000.dwmmc/by-name/backup /backup emmc defaults defaults
/dev/block/platform/ff0f0000.dwmmc/by-name/trust /trust emmc defaults defaults
-/dev/block/platform/ff0f0000.dwmmc/by-name/baseparamer /baseparamer emmc defaults defaults
+/dev/block/platform/ff0f0000.dwmmc/by-name/baseparamer /baseparamer emmc defaults defaults
\ No newline at end of file
device/rockchip/common:
diff --git a/device.mk b/device.mk
index 6f49c7e..3327a2f 100755
--- a/device.mk
+++ b/device.mk
@@ -73,7 +73,7 @@ PRODUCT_COPY_FILES += \
# Filesystem management tools
-PRODUCT_PACKAGES += \
+#PRODUCT_PACKAGES += \
mkfs_host.f2fs \
fsck.f2fs \
mkfs.f2fs \
Android8.1+rk3399:
/device/rockchip/common
diff --git a/device.mk b/device.mk
index 6f49c7e..3327a2f 100755
--- a/device.mk
+++ b/device.mk
@@ -73,7 +73,7 @@ PRODUCT_COPY_FILES += \
# Filesystem management tools
-PRODUCT_PACKAGES += \
+#PRODUCT_PACKAGES += \
mkfs_host.f2fs \
fsck.f2fs \
mkfs.f2fs \
/device/rockchip/rk3399
diff --git a/device.mk b/device.mk
index 0390c64..97e6e50 100755
--- a/device.mk
+++ b/device.mk
@@ -25,13 +25,13 @@ PRODUCT_PACKAGES += \
libion
#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)/init.rk3399.rc:root/init.rk3399.rc \
diff --git a/recovery.fstab b/recovery.fstab
index ab69841..e923582 100755
--- a/recovery.fstab
+++ b/recovery.fstab
@@ -7,7 +7,7 @@
/dev/block/by-name/oem /oem ext4 defaults defaults
/dev/block/by-name/cache /cache ext4 defaults defaults
/dev/block/by-name/metadata /metadata ext4 defaults defaults
-/dev/block/by-name/userdata /data f2fs defaults defaults
+/dev/block/by-name/userdata /data ext4 defaults defaults
/dev/block/by-name/cust /cust ext4 defaults defaults
/dev/block/by-name/custom /custom ext4 defaults defaults
/dev/block/by-name/radical_update /radical_update ext4 defaults defaults
diff --git a/rk3399_mid/fstab.rk30board b/rk3399_mid/fstab.rk30board
index b16e9de..5140639 100755
--- a/rk3399_mid/fstab.rk30board
+++ b/rk3399_mid/fstab.rk30board
@@ -14,4 +14,5 @@
# For sdmmc
/devices/platform/fe320000.dwmmc/mmc_host* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata
# Full disk encryption has less effect on rk3399, so default to enable this.
-/dev/block/by-name/userdata /data f2fs noatime,nodiratime,nosuid,nodev,discard,inline_xattr wait,check,notrim,forceencrypt=/metadata/key_file
+#/dev/block/by-name/userdata /data f2fs noatime,nodiratime,nosuid,nodev,discard,inline_xattr wait,check,notrim,forceencrypt=/metadata/key_file
+/dev/block/by-name/userdata /data ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard ,errors=panic wait,check,notrim,forceencrypt=/metadata/key_file
diff --git a/rk3399_mid/recovery.fstab b/rk3399_mid/recovery.fstab
index 26b8311..c0b3a08 100755
--- a/rk3399_mid/recovery.fstab
+++ b/rk3399_mid/recovery.fstab
@@ -7,7 +7,7 @@
/dev/block/platform/fe330000.sdhci/by-name/oem /oem ext4 defaults defaults
/dev/block/platform/fe330000.sdhci/by-name/cache /cache ext4 defaults defaults
/dev/block/platform/fe330000.sdhci/by-name/metadata /metadata ext4 defaults defaults
-/dev/block/platform/fe330000.sdhci/by-name/userdata /data f2fs defaults defaults
+/dev/block/platform/fe330000.sdhci/by-name/userdata /data ext4 defaults defaults
/dev/block/platform/fe330000.sdhci/by-name/cust /cust ext4 defaults defaults
/dev/block/platform/fe330000.sdhci/by-name/custom /custom ext4 defaults defaults
/dev/block/platform/fe330000.sdhci/by-name/radical_update /radical_update ext4 defaults defaults
修改成功後,cat /proc/mounts可看出來:
EXT4是Linux的標準檔案系統,但相對與F2FS I/O讀寫速度較慢。