分类: LINUX
2010-07-15 11:23:31
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 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: 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 make clean cd .. tar zcvf 2. Move this tarball to the LPP so ltib can find it. mv 3. Create a specfile using the existing template. mkdir dist/lfs-5.1/ cp dist/lfs-5.1/template/template.spec dist/lfs-5.1/ 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 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 8. Once the new package builds okay, check the install phase: ./ltib -m scinstall -p 9. Install the test package in the NFS root filesystem area (rootfs) and test ./ltib -m scdeploy -p 10. Once you're happy the package is running correctly, capture your changes. ./ltib -m patchmerge 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: You must have previously been blessed as a developer to do this. For more information, contact the mailing list: 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/ cvs add dist/lfs-5.1/ cvs commit -m "added new_package" dist/lfs-5.1/ 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/目录下面。 |