目的:现在大容量的SD卡等一般用的是 exfat 格式;所以也就想让 ARM 支持 exFAT。
编译环境:ubuntu 11.10 ;arm-linux-gcc-4.5.1。
1. 下载源码:
1) fuse-2.8.7.tar.gz;
2) svn co /home/ljd/src/exfat-read-only
3) linux-3.0.8.tar.gz for Tiny210。
2. 编 译:
1) 因为这个 exfat 源码编译脚本用的是 scons,而不是 Makefile; 所以要安装 scons:
apt-get install scons
2) 编译 fuse:
cd /home/ljd/src/fuse-2.8.7
./configure --host=arm-linux --prefix=/opt
make DESTDIR="/home/ljd/src/_install" install
cp -a /home/ljd/src/_install/* ~/tiny21-dev/linux/filesystem/nfs-boot/
3) 编译 exfat:
(1) cd /home/ljd/src/exfat-read-only
(2) vi libexfat/compiler.h +26 注释如下几行:
#if __STDC_VERSION__ < 199901L
#error C99-compliant compiler is required
#endif
(3) AR=arm-linux-ar RANLIB=arm-linux-ranlib CC=arm-linux-gcc CCFLAGS="-I/home/ljd/src/_install/opt/include -Wl,-rpath - Wl,/opt/lib" LDFLAGS=-L/home/ljd/src/_install/opt/lib scons DESTDIR="$PWD/_install_arm" install
(4) cp -a $PWD/_install_arm/* ~/tiny21-dev/linux/filesystem/nfs-boot/opt/bin
4) 编译fulse.ko:
(1) make CONFIG_FUSE_FS=m -C /root/tiny210-dev/linux/kernel/linux-3.0.8 M=/root/tiny210-dev/linux/kernel/linux-3.0.8/fs/fuse
(2) cp /root/tiny210-dev/linux/kernel/linux-3.0.8/fs/fuse/fuse.ko ~/tiny21-dev/linux/filesystem/nfs-boot/modules
3. 测 试:
1. insmod /modules/fuse.ko
2. mkfs.exfat
3. mount.exfat /dev/sdcard /sdcard
4. mount
/dev/sdcard on /sdcard type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
5. dd if=/dev/zero of=/sdcard/10Mfile count=10 bs=1M
10+0 records in
10+0 records out
10485760 bytes (10.0MB) copied, 0.184571 seconds, 54.2MB/s
6. ls -shl /sdcard/10Mfile
10240 -rwxr-xr-x 1 root root 10.0M Jul 2 03:07 /sdcard/10Mfile
读写成功。
阅读(1586) | 评论(0) | 转发(0) |