赞
踩
Android本身不支持extfat格式 需要通过nofuse 打kernel补丁方式去实现
Android 8/9
1、kernel/msm-4.9/arch/arm64/configs/sdm670-perf_defconfig 增加代码如下(需要提交编译kernel记得git add sdm670-perf_defconfig 不需要commit哈!否则编译会还原这个文件,切记!)
- --- a/LINUX/android/kernel/msm-4.9/arch/arm64/configs/sdm670-perf_defconfig
- +++ b/LINUX/android/kernel/msm-4.9/arch/arm64/configs/sdm670-perf_defconfig
- @@ -314,6 +314,7 @@ CONFIG_INPUT_UINPUT=y
- # CONFIG_DEVMEM is not set
- # CONFIG_DEVKMEM is not set
- CONFIG_SERIAL_MSM_GENI=y
- +CONFIG_SERIAL_MSM_GENI_CONSOLE=y
- CONFIG_DIAG_CHAR=y
- CONFIG_HW_RANDOM=y
- CONFIG_HW_RANDOM_MSM_LEGACY=y
- @@ -602,6 +603,9 @@ CONFIG_QFMT_V2=y
- CONFIG_FUSE_FS=y
- CONFIG_MSDOS_FS=y
- CONFIG_VFAT_FS=y
- +CONFIG_EXFAT_FS=y
- +CONFIG_EXFAT_DEFAULT_CODEPAGE=437
- +CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8"
- CONFIG_TMPFS_POSIX_ACL=y
- CONFIG_ECRYPT_FS=y
- CONFIG_ECRYPT_FS_MESSAGING=y
2、kernel/msm-4.9/arch/arm64/configs/sdm670_defconfig中增加如下代码
- diff --git a/kernel/msm-4.9/arch/arm64/configs/sdm670_defconfig b/kernel/msm-4.9/arch/arm64/configs/sdm670_defconfig
- index 934e100174..f2302ecd52 100644
- --- a/kernel/msm-4.9/arch/arm64/configs/sdm670_defconfig
- +++ b/kernel/msm-4.9/arch/arm64/configs/sdm670_defconfig
- @@ -603,6 +603,9 @@ CONFIG_QFMT_V2=y
- CONFIG_FUSE_FS=y
- CONFIG_MSDOS_FS=y
- CONFIG_VFAT_FS=y
- +CONFIG_EXFAT_FS=y
- +CONFIG_EXFAT_DEFAULT_CODEPAGE=437
- +CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8"
- CONFIG_TMPFS_POSIX_ACL=y
- CONFIG_ECRYPT_FS=y
- CONFIG_ECRYPT_FS_MESSAGING=y
Android 12/13
3、kernel/msm-4.19/arch/arm64/configs/vendor/device-perf_defconfig 增加(需要提交编译kernel记得git add device-perf_defconfig 不需要commit哈! 否则编译会还原这个文件,切记!)
- diff --git a/kernel/msm-4.19/arch/arm64/configs/vendor/device-perf_defconfig b/kernel/msm-4.19/arch/arm64/configs/vendor/device-perf_defconfig
-
- index a072c626fe7..b150b127880 100644
-
- --- a/kernel/msm-4.19/arch/arm64/configs/vendor/device-perf_defconfig
-
- +++ b/kernel/msm-4.19/arch/arm64/configs/vendor/device-perf_defconfig
-
- @@ -28,6 +28,9 @@ CONFIG_CGROUP_CPUACCT=y
-
- CONFIG_CGROUP_BPF=y
-
- CONFIG_SCHED_CORE_CTL=y
-
- CONFIG_NAMESPACES=y
-
- +CONFIG_EXFAT_FS=y
-
- +CONFIG_NTFS_FS=y
-
- +CONFIG_NTFS_RW=y
-
- # CONFIG_PID_NS is not set
-
- CONFIG_SCHED_AUTOGROUP=y
-
- CONFIG_SCHED_TUNE=y
4、kernel/msm-4.19/arch/arm64/configs/vendor/device_defconfig中增加
- diff --git a/kernel/msm-4.19/arch/arm64/configs/vendor/bengal_defconfig b/kernel/msm-4.19/arch/arm64/configs/vendor/bengal_defconfig
-
- index 4bb8f0343e6..5e66d553d36 100644
-
- --- a/kernel/msm-4.19/arch/arm64/configs/vendor/bengal_defconfig
-
- +++ b/kernel/msm-4.19/arch/arm64/configs/vendor/bengal_defconfig
-
- @@ -29,6 +29,10 @@ CONFIG_CGROUP_BPF=y
-
- CONFIG_CGROUP_DEBUG=y
-
- CONFIG_SCHED_CORE_CTL=y
-
- CONFIG_NAMESPACES=y
-
- +CONFIG_EXFAT_FS=y
-
- +CONFIG_NTFS_FS=y
-
- +CONFIG_NTFS_RW=y
-
- +
-
- # CONFIG_PID_NS is not set
-
- CONFIG_SCHED_AUTOGROUP=y
-
- CONFIG_SCHED_TUNE=y
5、kernel/msm-4.19/fs/Kconfig b/kernel/msm-4.19/fs/Kconfig 增加+source "fs/exfat/Kconfig"
- diff --git a/kernel/msm-4.19/fs/Kconfig b/kernel/msm-4.19/fs/Kconfig
-
- index b8d003f02b7..947e731b316 100644
-
- --- a/kernel/msm-4.19/fs/Kconfig
-
- +++ b/kernel/msm-4.19/fs/Kconfig
-
- @@ -137,6 +137,8 @@ menu "DOS/FAT/NT Filesystems"
-
- source "fs/fat/Kconfig"
-
- source "fs/ntfs/Kconfig"
-
- +source "fs/exfat/Kconfig"
-
- +
6、kernel/msm-4.19/fs/Makefile b/kernel/msm-4.19/fs/Makefile 中增加+obj-$(CONFIG_EXFAT_FS) += exfat/
- diff --git a/kernel/msm-4.19/fs/Makefile b/kernel/msm-4.19/fs/Makefile
-
- index 9d1caea038f..56aca48a51d 100644
-
- --- a/kernel/msm-4.19/fs/Makefile
-
- +++ b/kernel/msm-4.19/fs/Makefile
-
- @@ -80,6 +80,7 @@ obj-$(CONFIG_HUGETLBFS) += hugetlbfs/
-
- obj-$(CONFIG_CODA_FS) += coda/
-
- obj-$(CONFIG_MINIX_FS) += minix/
-
- obj-$(CONFIG_FAT_FS) += fat/
-
- +obj-$(CONFIG_EXFAT_FS) += exfat/
-
- obj-$(CONFIG_BFS_FS) += bfs/
-
- obj-$(CONFIG_ISO9660_FS) += isofs/
-
- obj-$(CONFIG_HFSPLUS_FS) += hfsplus/ # Before hfs to find wrapped HFS+
-
- diff --git a/kernel/msm-4.19/fs/exfat/.gitignore b/kernel/msm-4.19/fs/exfat/.gitignore
-
- new file mode 100644
-
- index 00000000000..241505f47ee
-
- --- /dev/null
7、
+++ b/kernel/msm-4.19/fs/exfat/.gitignore
- kernel/msm-4.19/fs/exfat/.gitignore | 7 +
-
- kernel/msm-4.19/fs/exfat/Kconfig | 39 +
-
- kernel/msm-4.19/fs/exfat/LICENSE | 339 ++++++++
-
- kernel/msm-4.19/fs/exfat/Makefile | 56 ++
-
- kernel/msm-4.19/fs/exfat/README.md | 98 +++
-
- kernel/msm-4.19/fs/exfat/dkms.conf | 7 +
-
- kernel/msm-4.19/fs/exfat/exfat-km.mk | 11 +
-
- kernel/msm-4.19/fs/exfat/exfat_api.c | 528 ++++++++++++
-
- kernel/msm-4.19/fs/exfat/exfat_api.h | 206 +++++
-
- kernel/msm-4.19/fs/exfat/exfat_bitmap.c | 63 ++
-
- kernel/msm-4.19/fs/exfat/exfat_bitmap.h | 55 ++
-
- kernel/msm-4.19/fs/exfat/exfat_blkdev.c | 197 +++++
-
- kernel/msm-4.19/fs/exfat/exfat_blkdev.h | 73 ++
-
- kernel/msm-4.19/fs/exfat/exfat_cache.c | 784 +++++++++++++++++
-
- kernel/msm-4.19/fs/exfat/exfat_cache.h | 85 ++
-
- kernel/msm-4.19/fs/exfat/exfat_config.h | 69 ++
-
- kernel/msm-4.19/fs/exfat/exfat_core.c | 5138 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- kernel/msm-4.19/fs/exfat/exfat_core.h | 671 +++++++++++++++
-
- kernel/msm-4.19/fs/exfat/exfat_data.c | 77 ++
-
- kernel/msm-4.19/fs/exfat/exfat_data.h | 58 ++
-
- kernel/msm-4.19/fs/exfat/exfat_nls.c | 448 ++++++++++
-
- kernel/msm-4.19/fs/exfat/exfat_nls.h | 91 ++
-
- kernel/msm-4.19/fs/exfat/exfat_oal.c | 196 +++++
-
- kernel/msm-4.19/fs/exfat/exfat_oal.h | 74 ++
-
- kernel/msm-4.19/fs/exfat/exfat_super.c | 2711 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- kernel/msm-4.19/fs/exfat/exfat_super.h | 171 ++++
-
- kernel/msm-4.19/fs/exfat/exfat_upcase.c | 405 +++++++++
-
- kernel/msm-4.19/fs/exfat/exfat_version.h | 19 +
8、添加好之后记得将device-perf_defconfig文件git add 平台(rk/全志/展锐/高通)/kernel/msm-4.19/arch/arm64/configs/vendor/device_defconfig 否则编译的时候会恢复到原来没修改状态 会导致无法在out/target/product/bengal/obj/kernel/msm-4.19/fs/exfat 生成对应.o文件 切记
9、执行编译就ok 编译成功之后在 window 下面 adb shell cat /proc/filesystems ,如果列表出现exfat格式说明当前设备已经支持exfat格式 如下图所示
10、到这里基本结束了,其他平台具体以实际平台情况为主,有问题可以评论区或者讨论哈!转载请注明出处 谢谢!有学习framework大佬们可以一起交流 加我WeChat 一起学习 一起进步 kdanmobile
感谢:Android 9.0 支持NTFS和Exfat 格式U盘开发_android ntfs_Mrsongs的心情杂货铺的博客-CSDN博客
转载请注明出处 谢谢 高通 Android 13 兼容extfat模式_KdanMin的博客-CSDN博客
其他源码补丁源码下载 mirrors / dorimanx / exfat-nofuse · GitCode
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。