(Changed download from .tar.gz to .tar.bz2) |
(Added extra pre-built binary) |
||
(5 intermediate revisions by one user not shown) | |||
Line 11: | Line 11: | ||
<PRE> | <PRE> | ||
− | wget http://zlib.net/zlib-1.2. | + | wget http://zlib.net/zlib-1.2.8.tar.gz |
− | tar -xzf zlib-1.2. | + | tar -xzf zlib-1.2.8.tar.gz |
− | cd zlib-1.2. | + | cd zlib-1.2.8/ |
./configure --prefix=/home/temp/mtdutils | ./configure --prefix=/home/temp/mtdutils | ||
</PRE> | </PRE> | ||
Line 20: | Line 20: | ||
<PRE> | <PRE> | ||
− | CC=arm | + | CC=arm-linux-gnueabi-gcc |
− | LDSHARED=arm | + | LDSHARED=arm-linux-gnueabi-gcc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map |
− | CPP=arm | + | CPP=arm-linux-gnueabi-gcc -E |
− | AR | + | AR=arm-linux-gnueabi-ar |
− | RANLIB | + | RANLIB=arm-linux-gnueabi-ranlib |
</PRE> | </PRE> | ||
Line 42: | Line 42: | ||
tar -xzf lzo-2.06.tar.gz | tar -xzf lzo-2.06.tar.gz | ||
cd lzo-2.06/ | cd lzo-2.06/ | ||
− | ./configure --host=arm | + | ./configure --host=arm-linux-gnueabi --prefix=/home/temp/mtdutils |
make | make | ||
make install | make install | ||
Line 52: | Line 52: | ||
<PRE> | <PRE> | ||
− | wget http://sourceforge.net/projects/e2fsprogs/files/e2fsprogs/ | + | wget http://sourceforge.net/projects/e2fsprogs/files/e2fsprogs/v1.42.9/e2fsprogs-1.42.9.tar.gz |
− | tar -xzf e2fsprogs-1.42.tar.gz | + | tar -xzf e2fsprogs-1.42.9.tar.gz |
− | cd e2fsprogs-1.42 | + | cd e2fsprogs-1.42.9 |
− | ./configure --host=arm | + | ./configure --host=arm-linux-gnueabi --prefix=/home/temp/mtdutils |
make | make | ||
make install | make install | ||
Line 75: | Line 75: | ||
<PRE> | <PRE> | ||
PREFIX = /home/temp/mtdutils | PREFIX = /home/temp/mtdutils | ||
− | CROSS=arm | + | CROSS=arm-linux-gnueabi- |
ZLIBCPPFLAGS = -I$(PREFIX)/include | ZLIBCPPFLAGS = -I$(PREFIX)/include | ||
Line 96: | Line 96: | ||
== Download Pre-built Binaries == | == Download Pre-built Binaries == | ||
− | The link below contains a | + | The link below contains a bzip2 tarball of the MTD-utils binaries compiled for ARM : |
* [http://wiki.beyondlogic.org/prebuilt/mtdutils-1.4.9-arm-none-linux-gnueabi.tar.bz2 mtdutils-1.4.9-arm-none-linux-gnueabi.tar.bz2] [md5hash 0b310324186904cf5c8e92d558d55e8c] | * [http://wiki.beyondlogic.org/prebuilt/mtdutils-1.4.9-arm-none-linux-gnueabi.tar.bz2 mtdutils-1.4.9-arm-none-linux-gnueabi.tar.bz2] [md5hash 0b310324186904cf5c8e92d558d55e8c] | ||
Line 106: | Line 106: | ||
** mtd-utils 1.4.9 | ** mtd-utils 1.4.9 | ||
** arm-none-linux-gnueabi-gcc version 4.6.1 (Sourcery CodeBench Lite 2011.09-70) | ** arm-none-linux-gnueabi-gcc version 4.6.1 (Sourcery CodeBench Lite 2011.09-70) | ||
+ | |||
+ | * [http://wiki.beyondlogic.org/prebuilt/mtdutils-1.5.0-arm-linux-gnueabi.tar.bz2 mtdutils-1.5.0-arm-linux-gnueabi.tar.bz2] [md5hash 265a270d2f2f288d60c4ff9b0df1eba5] | ||
+ | |||
+ | * Built using: | ||
+ | ** zlib 1.2.8 | ||
+ | ** lzo 2.06 | ||
+ | ** e2fsprogs 1.42.9 | ||
+ | ** mtd-utils 1.5.0 | ||
+ | ** arm-linux-gnueabi-gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) |
At some stage you may need to run MTD utilities like flash_erase, mtdinfo, ubiformat, ubinfo on your ARM target system. The following includes details on how to build/cross compile the MTD utilities for ARM processors.
The MTD Utils require zlib and LZO compression libraries, and uuid from e2fsprogs as dependencies.
Download, cross compile and install the zlib compression libraries. Configure doesn't accept the --host parameter (reports unknown option), so you need to hack the makefile.
wget http://zlib.net/zlib-1.2.8.tar.gz tar -xzf zlib-1.2.8.tar.gz cd zlib-1.2.8/ ./configure --prefix=/home/temp/mtdutils
Edit the makefile and prefix the build tools with arm-none-linux-gnueabi-.
CC=arm-linux-gnueabi-gcc LDSHARED=arm-linux-gnueabi-gcc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map CPP=arm-linux-gnueabi-gcc -E AR=arm-linux-gnueabi-ar RANLIB=arm-linux-gnueabi-ranlib
Make and install:
make make install
Download, cross compile and install the LZO data compression library:
wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.06.tar.gz tar -xzf lzo-2.06.tar.gz cd lzo-2.06/ ./configure --host=arm-linux-gnueabi --prefix=/home/temp/mtdutils make make install
The mtd-util uses uuid from the e2fsprogs source. Download, cross compile and install:
wget http://sourceforge.net/projects/e2fsprogs/files/e2fsprogs/v1.42.9/e2fsprogs-1.42.9.tar.gz tar -xzf e2fsprogs-1.42.9.tar.gz cd e2fsprogs-1.42.9 ./configure --host=arm-linux-gnueabi --prefix=/home/temp/mtdutils make make install cd lib/uuid/ make install
With the dependencies above cross compiled for ARM and installed, we can now focus on MTD-Utils. Download the mtd-utils from GIT:
git clone git://git.infradead.org/mtd-utils.git cd mtd-utils
mtd-utils does not include a configure script, so we must hack the makefile to cross compile it. Add the following to the makefile :
PREFIX = /home/temp/mtdutils CROSS=arm-linux-gnueabi- ZLIBCPPFLAGS = -I$(PREFIX)/include ZLIBLDFLAGS = -L$(PREFIX)/lib LZOCPPFLAGS = -I$(PREFIX)/include LZOLDFLAGS = -L$(PREFIX)/lib LDFLAGS += $(ZLIBLDFLAGS) $(LZOLDFLAGS) CFLAGS ?= -O2 -g $(ZLIBCPPFLAGS) $(LZOCPPFLAGS)
Edit the common.mk file and comment out the PREFIX=/usr line. Then make and install:
WITHOUT_XATTR=1 make make install
The link below contains a bzip2 tarball of the MTD-utils binaries compiled for ARM :