Ubuntu12.04安装Freescale LTIB环境

Ubuntu12.04安装Freescale LTIB环境

    最近手上拿到一块imx6s的板子,打算先看看linux下相关的开发调试方法。初步了解了下,linux下开发freescale采用的LTIB这个东西,所以不得不先看看这个。以下是搭建ltib的基本步骤,在此做一个记录。

1 配置Ubuntu源
#sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak (backup original file)
#sudo gedit /etc/apt/sources.list
添加如下:
//Delete all item in this file, then copy the following server addresses to it :
deb http://mirrors.163.com/ubuntu/ precise main restricted
deb-src http://mirrors.163.com/ubuntu/ precise main restricted
deb http://mirrors.163.com/ubuntu/ precise-updates main restricted
deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted
deb http://mirrors.163.com/ubuntu/ precise universe
deb-src http://mirrors.163.com/ubuntu/ precise universe
deb http://mirrors.163.com/ubuntu/ precise-updates universe
deb-src http://mirrors.163.com/ubuntu/ precise-updates universe
deb http://mirrors.163.com/ubuntu/ precise multiverse
deb-src http://mirrors.163.com/ubuntu/ precise multiverse
deb http://mirrors.163.com/ubuntu/ precise-updates multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-updates multiverse
deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-security main restricted
deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted
deb http://mirrors.163.com/ubuntu/ precise-security universe
deb-src http://mirrors.163.com/ubuntu/ precise-security universe
deb http://mirrors.163.com/ubuntu/ precise-security multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-security multiverse
deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main

保存退出,更新源:
#sudo apt-get update

2 修改 Sudoers
执行如下命令:
sudo /usr/sbin/visudo

User privilege specification, root ALL=(ALL) ALL  后面加入(强调一下 ubuntu usrname ):
ubuntu ALL = NOPASSWD: /usr/bin/rpm, /opt/freescale/ltib/usr/bin/rpm

3:安装必要的pakages:
sudo apt-get install aptitude

可以使用以下脚本执行pakage的安装:
#!/bin/bash  
# Install packages needed by LTIB  
sudo aptitude -y install gettext libgtk2.0-dev rpm bison m4 libfreetype6-dev  
sudo aptitude -y install libdbus-glib-1-dev liborbit2-dev intltool  
sudo aptitude -y install ccache ncurses-dev zlib1g zlib1g-dev gcc g++ libtool  
sudo aptitude -y install uuid-dev liblzo2-dev  
sudo aptitude -y install tcl dpkg  
sudo aptitude -y install asciidoc texlive-latex-base dblatex xutils-dev  
# Packages required for 64-bit Ubuntu  
# Do "uname -a" and see if the word "x86_64" shows up.  
if uname -a|grep -sq 'x86_64'; then  
sudo aptitude -y install ia32-libs libc6-dev-i386 lib32z1  
fi  
# The following recommended for Linux development.  
# They are not required by LTIB.  
sudo aptitude -y install gparted emacs22-nox openssh-server  
sudo aptitude -y install nfs-common nfs-kernel-server lintian  
sudo aptitude -y install git-core git-doc git-email git-gui gitk  
sudo aptitude -y install diffstat indent tofrodos fakeroot doxygen uboot-mkimage  
sudo aptitude -y install sendmail mailutils meld atftpd sharutils  
sudo aptitude -y install manpages-dev manpages-posix manpages-posix-dev linux-doc  
sudo aptitude -y install vnc4server xvnc4viewer  
sudo aptitude -y install texinfo  

保存执行此脚本即可。

4:安装编译
  (1)移走之前所有安装在/opt/freescale/pkgs下的包
  (2)安装LTIB package
              解压源码包带有ltib环境的源码包 (可以从freescale官网下载)
            在源码包下执行: ./install 命令 (期间需要输入两次“yes”确认)
             选安装的路径
 
 ps:对于Ubuntu12.04.在编译之前需做如下设置(在安装的LTIB目录下运行如下脚本):
#!/usr/bin/env bash 
   
# get the patch tarball and untar it  
wget -O ubuntu-ltib-patch.tgz https://community.freescale.com/servlet/JiveServlet/downloadBody/93454-102-3-2834/ubuntu-ltib-patch.tgz  
tar -xzvf ubuntu-ltib-patch.tgz  
      
# execute the script which do the patching  
ltibDir=`pwd`  
cd ubuntu-ltib-patch  
./install-patches.sh $ltibDir  

5 编译
 在编译之前,可以运行如下命令进行配置:
./ltib -m config
主要配置你所使用的板卡,u-boot,kernel版本等,同也可以通过图形界面的方式在编译过程中配置。
编译采用如下命令:
./ltib

6 编译过程中可能出现的问题:
 出现failed buding busybox,这时候要执行如下操作:

1)在 /usr/include下创建一个软链接:
sudo ln -s i386-linux-gun/sys sys
2)修改 ltib/dist/lfs-5.1/base_libs/base_libs.spec(注释#部分)
...
perl -w -e '
# @ARGV = grep { `file $_` =~ m,ASCII C program text, } @ARGV;
# exit (0) unless @ARGV;









你可能感兴趣的:(Linux/android驱动)