系统环境:Loongson-1B(mips32指令集)、Busybox1.19.2、Linux2.6.21
编译环境:Ubuntu10.04、gcc-3.4.6-2f
嵌入式系统中,在挂载的U盘(FAT32格式)或移动硬盘建立文件时,文件名只能显示8+3长度(文件名8个字符+扩展名3个字符),超过这个长度的文件名后面就会被~1替代。解决文件名显示长度限制方法如下:
配置busybox:
#cd ./busybox1.19.2
#make menuconfig
选择Linux System Utilities --->
[*]mount
[*] Support option -f
[*] Support option -v
[*] Support sepcifying devices by label or UUID
[*] Support mounting NFS file systems
[*] Support mount CIFS/SMB file systems
[*] support lots of -o flags in mount
[*] support /etc/fstab and -a
#make && make install
配置Kernel:
#cd ./linux-2.6.21
#make menucofnig
选择File systems --->
<*>Filesystem in Userspace support
DOS/FAT/NT Filesystems --->
<*>MSDOS fs support
<*>VFAT (Windows-95) fs support
(936) Default codepage for FAT
(utf8) Default iocharset for FAT
Native Language Support --->
(cp936) Default NLS Option
<*> Simplified Chinese charset (CP936, GB2312)
<*> NLS UTF-8
#make
挂载u盘:
文件系统中,挂载u盘时使用-t指定系统格式
#mount -t vfat /dev/sda1 /tmp
#ls
配置完成后,显示的文件名信息正常。