本文介绍如何编译静态 mtd-utils 包,移植到 ARM 开发板Tiny 6410.
1. git clone mtd-utils 工具包源代码:
http://git.infradead.org/mtd-utils.git
$ git clone git://git.infradead.org/mtd-utils.git
2. mtd-utils 包依赖于 liblzo2,因此先编译 liblzo2.a
2.1 下载 lzo 源代码 lzo-2.06.tar.gz:
http://www.oberhumer.com/opensource/lzo/download/
2.2 编译 安装 lzo
$ tar vxzf lzo-2.06.tar.gz
$ ./configure --host=i686 --target=arm-linux CC=arm-linux-gcc --prefix=/home/chenqiang/lzo CFLAGS=-static
$ make
$ make install
3. 编译 mtd-utils:
修改 ./ Makefile 文件
将CPPFLAGS += -I./include -I$(BUILDDIR)/include -I./ubi-utils/include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS) 改成:
CPPFLAGS += -I./include -I$(BUILDDIR)/include -I./ubi-utils/include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS) -I/home/chenqiang/lzo/include
$ make CROSS=arm-linux- WITHOUT_XATTR=1 LDLIBS=-L/home/chenqiang/lzo/lib CFLAGS=-static
$ make install DESTDIR=/home/chenqiang/mtd-utils CROSS=arm-linux-
4. 安装到ARM 开发板:
$ tar -cf mtd-utils.tar mtd-utils
$ adb push mtd-utils.tar /
参考文章:
http://blog.csdn.net/liuyuze/article/details/8092333
That's all !
Enjoy your mtd-utils on ARM DEV board !