1、Run 'sudo visudo' so you can edit the sudoer's file. Add the following line to the end of the sudoers file. This is needed for people to be able to use LTIB. This assumes that all your developers have administrator priviledges on this host. If that is not the case, a similar line can be added for each user.
%admin ALL = NOPASSWD: /usr/bin/rpm, /opt/freescale/ltib/usr/bin/rpm
2、安装依赖包
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
特别说明:
1、如果出现以下情况:
Package Minimum ver Installed info
------- ----------- ---------------
glibc-devel 0 not installed
zlib 0 not installed
不是因为没有安装,是因为路径错误,解决办法:
Open file ./bin/Ltibutils.pm ,search for glibc-deve zlib
# fix Ltibutils.pm line 563, 583 and 584
# 'glibc-devel' => sub { -f '/usr/lib/libm.so' || -f '/usr/lib64/libz.so' || -f '/usr/lib/i386-linux-gnu/libm.so'},
# zlib => sub { my @f = (glob('/usr/lib/i386-linux-gnu/libz.so*'),
# glob('/lib/i386-linux-gnu/libz.so*'),
3.运行ltib
cd到ltib安装到的目录,这个是在上面install过程中让你选择的。
然后:
./ltib
即可运行,第一次运行,实际上就是启动build image的工作,最后会调用编译器等工具连构建出最终内核image和文件系统image。
这个过程可能出现错误(但我没碰到),网上有文章说了出现的错误情况:
安装的时候 可能会出现如下提示:
I ran the command: sudo -S -l which returned:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
Password:
This means you don't have sudo permission to execute rpm commands as root
without a password. This is needed for this build script to operate correctly.
To configure this, as root using the command "/usr/sbin/visudo",
and add the following line in the User privilege section:
wzg ALL = NOPASSWD: /bin/rpm, /opt/freescale/ltib/usr/bin/rpm
Started: Mon May 24 16:32:21 2010
Ended: Mon May 24 16:32:28 2010
Elapsed: 7 seconds
Build Failed
这是由于安装ltib需要是普通用户身份,但部分命令要超级用户权限才行,所以需要执行visudo增加用户lzp的权限,如下操作
# su
# /usr/sbin/visudo // 此命令相对于vi打开了一个权限设置文件
// 按i进入输入模式,在最后一行添加如下一行内容
kerson ALL = NOPASSWD: /usr/bin/rpm, /opt/freescale/ltib/usr/bin/rpm
2. compr_lzo.c:29:23: error: lzo/lzo1x.h: No such file or directory --> sudo apt-get install liblzo-dev (Maybe use liblzo2-dev replace it)
3. uuid/uuid.h: No such file or directory --> sudo apt-get install uuid-dev
checking for freetype-config... no
configure: error: You must have freetype installed; see http://www.freetype.org/
error: Bad exit status from /home/kerson/ltib/tmp/rpm-tmp.12494 (%build)
RPM build errors:
Bad exit status from /home/kerson/ltib/tmp/rpm-tmp.12494 (%build)
Build time for fontconfig: 10 seconds
sudo apt-get install libfreetype6-dev
显示 fontconfig 包不存在 或者 could not read symbols: File in wrong format
to the ./configure line found in "ltib/dist/lfs-5.1/fontconfig/fontconfig.spec"
./configure --prefix=%{_prefix} --host=$CFGHOST --build=%{_build} \
--with-arch=$GNUTARCH --sysconfdir=%{_sysconfdir} \
--with-freetype-config=$DEV_IMAGE/usr/bin/freetype-config
make
找不到头文件
cd rootfs/usr/include/
ln -s freetype2/freetype/ freetype
gcc -g -O2 -o .libs/fc-cache fc-cache.o -lexpat ../src/.libs/libfontconfig.so -Wl,--rpath -Wl,/home/kerson/ltib/rootfs/usr”/lib
../src/.libs/libfontconfig.so: undefined reference to `FT_Load_Sfnt_Table'
../src/.libs/libfontconfig.so: undefined reference to `FT_Select_Charmap'
../src/.libs/libfontconfig.so: undefined reference to `FT_Load_Glyph'
../src/.libs/libfontconfig.so: undefined reference to `FT_Get_Sfnt_Table'
../src/.libs/libfontconfig.so: undefined reference to `FT_Done_FreeType'
../src/.libs/libfontconfig.so: undefined reference to `FT_Get_First_Char'
../src/.libs/libfontconfig.so: undefined reference to `FT_Init_FreeType'
../src/.libs/libfontconfig.so: undefined reference to `FT_Get_Sfnt_Name'
../src/.libs/libfontconfig.so: undefined reference to `FT_New_Face'
../src/.libs/libfontconfig.so: undefined reference to `FT_Get_Char_Index'
../src/.libs/libfontconfig.so: undefined reference to `FT_Done_Face'
../src/.libs/libfontconfig.so: undefined reference to `FT_Get_Sfnt_Name_Count'
sudo apt-get install libglib2.0-dev
sudo apt-get install libfontconfig1-dev
缺少 dbus-binding-tool 时安装 libdbus-glib-1-dev
缺少 glib-genmarshal 时安装 libglib2.0-dev
缺少 dbus-binding-tool 时安装 libdbus-glib-1-dev
缺少命令 /bin/bash: no: command not found 时安装 libgtk2.0-dev
o rule to make target `/usr/bin/orbit-idl-2', needed by `orbit-interface.h'. 安装liborbit2-dev
/usr/bin/ld: cannot find -lXtst 安装libxtst-dev
sudo apt-get install libghc6-gtk-dev
/ltib/rpm/BUILD/gtk+-2.14.3/demos$ gedit Makefile
GDK_PIXBUF_CSOURCE = gdk-pixbuf-csource
pixbuf_csource = gdk-pixbuf-csource
sudo apt-get install orbit2
o rule to make target `/usr/bin/orbit-idl-2', needed by `orbit-interface.h'. 安装liborbit2-dev
/usr/bin/ld: cannot find -lXtst 安装libxtst-dev
sudo apt-get install intltool