logo资料库

buildroot使用手册.pdf

第1页 / 共56页
第2页 / 共56页
第3页 / 共56页
第4页 / 共56页
第5页 / 共56页
第6页 / 共56页
第7页 / 共56页
第8页 / 共56页
资料共56页,剩余部分请下载后查看
About Buildroot
Starting up
System requirements
Mandatory packages
Optional packages
Getting Buildroot
Using Buildroot
Working with Buildroot
Details on Buildroot configuration
Cross-compilation toolchain
Internal toolchain backend
External toolchain backend
Crosstool-NG toolchain backend
/dev management
init system
make tips
Customization
Customizing the generated target filesystem
Customizing the Busybox configuration
Customizing the uClibc configuration
Customizing the Linux kernel configuration
Customizing the toolchain
Using the external toolchain backend
Using the internal Buildroot toolchain backend
Using the Crosstool-NG backend
Storing the configuration
Basics for storing the configuration
Buildroot configuration
Other package configuration
Creating your own board support
Step-by-step instructions for storing configuration
Customizing packages
Daily use
Understanding when a full rebuild is necessary
Understanding how to rebuild packages
Offline builds
Building out-of-tree
Environment variables
Integration with Eclipse
Hacking Buildroot
Frequently Asked Questions & Troubleshooting
The boot hangs after Starting network…
module-init-tools fails to build with cannot find -lc
Why is there no compiler on the target?
Why are there no development files on the target?
Why is there no documentation on the target?
Why are some packages not visible in the Buildroot config menu?
Why not use the target directory as a chroot directory?
Going further in Buildroot's innards
How Buildroot works
Advanced usage
Using the generated toolchain outside Buildroot
Using ccache in Buildroot
Location of downloaded packages
Package-specific make targets
Developer Guidelines
Coding style
Config.in file
The .mk file
The documentation
Adding new packages to Buildroot
Package directory
Config.in file
Choosing depends on or select
The .mk file
Infrastructure for packages with specific build systems
generic-package Tutorial
generic-package Reference
Infrastructure for autotools-based packages
autotools-package tutorial
autotools-package reference
Infrastructure for CMake-based packages
cmake-package tutorial
cmake-package reference
Gettext integration and interaction with packages
Tips and tricks
Package name, config entry name and makefile variable relationship
How to add a package from github
Conclusion
Patching a package
Providing patches
Downloaded
Within Buildroot
Global patch directory
How patches are applied
Format and licensing of the package patches
Integrating patches found on the Web
Download infrastructure
Legal notice and licensing
Complying with open source licenses
License abbreviations
Complying with the Buildroot license
Beyond Buildroot
Boot the generated images
NFS boot
Chroot
Getting involved
Mailing List
Subscribing to the mailing list
Searching the List Archives
IRC
Patchwork
Bugtracker
Buildroot wikipage
Events
Buildroot Developer Days aside ELC-E 2012 (November 3-4, 2012 - Barcelona)
Buildroot presentation at LSM 2012 (July 12-14, 2012 - Geneva)
Buildroot Developer Days aside FOSDEM 2012 (February 3, 2012 - Brussels)
Contributing to Buildroot
Submitting patches
Reviewing/Testing patches
Autobuild
Reporting issues/bugs, get help
Appendix
Makedev syntax documentation
Makeuser syntax documentation
Package Selection for the target
Host utilities
Deprecated features
The Buildroot user manual i The Buildroot user manual
The Buildroot user manual Contents 1 About Buildroot 2 Starting up . . . . 2.1 System requirements . 2.1.1 Mandatory packages . 2.1.2 Optional packages . . . . . 2.2 Getting Buildroot 2.3 Using Buildroot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Working with Buildroot 3.1 Details on Buildroot configuration . . 3.1.1 Cross-compilation toolchain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.2 3.1.3 3.1.1.1 3.1.1.2 3.1.1.3 /dev management . . init system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Internal toolchain backend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . External toolchain backend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Crosstool-NG toolchain backend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.1 Customizing the generated target filesystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.2 Customizing the Busybox configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.3 Customizing the uClibc configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.4 Customizing the Linux kernel configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.5 Customizing the toolchain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.5.1 Using the external toolchain backend . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.5.2 Using the internal Buildroot toolchain backend . . . . . . . . . . . . . . . . . . . . . . 3.3.5.3 Using the Crosstool-NG backend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Buildroot configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.1.1 3.4.1.2 Other package configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.1 Basics for storing the configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 make tips . 3.3 Customization . . . 3.4 Storing the configuration . . . . . ii 1 2 2 2 3 3 3 . . . . . 6 6 . 6 . 7 . 7 . 9 . . 9 . 10 . 11 . 11 . 11 . 12 . 13 . 13 . 13 . 13 . 13 . 14 . 14 . 14 . 14 . 14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Buildroot user manual 3.5 Daily use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.2 Creating your own board support 3.4.3 3.4.4 Customizing packages . . . Step-by-step instructions for storing configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.1 Understanding when a full rebuild is necessary . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.2 Understanding how to rebuild packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.3 Offline builds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.4 Building out-of-tree . 3.5.5 Environment variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Integration with Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6 3.7 Hacking Buildroot 4 Frequently Asked Questions & Troubleshooting . . . . . . . . . . . . . 4.1 The boot hangs after Starting network. . . . . . . . . . . . . . . . . . . . . . . . . 4.2 module-init-tools fails to build with cannot find -lc . . . . . . . . . . . 4.3 Why is there no compiler on the target? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4 Why are there no development files on the target? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5 Why is there no documentation on the target? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.6 Why are some packages not visible in the Buildroot config menu? . . . . . . . . . . . . . . . . . . . . . 4.7 Why not use the target directory as a chroot directory? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Going further in Buildroot’s innards . . 5.1 How Buildroot works . 5.2 Advanced usage . . . . . . . . . . . . . . . . . . 5.2.1 Using the generated toolchain outside Buildroot . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.2 Using ccache in Buildroot 5.2.3 Location of downloaded packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Package-specific make targets . . . . . . . . . . . . . . . . 6 Developer Guidelines . 6.1 Coding style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1.1 Config.in file . . 6.1.2 The .mk file . . . 6.1.3 The documentation . . . . . 6.2 Adding new packages to Buildroot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Infrastructure for packages with specific build systems . . . . . . . . . . . . . . . . . . . . . . . 6.2.1 Package directory . 6.2.2 Config.in file . 6.2.3 The .mk file . 6.2.4 Choosing depends on or select . . . . . . . . . . . . . . . 6.2.2.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii . 15 . 15 . 16 . 16 . 16 . 17 . 17 . 17 . 18 . 18 . 18 19 . 19 . 19 . 19 . 20 . 20 . 20 . 20 21 . 21 . 22 . 22 . 22 . 22 . 22 24 . 24 . 24 . 24 . 25 . 26 . 26 . 26 . 26 . 28 . 28 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Buildroot user manual . . . . . . . . . . . . . . 6.2.6 6.2.5 . . . . . . . . . . . . . . . . . . . . autotools-package tutorial autotools-package reference . . . . . . . . cmake-package tutorial . . . . . cmake-package reference . . . . generic-package Tutorial generic-package Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.4.1 6.2.4.2 . . . . . . . . . . . . . . . . . . . Infrastructure for autotools-based packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.5.1 6.2.5.2 . . . . . . . . . . . . . . . . . . . . . Infrastructure for CMake-based packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.6.1 6.2.6.2 . . . . . . . . . . . . . . . . . . . . . . . . 6.2.7 Gettext integration and interaction with packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.8 Tips and tricks 6.2.8.1 Package name, config entry name and makefile variable relationship . . . . . . . . . . 6.2.8.2 How to add a package from github . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Providing patches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.3.1.1 Downloaded . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.3.1.2 Within Buildroot . 6.3.1.3 Global patch directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Format and licensing of the package patches Integrating patches found on the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.3.2 How patches are applied . 6.3.3 6.3.4 6.3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.9 Conclusion . 6.3 Patching a package . 6.4 Download infrastructure . . 7 Legal notice and licensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1 Complying with open source licenses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2 License abbreviations . . 7.3 Complying with the Buildroot license . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Beyond Buildroot 8.1 Boot the generated images . . 8.1.1 NFS boot . 8.2 Chroot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Getting involved 9.1 Mailing List . . . . . . . . . . . . . . Subscribing to the mailing list . Searching the List Archives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1.1 9.1.2 IRC . . . 9.2 9.3 Patchwork . 9.4 Bugtracker . iv . 28 . 30 . 34 . 34 . 34 . 36 . 36 . 36 . 37 . 38 . 38 . 38 . 38 . 39 . 39 . 39 . 39 . 39 . 39 . 40 . 40 . 40 41 . 41 . 42 . 42 43 . 43 . 43 . 43 44 . 44 . 44 . 44 . 44 . 44 . 45 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Buildroot user manual . . . . . . 9.5 Buildroot wikipage . 9.6 Events . . . . . . . . . . . . . . . . . . . . 9.6.1 Buildroot Developer Days aside ELC-E 2012 (November 3-4, 2012 - Barcelona) 9.6.2 Buildroot presentation at LSM 2012 (July 12-14, 2012 - Geneva) 9.6.3 Buildroot Developer Days aside FOSDEM 2012 (February 3, 2012 - Brussels) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Contributing to Buildroot . 10.1 Submitting patches . . . 10.2 Reviewing/Testing patches . 10.3 Autobuild . . . 10.4 Reporting issues/bugs, get help . . . . . . . . . . . . . . . . . . . 11 Appendix 11.1 Makedev syntax documentation . 11.2 Makeuser syntax documentation . . 11.3 Package Selection for the target . . . 11.4 Host utilities . . 11.5 Deprecated features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v . 45 . 45 . 45 . 45 . 45 46 . 46 . 47 . 47 . 47 48 . 48 . 49 . 50 . 50 . 50 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Buildroot user manual vi Buildroot usage and documentation by Thomas Petazzoni. Contributions from Karsten Kruse, Ned Ludd, Martin Herren and others. Buildroot 2013.08 manual generated on 2013-06-07 10:50:36 CEST from git revision 86bfe7c
The Buildroot user manual 1 / 50 Chapter 1 About Buildroot Buildroot is a tool that simplifies and automates the process of building a complete Linux system for an embedded system, using cross-compilation. In order to achieve this, Buildroot is able to generate a cross-compilation toolchain, a root filesystem, a Linux kernel image and a bootloader for your target. Buildroot can be used for any combination of these options, independently (you can for example use an existing cross-compilation toolchain, and build only your root filesystem with Buildroot). Buildroot is useful mainly for people working with embedded systems. Embedded systems often use processors that are not the regular x86 processors everyone is used to having in his PC. They can be PowerPC processors, MIPS processors, ARM processors, etc. Buildroot supports numerous processors and their variants; it also comes with default configurations for several boards available off-the-shelf. Besides this, a number of third-party projects are based on, or develop their BSP 1 or SDK 2 on top of Buildroot. 1 BSP: Board Support Package 2 SDK: Software Development Kit
The Buildroot user manual 2 / 50 Chapter 2 Starting up 2.1 System requirements Buildroot is designed to run on Linux systems. Buildroot needs some software to be already installed on the host system; here are the lists of the mandatory and optional packages (package names may vary between distributions). Take care to install both runtime and development data, especially for the libraries that may be packaged in 2 distinct packages. 2.1.1 Mandatory packages • Build tools: – which – sed – make (version 3.81 or any later) – binutils – build-essential (only for Debian based systems) – gcc (version 2.95 or any later) – g++ (version 2.95 or any later) – bash – patch – gzip – bzip2 – perl – tar – cpio – python (version 2.6 or 2.7) – unzip – rsync • Source fetching tools: – wget
分享到:
收藏