介绍交叉编译mtd-util的文章以及很多了,但是没有1.4.6版本的详细过程,我刚好工作需要编译了一个,前半部分基本是参考网上资料,只有最后mtd-util编译出错的地方无法照搬(也就是ubifs编译的时候的错误),经过分析网上的解决办法,无非就是将类型定义提供给缺少的c文件,触类旁通的修改了一下,证明我的思路是对的!
因为有一段时间了,代码版本都在公司,大家可以参考时间戳下载对应2012-10-08日时候的最新版本的软件包.
1)首先编译e2fsprogs
#./configure --host=i686-linux --target=arm-linux CC=arm-linux-gcc --enable-elf-shlibs --prefix=/root/work/util/mtd-util/arm_installed
#make
编译出错,参考
http://blog.chinaunix.net/uid-26119896-id-3257394.html
http://forums.gentoo.org/viewtopic-p-644204.html
按如下形式修改/misc/e4defrag.c:
新增
#ifndef __NR_fallocate
#define __NR_fallocate 324
#endif
注释掉这些行