最近调试MPC5125的板子,第一步LTIB都装不过去,挫败感十足。

LTIB的安装镜像来自于freescale的ltib-mpc5121ads-200906,是用于Ubuntu 10版本之前的,现在就算装10.04也无法联网更新了,所以只能把服务器装为Ubuntu 12.04版本的,遂厚脸皮去问freescale的技术人员,得到答复,安装步骤如下:

a) 通过Ubuntu的自我更新进行更新;

b) 安装相关包;

sudo apt-get install patch g++ rpm zlib1g-dev m4 bison libncurses5-dev libglib2.0-dev gettext build-essential tcl intltool libxml2-dev liborbit2-dev libx11-dev ccache flex uuid-dev liblzo2-dev

c) 在Ubuntu中加载LTIB镜像并./install,此步骤仅完成LTIB安装第一步;

d) 修改visudo以增加用户权限,终端下打开/usr/sbin/visudo,增加如下命令:

ALL=NOPASSWD: /usr/bin/rpm, /opt/freescale/ltib/usr/bin/rpm

为Ubuntu所设置的个人用户名,非root

注意事项:如果该步导致sudoers文件出问题,需重启通过recovery mode -> root 进行恢复;

e) 修复Ltibutils.pm的问题。用vi或者gedit打开LTIB目录/bin/Ltibutils.pm,在对应行中插入/i386-linux-gnu。具体为,

563行:'glibc-devel' => sub { -f '/usr/lib/i386-linux-gnu/libm.so' || -f '/usr/lib64/libz.so' },

583行:zlib => sub { my @f = (glob('/usr/lib/i386-linux-gnu/libz.so*'),

584行:glob('/lib/i386-linux-gnu/libz.so*'),

保存退出;

f) 安装LTIB补丁,该补丁主要用于解决LTIB在Ubuntu 12.04下lkc等包的安装问题,下载地址点我。打补丁方法为:终端进入到补丁所在文件夹,输入命令:

sh install-patches.sh

为目标文件夹。完成后会提示DONE,会有一处错误;

g) 进入LTIB目录,终端运行./ltib,成功后会提示Build Succeeded。

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

一、LTIB简介

LTIB(Linux Target Image Builder)工程是一个使用在不同的目标平台下,用于开发和部署BSP(Board Support Packages)的简单工具。使用该工具,用户能够为其目标平台开发符合GNU/Linux标准的映像。

LTIB支持PPC,ARM,Coldfire等多种目标架构。包含超过200个用户使用的工具包以及通用跨平台的根文件系统。LTIB支持bootloader和内核映像的构建。编译时可对交叉编译工具进行选择。支持RAMDISK和JFFS2 Flash映像的创建。

二、安装

2.1、下载安装包与安装环境

从freescale官方网站下载 MPC837XERDB_20091207_ltib.iso。我使用的系统是centos5.5。

2.2、安装过程

1)、挂载iso光盘

进入root用户,使用命令mount挂载。

mount - o loop /yourisodirc/MPC837XERDB_20091207_ltib.iso /mnt/cdrom

这样就将iso镜像挂到了/mnt/cdrom下,要保证mnt下有cdrom目录。

2)、创建安装目录与文件拷贝

在你要安装ltib的路径下创建安装目录,比如ltib。

mkdir /home/yourcount/ltib

复制文件到你的目录。

cp -rf /mnt/cdrom/* /home/yourcount/ltib

3)、安装

进入ltib目录,执行./install,根据提示输入相应的路径。完成后就会在相应的目录下生成如图所示文件:

[benjorsun@localhost ltib-mpc837xerdb-20100107]$ ls

bin     COPYING  doc              ltib    RELEASE_INFO  rootfs          rootfs.ext2.gz.uboot  rpm

config  dist     host_config.log  README  release_logs  rootfs.ext2.gz  rootfs_image          tmp

在该目录下执行

./ltib --preconfig config/platform/mpc837xerdb/defconfig-8377e --batch

等待安装完成

在该目录下执行

./ltib --preconfig config/platform/mpc837xerdb/defconfig-8377e --batch

4)、bug修正

在安装过程中会遇到如下问题:

Processing: sparse
====================
Died at ./ltib line 1380.
traceback:
main::build_host_rpms:1380
main::host_checks:1435
main:542
Started: Mon Oct 29 10:02:03 2012
Ended: Mon Oct 29 10:02:04 2012
Elapsed: 1 seconds
These packages failed to build:
mtd-utils-20060302
Build Failed
我们进入root用户,修改/mtd-utils-20060302-cf-byteswap_h-1.patch,
vi /opt/freescale/pkgs/mtd-utils-20060302-cf-byteswap_h-1.patch

注掉 lines 46, 47 and 48 :

+//#if !defined _BYTESWAP_H && !defined _NETINET_IN_H +//# error "Never use directly; include instead." +//#endif

然后删除“/opt/freescale/ltib/usr/src/rpm/BUILD/mtd”这个目录

再运行./ltib --preconfig config/platform/mpc837xerdb/defconfig-8377e --batch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

mtd-utils编译出错,导致ltib编译不过的解决办法!

LTIB Basics Installing the BSP Please follow the steps below to install LTIB on your host machine.

. As root, mount the ISO image on your machine ------------------------------------ $ mount -o loop <target-bsp.iso> <mount point> ------------------------------------ . As a non-root user, install LTIB ------------------------------------ $ <mount point>/install ------------------------------------

The BSP EULA will be presented for acceptance. To continue installing accept the license. Then, input the desired LTIB install path. Be sure the user has the correct permissions for the install path.

There are no uninstall scripts. To uninstall LTIB yhou need to remove the /opt/freescale/pkgs, /opt/preescale/ltib and <install_path>/ltib directories manually.

Running LTIB ~~~~~~~~~~~~ To run LTIB, change to the directory into which you installed it and run ./ltib.

--------------------------------- $ cd <install_path>/ltib

####ltib完成install之后首次必须执行./ltib

linux@ubuntu:~/ltib-mpc8315erdb-20080630$ ./ltib

Installing host support packages.

This only needs to be done once per host, but may take up to an hour to complete ...

If an error occurs, a log file with the full output may be found in: /home/linux/ltib-mpc8315erdb-20080630/host_config.log

Exiting on error or interrupt Please see >> /home/linux/ltib-mpc8315erdb-20080630/host_config.log for details

####查看出错的打印消息 linux@ubuntu:~/ltib-mpc8315erdb-20080630$ cat host_config.log                  Updating lpp from local packages

Processing platform: Host support packages ============================================ using /home/linux/ltib-mpc8315erdb-20080630/config/platform/host/ltib.preconfig

Processing: fake-provides ===========================

Processing: mkspooflinks ==========================

Processing: bison ===================

Processing: flex ==================

Processing: texinfo =====================

Processing: autoconf ======================

Processing: libtool =====================

Processing: lkc =================

Processing: wget ==================

Processing: uclinux-cksum ===========================

Processing: genext2fs =======================

Processing: genromfs ======================

Processing: gen_init_cpio ===========================

Processing: u-boot-tools ==========================

Processing: mtd-utils ======================= Build path taken because: no prebuilt rpm,

Cowardly refusing to clobber existing directory:  /opt/freescale/ltib/usr/src/rpm/BUILD/mtd      Remove this by hand if you really want to rebuild this package from scratch

scbuild/scdeploy already unpacked package

Processing: mtd-utils ======================= Build path taken because: build key set, no prebuilt rpm,

rpmbuild --dbpath ///opt/freescale/ltib/var/lib/rpm --target i686 --define '_unpackaged_files_terminate_build 0' --define '_target_cpu i686' --define '__strip strip' --define '_topdir /opt/freescale/ltib/usr/src/rpm' --define '_prefix /opt/freescale/ltib/usr' --define '_tmppath /home/linux/ltib-mpc8315erdb-20080630/tmp' --define '_mandir /opt/freescale/ltib/usr/share/man' --define '_sysconfdir /opt/freescale/ltib/etc' --define '_localstatedir /var' -bc --short-circuit  /home/linux/ltib-mpc8315erdb-20080630/dist/lfs-5.1/mtd-utils/mtd-utils.spec      Building target platforms: i686                                                                                Building for target i686                                                                                       Executing(%build): /bin/sh -e /home/linux/ltib-mpc8315erdb-20080630/tmp/rpm-tmp.18676                          + umask 022                                                                                                    + cd /opt/freescale/ltib/usr/src/rpm/BUILD                                                                     + cd mtd                                                                                                       + make -C util                                                                                                 make: Entering directory `/opt/freescale/ltib/usr/src/rpm/BUILD/mtd/util'                                      gcc -I../include -O2 -Wall -g -c -o ftl_format.o ftl_format.c -g -Wp,-MD,.ftl_format.c.dep                     In file included from /usr/include/endian.h:61,                                                                                 from /usr/include/sys/types.h:217,                                                                             from ftl_format.c:38:                                                                         ../include/bits/byteswap.h:21:3: error: #error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."                                                                                                          make: *** [ftl_format.o] Error 1                                                                               make: Leaving directory `/opt/freescale/ltib/usr/src/rpm/BUILD/mtd/util'                                       error: Bad exit status from /home/linux/ltib-mpc8315erdb-20080630/tmp/rpm-tmp.18676 (%build)

RPM build errors:     Bad exit status from /home/linux/ltib-mpc8315erdb-20080630/tmp/rpm-tmp.18676 (%build) Build time for mtd-utils: 0 seconds

Failed building mtd-utils Died at ./ltib line 1225. traceback:                main::build_host_rpms:1225   main::host_checks:1279      main:489

Started: Mon Feb 14 16:59:43 2011 Ended:   Mon Feb 14 16:59:50 2011 Elapsed: 7 seconds

These packages failed to build: mtd-utils

Build Failed

解决办法

参考链接:

http://forums.freescale.com/t5/CodeWarrior-for-ColdFire-and/Tlib-build-for-8349-MDS/m-p/32167?view=by_date_ascending

直接修改源码:sudo vi /opt/freescale/ltib/usr/src/rpm/BUILD/mtd/include/bits/byteswap.h

注释一下三行(20-22):

//#if !defined _BYTESWAP_H && !defined _NETINET_IN_H

//# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."

//#endif

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

第一个问题:关于安装过程中需要超级权限,而ltib安装又不让用root用户安装,所以只有修改/etc/sudoers文件,

sudo visudo

在最后一行添加 username ALL=NOPASSWD: /usr/bin/rpm, /opt/freescale/ltib/usr/bin/rpm

需要添加的内容我是得到的过程是:

开始我在最后一行添加 username ALL=(ALL) ALL

执行./ltib

自动提示出来你需要添加的内容 我的当然就是username ALL=NOPASSWD: /usr/bin/rpm, /opt/freescale/ltib/usr/bin/rpm

再次执行 sudo visudo 修改最后一行的内容。

第二个rpm-build的问题:我的解决办法跟下面描述的不一样,rpmbuild是安装上了,但是我的原因是因为我使用sudo  apt-get install rpm  默认安装的rpm版本太高是rpm4.7。最后我重新下载了rpm_4.4.2.3-1_i386.deb,由于安装包有相当多的依赖关系我总共下载了

librpm4.4_4.4.2.3-1_i386.deb

libbeecrypt6_4.1.2-7_i386.deb

libneon27_0.28.2-6.1_i386.deb

libcomerr2_1.41.3-1_i386.deb

相关下载deb包的地址:http://www.debian.org/distrib/packages

以后遇到的问题安装下面文章解决方法均的到解决。

以下转自:http://blog.chinaunix.net/u2/70351/showart_2005242.html

Howto Install Ltib in Fedora 10

Author: misty (qibing(a)yahoo.com.cn)

本文档是说明如何在Fedora 10系统上安装Freescale 提供的Ltib安装包。Ltib(Linux Target Imagine Build)是可以为不同平台开发和配置BSP的工具。Freescale为不同的平台(包括PowerPC,ColdFire,ARM等)提供来不同的Ltib,可以使用户很方便地移植Uboot,移植Linux内核,以及制作文件系统,使用Ltib只需要进行简单的配置,就可以帮我们完成其余的工作。

准备工作

首先到Freescale的网站上下载自己平台的BSP包,下载地址为:
http://www.freescale.com/webapp/sps/site/overview.jsp?code=CW_BSP
我下载的是MPC8349EA_MDS_K26_20061221-LTIB.iso,这是为MPC8349EA开发板提供的BSP。

安装Ltib

下载了BSP的ISO文件后,挂载这个iso文件,
下面操作的假设条件:
MPC8349EA_MDS_K26_20061221-LTIB.iso在/home/qibing/目录下;
安装ltib到/home/qibing/ppc/目录下;
“#”表示当前是以root权限操作;
“$”表示当前是以普通用户权限操作;

#cd /home/qibing

#mount -o loop MPC8349EA_MDS_K26_20061221-LTIB.iso /mnt

$cd /mnt

$./intall
注:当提示输入ltib的安装路径时,输入/home/qibing/ppc

$cd /home/qibing/ppc

$cd ltib

下面就要安装ltib了,但是在Fedora 10上按照的时候会有很多问题,我以走过这个流程的身份先把将要遇到的问题提出来,并解决这些问题,这样下面的安装过程才顺利。

如果这时运行./ltib则会遇到两个问题:

1. ltib安装是普通用户权限,但是部分操作需要root用户权限。按照提示进行如下操作,

#/usr/sbin/visudo
然后在文件最后添加如下内容:

qibing ALL = NOPASSWD:/bin/rpm, /opt/freescale/ltib/usr/bin/rpm

注:visudo实际就是编辑文件/etc/sudoers文件

2. 提示缺少rpm-build包。

通过$rpm -qrpm-build命令查看rpm-build包已经安装了,这可能是ltib的问题或者其他函数的问题,解决方法是(从论坛上摘录的):

From the  directory where you type "./ltib" type "gedit ltib" if you have a Gnome  install. I'm not sure what the KDE editor is, or use VI if you want edit  in the console text mode. Search for "pre_install_deps". This is the  table that "check_basic_deps" refers to. Look for a line that contains "  rpm-buld 0". Comment out the line by adding "#" to the left of the  line. Save and you should be good to go.

如果这时继续运行./ltib安装,则还会有问题,我自己的error log文件弄丢了,这是网上摘录的:

cp ./initscan.c scan.c             touch .bootstrap             gcc -c -I. -I. -g -O ccl.c             gcc -c -I. -I. -g -O dfa.c             gcc -c -I. -I. -g -O ecs.c             gcc -c -I. -I. -g -O gen.c             gcc -c -I. -I. -g -O main.c             gcc -c -I. -I. -g -O misc.c             gcc -c -I. -I. -g -O nfa.c             bison -y -d ./parse.y             make: *** [parse.c] Segmentation fault             error: Bad exit status from /home/nabendu/ltib-mpc8349emds-20061221/tmp/rpm-tmp.81449 (%build)

RPM build errors:             Bad exit status from /home/nabendu/ltib-mpc8349emds-20061221/tmp/rpm-tmp.81449 (%build)             Build time for flex: 13 seconds

Failed building flex             Died at ./ltib line 1395.

Started: Fri May 16 00:56:58 2008             Ended: Fri May 16 01:29:53 2008             Elapsed: 1975 seconds

These packages failed to build:             flex             Build Failed

解决的方法是:在运行./ltib之前,修改”dist/lfs-5.1/bison/bison.spec”文件,在%Build段修改make为make CFLAGS=-O0。然后再运行./ltib。

接着会遇到下面的问题,
+ umask 022

+ cd /opt/freescale/ltib/usr/src/rpm/BUILD

+ cd mtd
+ make -C util

make: Entering directory `/opt/freescale/ltib/usr/src/rpm/BUILD/mtd/util'

gcc -I../include -O2 -Wall -g -c -o ftl_format.o ftl_format.c -g -Wp,-MD,.ftl_format.c.dep

In file included from /usr/include/endian.h:61,

from /usr/include/sys/types.h:217,

from ftl_format.c:38:

../include/bits/byteswap.h:21:3: error: #error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."

make: *** [ftl_format.o] Error 1

make: Leaving directory `/opt/freescale/ltib/usr/src/rpm/BUILD/mtd/util'

error: Bad exit status from /home/qibing/ppc/ltib-mpc8349emds-20061221/tmp/rpm-tmp.88474 (%build)

RPM build errors:

Bad exit status from /home/qibing/ppc/ltib-mpc8349emds-20061221/tmp/rpm-tmp.88474 (%build)

Build time for mtd-utils: 0 seconds

Failed building mtd-utils
Died at ./ltib line 1395.

Started: Thu Jul 23 22:06:36 2009

Ended: Thu Jul 23 22:06:37 2009

Elapsed: 1 seconds

These packages failed to build:

mtd-utils

Build Failed
解决方法是:修改“/opt/freescale/pkgs/mtd-utils-20060302-cf-byteswap_h-1.patch”文件,下面是网上论坛中摘录的解决方法:
Hi,

I had the same problem under Ubuntu 9.04. I solved it by modifying the lines 46, 47 and 48 of the "/opt/freescale/pkgs/mtd-utils-20060302-cf-byteswap_h-1.patch" file.

+#if !defined _BYTESWAP_H && !defined _NETINET_IN_H

+# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."

+#endif
by

+//#if !defined _BYTESWAP_H && !defined _NETINET_IN_H

+//# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."

+//#endif

(very cheap solution, but ... it works :-) )

然后删除掉“/opt/freescale/ltib/usr/src/rpm/BUILD/mtd”这个目录,最后再运行./ltib,最后安装成功^_^。

使用Ltib

附录

1. 安装时出现错误的解决方法参看下面链接

2.

ltib安装过程中遇到好多问题,从网上转来的好多份总结的更多相关文章

  1. mysql安装过程中出现的错误问题解决方案

    最近在学Django,因为与数据库相关,所以我下载并安装了MySQL,安装的过程真的是一把辛酸泪啊.安装过后,查看是否可以使用,出现了cann't connect to mysql server这个错 ...

  2. hadoop安装过程中出现的错误

    此次来记录一下我在安装Hadoop安装过程中出现的错误,安装过程参照慕课网林子雨教程进行安装,在尝试过程中出现的错误如下: 1.在安装Ubuntu时,新建虚拟电脑时,并没有在版本的输入框中有Ubunt ...

  3. JAVA安装过程中出现的“javac不是内部或外部指令”的解决方法

    近来重新安装了JAVA,安装过程中出现问题,网上找到解决办法,汇总发布. 解决流程: 1.确定自己的环境变量设置没问题,没有出现遗漏 : . 等情况 (具体环境变量设置百度) 2.环境变量设置后 ,d ...

  4. SQL Server 2008 安装过程中遇到“性能计数器注册表配置单元一致性”检查失败 问题的解决方法

    操作步骤: 1. 在 Microsoft Windows 2003 或 Windows XP 桌面上,依次单击"开始"."运行",然后在"打开&quo ...

  5. 用友ERP-U8最新破解(再次更新版本,附安装过程中的解决办法)

    新版用友u8.70下载地址:http://ftp.shangyuchem.com/应用软件/用友ERP-U8管理软件(8.70版).rar 准备好安装环境,因为需要SQLSERVER和IIS支持,而个 ...

  6. cocoapods安装以及使用,安装过程中ruby版本过低

    cocoapods安装以及使用,安装过程中ruby版本过低 字数473 阅读103 评论1 喜欢2 1.打开终端 2.移除现有 Ruby 默认源 $ gem sources --remove http ...

  7. iOS 学习笔记二【cocopods安装使用和安装过程中遇到的问题及解决办法】【20160725更新】

    在osx 10.11之前cocopods问题不多,但是升级到11之后的版本,之前的cocopods大多用不了,需要重新安装,对于我这种使用测试版系统的技术狂来说,每次都需要重新安装很多东西, 当然,c ...

  8. rpm包安装过程中依赖问题“libc.so.6 is needed by XXX”解决方法

    rpm包安装过程中依赖问题"libc.so.6 is needed by XXX"解决方法 折腾了几天,终于搞定了CentOS上的Canon LBP2900打印机驱动.中间遇到了一 ...

  9. Linux学习笔记(1)Linux虚拟机安装过程中的知识点及常用管理工具

    1. VMware的相关知识 (1)建议的VMware的配置: CPU 主频1GHz以上 内存 1GB以上 硬盘 分区空闲空间8GB以上 (2)VMware创建快照 快照的作用是保存虚拟机的现有状态, ...

随机推荐

  1. Javascript中判断变量是数组还是对象(array还是object)

    怎样判断一个JavaScript变量是array还是obiect? 答案: 1.如果你只是用typeof来检查该变量,不论是array还是object,都将返回‘objec'. 此问题的一个可行的答案 ...

  2. UVA11734_Big Number of Teams will Solve This

    题意很简单,本身也是个水题. 给你两个字符串,如果两个串完全相同,那么输出yes:如果两串只是空格的不同,出去空格后完全相同,那么输出Output Format Error,否则输出Wrong Ans ...

  3. CPP 替代 PIL 图片处理(缩略图生成)

    python中使用PIL(Pyhton Image Library)进行图片处理,好处就是编写简单方便,但是不能很好利用机器多核的特点,于是在项目中决定使用cpp来实现图片处理. 项目中的图片处理主要 ...

  4. C++解析(18):C++标准库与字符串类

    0.目录 1.C++标准库 2.字符串类 3.数组操作符的重载 4.小结 1.C++标准库 有趣的重载--操作符 << 的原生意义是按位左移,例:1 << 2;,其意义是将整数 ...

  5. C++解析(15):二阶构造模式

    0.目录 1.构造函数与半成品对象 2.二阶构造 3.小结 1.构造函数与半成品对象 关于构造函数: 类的构造函数用于对象的初始化 构造函数与类同名并且没有返回值 构造函数在对象定义时自动被调用 问题 ...

  6. 51nod1238 最小公倍数之和 V3 莫比乌斯函数 杜教筛

    题意:求\(\sum_{i = 1}^{n}\sum_{j = 1}^{n}lcm(i, j)\). 题解:虽然网上很多题解说用mu卡不过去,,,不过试了一下貌似时间还挺充足的,..也许有时间用phi ...

  7. 表格隔行变色_jQuery控制实现鼠标悬停高亮

    <!doctype html> <html> <head> <meta http-equiv="content-type" content ...

  8. Hbase(六) hbase Java API

    一. 几个主要 Hbase API 类和数据模型之间的对应关系: 1. HBaseAdmin关系: org.apache.hadoop.hbase.client.HBaseAdmin作用:提供了一个接 ...

  9. 硬盘杀手!Windows版Redis疯狂占用C盘空间【转】

    [问题的原因] Windows版Redis启动后,会在C盘自动创建一个很大的文件,C:\Users\{你的用户名}\AppData\Local\Redis\RedisQFolk_****.dat 我们 ...

  10. [POJ3613] Cow Relays

    link 题目大意 给你一个含有边权的无向图,问从$S$到$T$经过$N$条边的最小花费. 试题分析 我们可以很容易推导$dp$方程,$dp(k,i,j)$表示经过$k$条边从$i$到$j$的最小花费 ...