![](https://csdnimg.cn/release/download_crawler_static/7275267/bg3.jpg)
– OpenWrt
1 Design
1.1 Directory structure
There a r e four key directories in the base:
• tools
• toolchain
• package
• target
tools and toolchain refer to common tools which will be used t o build
the firmware image, the compiler, and the C library. The result of this
is three new directories, build_dir/host, which is a temporary directory
for building the target independent tools, build_dir/toolchain-<arch> *
which is used for building the toolchain for a specific architecture, and
staging_dir/toolchain-<arch> * where t he resulting toolchain is installed.
You will not need to do anything with t he toolchain directory unless you in-
tend to add a new version of one of the components above.
• build_dir/host
• build_dir/toolchain-<arch> *
1.2 Packages and external repositories
package is for exactly that – packages. In an OpenWrt firmware, almost
everything is an .ipk, a software package which can be added to the firmware
to provide new features or removed to save space. Note that packa ges are also
maintained outside of the main trunk and can be obtained from subversion
using the package feeds system:
$ ./scripts/feeds update
Those packages can be used to extend the functionality of the build system
and need to be symlinked into the main trunk. Once you do that, the pack-
ages will show up in the menu for configuration. From kamikaze you would
do something like this:
1