ARM 支持exFAT格式存储设备
首先需要下载exFAT源码包

exfat源码

流程
在kernel / fs 目录下面添加exfat 源代码

cp -r exfat {kernel_source_dir}/fs/

修改fs/Kconfig,在 source “fs/fat/Kconfig” 下添加 source “fs/exfat/Kconfig”

vi {kernel_source_dir}/fs/Kconfig +100

修改fs/Makefile,obj-$ (CONFIG_FAT_FS) += fat/ 下添加 obj-$(CONFIG_EXFAT_FS) += exfat/

vi {kernel_source_dir}/fs/Makefile +78

然后在menuconfig下配置exfat选项

make ARCH=arm CROSS_COMPILE=arm-xxx-linux- menuconfig
File systems —>
DOS/FAT/NT Filesystems —>
< * > exFAT fs support (NEW)
[ * ] enable discard support (NEW)
[ * ] enable delayed sync (NEW)
[ ] enable kernel debug features via ioctl (NEW)
[ ] print debug messages (NEW)
(437)Default codepage for exFAT (NEW)
(utf8) Default iocharset for exFAT (NEW)

注意:如果选项里边找不到exfat选项,那么直接编译,就会提示你配置exfat,如上所示去配置
编译

make ARCH=arm CROSS_COMPILE=arm-xxx-linux- uImage

挂载

mount -t exfat /dev/sda1 /mnt/sda1

修改自动挂载选项

vi /etc/hotplug/sdcard_insert


if [ -e "/dev/$MDEV" ]  ; then
        if [ -d "/mnt/tfcard" ]; then
                echo "Directory exists"
        else
                echo "Creating directory"
                mkdir -p /mnt/tfcard
                chmod 777 /mnt/tfcard
        fi
        chmod 777 /mnt -R
        chmod 777 /mnt/tfcard -R
        mount -t vfat -o rw,umask=000 /dev/$MDEV /mnt/tfcard
        if [ $? -ne 0 ]; then
                mount -t exfat -o rw,umask=000 /dev/$MDEV /mnt/tfcard
                if [ $? -ne 0 ]; then
                        echo "Failed to mount /dev/$MDEV as vfat or exfat"
                        exit 1
                fi
        fi
        if df | grep -q "/mnt/tfcard"; then
                echo "Mounted /dev/$MDEV successfully"
                echo 0 > /mnt/tfcard/info.txt
                sync
                rm /mnt/tfcard/info.txt
                sync
        else
                echo "Failed to mount /dev/$MDEV"
                exit 1
        fi

fi

使用df命令查看挂截情况

强制取消挂载

umount -f /mnt/tfcard