现在的位置: 首页 > 综合 > 正文

LTIB入门介绍,安装使用方法(一)

2013年07月29日 ⁄ 综合 ⁄ 共 5739字 ⁄ 字号 评论关闭

        很久没有写博客了,关键是最近比较烦。在做博创杯的比赛,由于参考资料不多,而且全是英文的(万恶的英文啊),整的一开始方向错了。

浪费了很多时间,所以很长时间没有成果。不过现在还好,原来我们是只无头的苍蝇,现在总算有头了,嘿嘿。

        说说最近的收获吧。不得不提,收获很多。

         初做嵌入式,我们总会遇到第一步,搭建交叉编译环境。无非就是现在一个交叉编译器,arm-linux-gcc-。。。。。等等之类的,然后在主机

上添加环境变量,之后测试一下编译一下测试程序,好使了,便一切OK。

         可是在一个较大的工程中呢,我们总会想到很多的问题。比如第一个兼容性,第二个软件的升级。

        由于linux开源世界太多软件版本不断升级,相互兼容极差,不同的软件由不同的志愿者维护,互相根本没有考虑到兼容性,这导致在嵌入式

linux上开发的工程师的噩梦。在这种情况下,少数高人干起整合这些乱七八糟开源软件的事情,目标当然是尽量提供一个方便使用的软件包,避

免那些琐碎繁杂的配置安装工作。这样便产生了两个比较突出的开发包。LTIB(Linux Target Image Builder)和ELDK(Embedded Linux Development Kit)

我们先来说一下关于LTIB

1、LTIB的介绍

2、LTIB的安装方法

3、LTIB的使用方法

一、LTIB的介绍

      关于LTIB的介绍我想还是大家查看官网上的介绍比较好,首先感谢飞斯尔卡公司

http://savannah.nongnu.org/projects/ltib/

his project is not part of the GNU Project.

The LTIB (Linux Target Image Builder) project is a simple tool that can be used to develop and deploy BSPs (Board Support Packages) for various target platforms. Using this tool a user will be able to develop a GNU/Linux image for their target platform. The
following features are supported: 

Main features 

  • Open source (GPL)
  • Runs on most popular Linux host distributions (x86 and some PPC)
  • Command line interface, with curses configuration screens (using LKC)
  • Support for multiple target architectures (PPC, ARM, Coldfire)
  • Target platforms selectable from a menu (CVS version)
  • More than 200 userspace packages selectable
  • Common root filesystem package set across architectures
  • Supports building of bootloaders and kernel images
  • All package building is done as non-root user
  • Configuration/selection of individual packages from a menu
  • Auto package dependency resolution
  • Auto file conflict resolution by package order build scaling
  • Auto re-install/de-install of packages by changes in dependency tree
  • Toolchain selectable at configuration time
  • Configuration of the Linux kernel using it's native config language
  • Kernel selection can easilty be changed from choicelist during configuration
  • Configuration of target system from host (IP address, services etc)
  • Supports preconfigs which allow developers to store different system configurations (e.g. toolchain selection, kernel selection, package selection etc).
  • Supports profiles this allows just the userspace package set to be re-configured. This is excellent for autobuilding or exchanging the non platform specific configuration between targets.
  • All packages are built as rpms and managed using rpm
  • Target image files managed using a private rpm database per LTIB instance on the host
  • Supports single package developer mode using prep/scbuild/scdeploy analogs
  • Provides a means of source capture (patches) and auto update of spec files
  • Shell mode available to run all commands in ltib's spec environment
  • Incremental deployment (over NFS) supported
  • RAMDISK and JFFS2 Flash image creation supported
  • Read-only root filesystem supported.
  • LTIB is meta-data only, all sources are pulled using http and locally cached in a common area per-host.
  • Remote source pulls support proxys
  • Support for glibc and uclibc
  • All meta-data formats are open source (rpm, Linux Kernel Config)
  • Modular BSP architecture (easy to add new BSPs)
  • Support batch mode and --continue for auto-builders
  • Support --dry to preview ltib's actions
  • Provides --dltest to check for availability of sources/patches
  • Provides listpkgs mode to show all available packages, whether selected and their individual licenses.
  • Provides a release mode, this encapsulates an LTIB project into an iso images that will not require network access.

Registration Date: Fri Aug 12 11:21:10 2005 
License: GNU General Public License v2 or later
Development Status: 4 - Beta

这段话大家翻译一下,就一切了然了。正如我所说LTIB(Linux的目标图像生成器)是一个简单的开发工具包,可用于各种目标平台的开发和
部署的BSP(板级支持包)。使用这个工具的用户将能够开发出了他们的目标平台的GNU / Linux的镜像。支持以下功能:。。。。。。。。

2.ltib工具的安装

ltib工具的安装方法有两种

引用**************************************************************************************

1  FREESCALELTIB包的安装

约定.0    当前用户为paul

约定.1    下载MCFV4M_20090710_ltib.iso文件到/home/paul

约定.2    当前工作目录为/home/paul

约定.3    安装目的目录为/home/paul/tools

约定.4    挂载目的目录为/home/paul/ltib

 

1.1     首先将ISO文件挂载到一个临时目录

#cd /home/paul

#mkdir temp

#mount –o loop ltib.iso /home/paul/temp

1.2     然后将ltib目录下的所有文件复制到ltib目录下,然后卸载ISO文件。

#cd /home/paul

#cp -rf /home/paul/temp /home/paul/ltib

              #umount /home/paul/temp

              #rm –dr temp

1.3     修改paul权限,进入tools目录下执行install,完成后执行./ltib

#su – root

#vim /usr/sbin/visudo

在最后一行添加下面一行内容:

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

保存,并返回paul用户

#su paul

#cd /home/paul/ltib

#./ltib

输入安装的目的路径:/home/paul/tools

如果出现error,请按照提示进行操作。

          Install成功后,进入/home/paul/tools/下进行build.

              #cd /home/paul/tools

              #./ltib

              安装过程中如果出现缺少文件,请上网络下载并放到SOURCE目录即可。

***********************************************************************************************************

这种方法我没有试过,不过写的挺详细应该没有问题。

 我用的是另外一种方法

1.进入找个网站http://www.bitshrine.org/ltib/resources-download

接着你就可以按照网站上的说明一步步执行ltib的安装了。

在linux终端执行以下命令

 cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/ltib co -P ltib
$ cd ltib
$ ./ltib

这样在你终端的当前目录下(这个我没有太注意,我的是在根目录下边)生成了一个ltib,然后cd   ltib进入,执行

./ltib

接下来时间就很漫长了。因为需要在网上下载很多东西,我从开始执行这步,到最后编译完成,大概是7个小时吧。

还让我逃了两节课,有时间再不吧,嘻嘻。

problem

你在执行过程中遇到的第一个问题便是权限问题

根据ltib的提示:你需要用到  /usr/sbin/visudo

这是一个精确调整用户权限的工具,你每次执行sudo都是调用的这个工具。

执行

/usr/sbin/visudo

在最后一行添加下面一行内容:
root ALL = NOPASSWD: /bin/rpm, /opt/freescale/ltib/usr/bin/rpm

最前面的内容,跟你用哪个用户执行的有关,你用的root用户那么就写root你用的普通用户,

就写普通用户的名字。

problem2

你遇到的第二个问题就是某某包没有,或者是下载不成功之类的。

这个不用着急,在超级用户权限下安装即可。

我用的是fedora9.0那么就执行yum install *********就可以了。

接着就没有什么问题了。安装时间主要是取决与你的网速,

这中间会有三个图像界面出现(就是我们makemenuconfig后出现的界面)

分别是第一个选择架构,我用的是lpc3152(NXP公司的)所以便选择这个,当然也有别的选项。

根据你的选项做决定。还有就是选择内核版本,诸如此类的

第二个界面是就是你之前选择的内核版本的配置单

第三个界面就是你的busybox的配置单。

选择完了之后其他的时间就是编译了。编译完成之后会生成一个rootfs目录在ltib目录下

在rootfs目录中有一个boot目录,里面存放的就是你编译出来的镜像文件。

编译完成之后的目录结构图就是这样。当然你在这里面是找不到你所下载的内核版本,uboot压缩文件的。

因为在/opt目录下也生成了两个文件夹。

下面是从ltib的技术手册中摘出来的,这里就不做翻译了。google一下吧

./rpmdb
• RPM database for this LTIB instance
► ./rpm
• Where sources, source RPMs and binary RPMs live
• Packages are built in ./BUILD/<pkg>
• Binary RPMs will be created in ./RPMS/<arch> for all
up-to-date packages
► ./rootfs
• root file system tree for the target, created by installation
of binary RPMs
► ./dist/lfs-5.1
• package spec files

► ./config/platform/<platform_name>
•• main.lkc defines the BSP top level
menu
• default configuration files :

抱歉!评论已关闭.