您现在的位置是:首页 >其他 >高通 Android 13 兼容extfat模式网站首页其他

高通 Android 13 兼容extfat模式

KdanMin 2024-06-07 12:00:03
简介高通 Android 13 兼容extfat模式

Android本身不支持extfat格式 需要通过nofuse 打kernel补丁方式去实现 

1、kernel/msm-4.19/arch/arm64/configs/vendor/device-perf_defconfig 增加

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

2、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

3、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"

+

4、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

5、

+++ 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 +

6、添加好之后记得将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文件 切记

7、执行编译就ok 编译成功之后在 window 下面 adb shell cat /proc/filesystems ,如果列表出现exfat格式说明当前设备已经支持exfat格式 如下图所示

8、到这里基本结束了,其他平台具体以实际平台情况为主,有问题可以评论区或者讨论哈!转载请注明出处 谢谢!有学习framework大佬们可以一起交流 加我WeChat   一起学习 一起进步 kdanmobile 

转载请注明出处 谢谢 高通 Android 13 兼容extfat模式_KdanMin的博客-CSDN博客

其他源码补丁源码下载 mirrors / dorimanx / exfat-nofuse · GitCode

风语者!平时喜欢研究各种技术,目前在从事后端开发工作,热爱生活、热爱工作。