mtd-utils交叉编译安装

摘要:
cd/home/zhangyi/work/posc_Ltpmkdirtutils二。编译并安装zlibcd./zlib-1.2.11/#/configure--prefix=$PWD/install_DirexportCC=arm-linux-gnueabihf-gcc#否则,编译x86体系结构,然后编译mtd_将在utils:libz中报告错误。sofilenotrecognized:文件格式无法识别/configure--prefix=/home/zhangyi/work/posc_ltp/mtdutils--staticmake&&makeinstall III编译并安装lzo-2.10cd./lzo-2.10/#/configure--prefix=$PWD/install_dir--host=arm-linux/configureCC=arm-linux-gnueabihf-gcc--prefix=/home/zhangyi/work/posc_Ltp/mtdutils--host=arm-liinux-enable-static#注意,以前是这样的/configure--prefix=../mtutils提示configure:error:expectedabsolutedirectoryname for--prefix:../mtutils。因此,绝对地址更可靠。2.10之前的配置将遇到符合性测试失败的问题。制作并制作安装IV。编译并安装e2fsprogs-141.14./configureCC=arm-linux-gnueabihf-gcc-host=arm-liinux-prefix=/home/zhangyi/work/posc_Ltp/mtdutilscdlb/uuid/Make&&install V。编译并安装mtd-utils-2.0.0#cd./mtd-utils-1.4.5/#exportZLIBCPFLAGS=-I/home/zhangyi/work/posc_ltp/mtdutils/include#exportZLIBLDFLAGS=-L/home/zhangyi/work/posc_lt p/mtdutils/lib#exportLZOCPPFLAGS=-I/home/hangyi/work/Posc_ltp/mtdutils/include/lzo#exportLZOLDFLAG=-L/homes/zhangyi/work/pssc_ltp/mtdutils/lib#makeCROSS=arm-linux-gnueabihf-WITHOUT_存在问题XATTR=11.4.5假设。经过检查,据说版本太旧,与更新的ubuntu不兼容。它返回到2.0.0.cd./mtd-utils-2.0.0exportZLIB_CFLAGS=-I/home/zhangyi/work/posc_ltp/mtdutils/includeexportZLIB_LIB_LIB=-L/home/zhangyi/work/posc_lt p/mtdutils/libexportLZO_CFLAGS=-I/home/zhangyi/work/pssc_ltp/mtdutils/include/lzoexportLZO_LIBS=-L/home/zhangyi/work/pos_cltp/mtdutils/libexportUUID_CFLAGS=-I/home/zhangyi/工作/posc_ltp/mtdutils/include/uuidexportUUID_LIBS=-L/home/zhangyi/work/posc_Ltp/mtdutils/lib/pkgconfigexportLDFLAGS=“$ZLIB_LIBS$LZO_LIBS$UUID_LIBS luuid-lz”exportCFLAGS=“-O2-g$ZLIB_CFLAGS$LZO_CFLAGS$UUID_FLAGS”#-luid-lz是在根据make报告的错误进行查询后添加的。#您必须使用export将其导出为环境变量,否则configure无法使用它。

一、获取源码并解压

存储于/home/zhangyi/work/psoc_ltp/tools-ltp-ddt中,解压后的源码存于上一层目录。

1.mtd-utils-2.0.0

wget ftp://ftp.infradead.org/pub/mtd-utils/mtd-utils-2.0.0.tar.bz2

tar -jxvf mtd-utils-2.0.0.tar.bz2 -C ..#解压到上一层目录

#wget ftp://ftp.infradead.org/pub/mtd-utils/mtd-utils-1.4.5.tar.bz2

#tar -jxvf mtd-utils-1.4.5.tar.bz2 -C .. #解压到上一层目录

2.zlib-1.2.11

wget http://www.zlib.net/zlib-1.2.11.tar.gz

tar -zxvf zlib-1.2.11.tar.gz -C ..#解压到上一层目录

.3.lzo-2.04

#wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz

#tar -zxvf lzo-2.10.tar.gz

wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.04.tar.gz

tar -zxvf lzo-2.04.tar.gz -C ..

4.e2fsprogs-1.41.14

#wget http://sourceforge.net/projects/e2fsprogs/files/e2fsprogs/v1.41.14/e2fsprogs-1.41.14.tar.gz

#tar -xzf e2fsprogs-1.41.14.tar.gz -C ..#无法解压

git clone git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git #git下来的是源码,非压缩包

cp -R e2fsprogs/ ..

编译安装前,先建立一个安装目录。

cd /home/zhangyi/work/psoc_ltp

mkdir mtdutils

二、编译安装zlib

cd ./zlib-1.2.11/

#./configure --prefix=$PWD/install_dir

export CC=arm-linux-gnueabihf-gcc #否则编译出x86架构的,在编译mtd_utils时候会报错libz.so file not recognized: File format not recognized

./configure --prefix=/home/zhangyi/work/psoc_ltp/mtdutils --static

make && make install

三、编译安装lzo-2.10

cd ./lzo-2.10/

#./configure --prefix=$PWD/install_dir --host=arm-linux

./configure CC=arm-linux-gnueabihf-gcc --prefix=/home/zhangyi/work/psoc_ltp/mtdutils --host=arm-linux --enable-static

#注意之前是./configure --prefix=../mtdutils 提示configure: error: expected an absolute directory name for --prefix: ../mtdutils 所以还是绝对地址比较靠谱

2.10之前的版本configure会碰到ACC conformance test failed问题。

make && make install

四、编译安装e2fsprogs-1.41.14

./configure CC=arm-linux-gnueabihf-gcc --host=arm-linux --prefix=/home/zhangyi/work/psoc_ltp/mtdutils

cd lib/uuid/

make && make install

五、编译安装mtd-utils-2.0.0

#cd ./mtd-utils-1.4.5/

#export ZLIBCPPFLAGS=-I/home/zhangyi/work/psoc_ltp/mtdutils/include
#export ZLIBLDFLAGS=-L/home/zhangyi/work/psoc_ltp/mtdutils/lib
#export LZOCPPFLAGS=-I/home/zhangyi/work/psoc_ltp/mtdutils/include/lzo
#export LZOLDFLAGS=-L/home/zhangyi/work/psoc_ltp/mtdutils/lib

#make CROSS=arm-linux-gnueabihf- WITHOUT_XATTR=1
 
1.4.5make有问题,查了一下说版本太老,和较新的ubuntu不兼容,又回到2.0.0版本。
 
cd ./mtd-utils-2.0.0
export ZLIB_CFLAGS=-I/home/zhangyi/work/psoc_ltp/mtdutils/include
export ZLIB_LIBS=-L/home/zhangyi/work/psoc_ltp/mtdutils/lib
export LZO_CFLAGS=-I/home/zhangyi/work/psoc_ltp/mtdutils/include/lzo
export LZO_LIBS=-L/home/zhangyi/work/psoc_ltp/mtdutils/lib
export UUID_CFLAGS=-I/home/zhangyi/work/psoc_ltp/mtdutils/include/uuid
export UUID_LIBS=-L/home/zhangyi/work/psoc_ltp/mtdutils/lib/pkgconfig
export LDFLAGS="$ZLIB_LIBS $LZO_LIBS $UUID_LIBS-luuid -lz"
export CFLAGS="-O2 -g $ZLIB_CFLAGS $LZO_CFLAGS $UUID_CFLAGS"
#-luuid -lz是根据make报错的情况查询后加上的。
#必须要使用export导出为环境变量,否则configure使用不了。
 
./configure --host=arm-linux CC=arm-linux-gnueabihf-gcc --prefix=$PWD/install_dir
 
make CROSS=arm-linux-gnueabihf- WITHOUT_XATTR=1
make install
 
 
 

免责声明:文章转载自《mtd-utils交叉编译安装》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇js上传文件 java后台接收文件CentOS系统升级OpenSSH版本下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

交叉编译python2.7.7

一、python下载网址: http://www.python.org/ftp/python/ 二、python的交叉编译依赖openssl ,openssl的下载网址: https://www.openssl.org/source/old/ 三、编译:1、交叉编译 openssl-1.0.2g # /home/sw/openssh/openssl-1.0...

前端代码与node代码组合启动 concurrently

vue-demo 中的 package.json 中 scripts "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", "start": "npm run serve"}, node-serve 的 package.jso...

Linux源码编译安装和卸载

Linux下正常的编译安装/卸载 源码的安装一般由3个步骤组成: 配置(configure) 编译(make) 安装(make install)。 configure文件是一个可执行的脚本文件,它有很多选项,在待安装的源码目录下使用命令./configure –help可以输出详细的选项列表。 其中--prefix选项是配置安装目录,如果不配置该选项,...

laravel队列常驻运行问题 queue:

方法:1 根据官方文档使用--daemon可让队列常驻运行。对应命令行执行php artisan queue:work --daemon; 但是当前命令还是会因为使用Ctrl+C。将进程给关闭。如何常驻在后台执行? 官方文档还让你安装 supervisor 你为什么不安装呢? 用 supervisor 可以常驻后台,并且监控 php artisan qu...

ubuntu安装python3.6

ubuntu16.04自带python2.7和python3.5, 若需安装python 3.6: 先是sudo apt-install python3.6,报错:找不到python3.6安装包。 Reading package lists... Done Building dependency tree Reading state info...

docker-存储驱动

Docker 存储驱动 (storage driver) 是 Docker 的核心组件,它是 Docker 实现分成镜像的基础  他可以将多个文件组合在一起,给用户提供最上层,用户在最上层观看时他是一个整个的文件,对于文件系统来说他是多个零散的不同的文件,这就是分层文件系统的特点以及他的工作原理,因为有分层管理系统所以我才可以让镜像进行精简化, 1、de...