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

ltib常见问题

2014年06月09日 ⁄ 综合 ⁄ 共 4227字 ⁄ 字号 评论关闭

Q1: How do I know which packages are available/will be installed?

Before configuring ltib, you can run bin/listpkgs on an ltib config file, for instance, for the mpc8548cds, you could run:
bin/listpkgs config/platform/mpc8548cds/defconfig
This will list all the packages that can be selected. The ones with a 'y' in the 'Enabled' column will be built/installed by default.
If you have configured ltib already, you can get a more accurate (exact) listing by running:
./ltib -m listpkgs
To select only those packages that are enabled, pipe either of the previous commands to grep as follows:
./ltib -m listpkgs | grep ' y '

Q2: How do I know what license a package uses
Use the -m listpkgs option

Q3: How do I change package selection/configuration and immediately build
Use the --configure option

Q4: How do I change package select/configuration without building
Use the -m config option

Q5: How do I build/install just a single package?
./ltib -p <package_name>
Note: When specifying a package -p, the package will be force re-built, even if it is up-to-date.
Note: The build/install will fail if dependent packages are not already installed.

Q6: How can I add a completely new package to the root filesystem
The following work-flow examples show the process of importing new packages to the root filesystem.
I have a directory with some sources unpacked
1. First clean your sources (remove any .o, .a, .so generated files) and then make a 'tarball', for instance:
cd <my_new_package>-x.y
make clean
cd ..
tar zcvf <my_new_package>-x.y.tar.gz <my_new_package>-x.y
2. Move this tarball to the LPP so ltib can find it.
mv <my_new_package>-x.y.tar.gz /opt/freescale/pkgs/
3. Create a specfile using the existing template.
mkdir dist/lfs-5.1/<my_new_package>
cp dist/lfs-5.1/template/template.spec dist/lfs-5.1/<my_new_package>/<my_new_package>.spec
4. Edit and fixup the template to reflect your package. The fields that need changing are:
Field    Description
Summary    put in a summary of what the package is/does
Name    put in the name of the packge (usually from the tarball name)
Version    put in the version (usually from the tarball/directory
Release    start at 1 and rev each time you change the spec file
License    e.g GPL/LGPL/BSD, look this up in the package's files
Group    If this exists on an rpm based machine, copy from rpm -qi
If not, choose something from /usr/share/doc/rpm-/GROUPS
%Build    often you'll need to add --host=$CFGHOST --build=%{_build} to the configure clause
5. Unpack the new package sources:
./ltib -m prep -p <my_new_package>
6. Make any changes you need to the sources to get them to cross compile
7. Build the new package with your changes:
./ltib -m scbuild -p <my_new_package>
8. Once the new package builds okay, check the install phase:
./ltib -m scinstall -p <my_new_package>
9. Install the test package in the NFS root filesystem area (rootfs) and test
./ltib -m scdeploy -p <my_new_package>
10. Once you're happy the package is running correctly, capture your changes.
./ltib -m patchmerge <my_new_package>
Any changes you've made will be put into a patch file and copied to /opt/freescale/pkgs. In addition, the spec file will be updated to reference the new patch. You should check the patch and eliminate any bogus diffs.
11. Upload the sources to the GPP
For external public files, use this link:
http://www.bitshrine.org/cgi-bin/gpp_upload.cgi.
You must have previously been blessed as a developer to do this. For more information, contact the mailing list:

http://lists.nongnu.org/mailman/listinfo/ltib

The files to be uploaded are your original tarball plus the patch generated by ltib. You should take care to fill in the license/distributable/description fields accurately.
If you do not have project membership and upload permissions, please send and email to the mailing list explaining what you want to do.
12. Add your spec file to cvs
cvs add dist/lfs-5.1/<my_new_package>
cvs add dist/lfs-5.1/<my_new_package>/<my_new_package>.spec
cvs commit -m "added new_package" dist/lfs-5.1/<my_new_package>/<my_new_package>.spec
If you do not have CVS write access, please send a patch to the LTIB mailing list.
13. Follow the steps in the next section on "adding to the config system"

Q7: How do I introduce my new package to the config system
Here is an example for package 'strace'
1. . Edit config/userspace/packages.lkc, this is in alphabetic order. Just after the 'PKG_SKELL' entry add:
config PKG_STRACE
bool "strace"
2. . Edit dist/lfs/common/pkg_map. This is in build order. Put your package where it should go in the build order, and add an entry that ties the config key, to the directory containing the spec file for the package. For strace, I put this after gdb as shown:
PKG_GDB         =   gdb
PKG_STRACE       =   strace
3. . Commit your changes
cvs commit -m "added new_package"

Q8: 如何通过LTIB生成源代码,如U-BOOT?
例子:./ltib -m prep -p u-boot
生成的U-BOOT源码在rpm/BUILD/目录下面。
linux源代码在编译LTIB包时候有选项可以选择保留Linux source code,生成的代码也在rpm/BUILD/目录下面。 

抱歉!评论已关闭.