2014年(11)
分类: 嵌入式
2014-03-24 17:18:50
arm版:
下载最新mtd源码
(下载带orig后缀的文件)
建立一个文件夹:ubifs,作为工作目录,并将相关源码放置其中新建_install文件夹作为编译安装目录
设置环境变量
编译zlib
tar xvzf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure --shared --prefix=$PREFIX
make
make install
编译lzo
tar xvzf lzo-2.03.tar.gz
cd lzo-2.03
./configure --host=$TARGET --prefix=$PREFIX
make
make install
编译mtd
tar xvzf mtd-utils_1.5.0.orig.tar.gz
cd mtd-utils-1.5.0/
export WITHOUT_XATTR=1
export CROSS=arm-none-linux-gnueabi-
编辑Makefile
约第6行
-I./include -I$(BUILDDIR)/include -I./ubi-utils/include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS)
改为
-I./include -I$(BUILDDIR)/include -I./ubi-utils/include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS) -I../_install/include
约第14行
LZOLDLIBS = -llzo2
改为
LZOLDLIBS = -L../_install/lib/ -llzo2
make
make install
编译不会完全通过,出错提示
In file included from mkfs.ubifs/mkfs.ubifs.c:25:
mkfs.ubifs/mkfs.ubifs.h:48:23: error: uuid/uuid.h: No such file or directory
mkfs.ubifs/mkfs.ubifs.c: In function 'write_data':
但是没关系,已经生成arm-none-linux-gnueabi目录,在此目录下生成所需arm版本的mtd工具。
X86版
更新ubuntu10.04软件源
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
(备份当前的源列表,以便日後需要时恢复)
sudo gedit /etc/apt/sources.list
(修改sources.list文件中源的列表)
sudo apt-get update
(这一步是更新你的源列表,换源後必须执行)
用下台湾源
# 台湾的官方源速度也相当不错,有时甚至快于内地的:
deb lucid main restricted universe multiverse
deb lucid-security main restricted universe multiverse
deb lucid-updates main restricted universe multiverse
deb lucid-backports main restricted universe multiverse
deb lucid-proposed main restricted universe multiverse
deb-src lucid main restricted universe multiverse
deb-src lucid-security main restricted universe multiverse
deb-src lucid-updates main restricted universe multiverse
deb-src lucid-backports main restricted universe multiverse
deb-src lucid-proposed main restricted universe multiverse
参考:
下载最新mtd源码
(下载带orig后缀的文件)
tar xvzf mtd-utils_1.5.0.orig.tar.gz
cd mtd-utils-1.5.0/
make
make install
error: sys/acl.h: No such file or directory
export WITHOUT_XATTR=1
错误:zlib.h: No such file or directory
缺少zlib库
解决:sudo apt-get install zlib1g-dev
错误: lzo/lzo1x.h: No such file or directory
缺少lzo库
解决:apt-get install liblzo2-dev
出错:uuid/uuid.h: No such file or directory
缺少e2fsprogs
解决:apt-get install uuid-dev