OpenWrt Buildroot 基础教程
Prerequisites
to generate an installable OpenWrt firmware image file with a size of e.g. 8MB:
Install OpenWrt Buildroot and its prerequisites on your OS.
ca. 3-4 GB of available hard disk space
environment variables:
SED should not be set. If it is, run unset SED
before compiling. (See Ticket 10612.)
GREP_OPTIONS should not have –initial-tab or other options affecting its output
Add
Procedure
- Update OpenWrt sources.
- Update and install package feeds.
- Configure the firmware image you want to obtain.
- Start the build. This will automatically compile toolchain,cross-compile sources, package packages, and finally generate an image ready to be flashed.
- Proceed to Installing OpenWrt
Updating Sources with Git
git pull
Updating Feeds
Update feeds:
./scripts/feeds update -a
Make downloaded package/packages available in make menuconfig:
single package:
./scripts/feeds install <PACKAGENAME>
all packages:
./scripts/feeds install -a
Image Configuration
Typical actions:
- run make menuconfig and set target;
- run make defconfig;
- run make menuconfig and modify set of package;
- run scripts/diffconfig.sh >mydiffconfig (save your changes in the
text file mydiffconfig); - run make V=s (build OpenWRT with console logging, you will look
where build failed.).
Make menuconfig
The OpenWrt Buildroot configuration interface handles the selection of the target platform, packages to be compiled, packages to be included in the firmware file, some kernel options, etc.
Start the OpenWrt Buildroot configuration interface by issuing the following command:
make menuconfig
This will update the dependencies of your existing configuration automatically, and you can now proceed to build your updated images.
You have three options: y, m, n which are represented as follows:
pressing y sets the <*> built-in label
This package will be compiled and included in the firmware image file.
pressing m sets the
This package will be compiled, but not included in the firmware image file. (E.g. to be installed with opkg after flashing the firmware image file to the device.)
pressing n sets the < > excluded label
The source code will not be processed.
When you save your configuration, the file
make kernel_menuconfig CONFIG_TARGET=subtarget
make defconfig
make or make world
The make sequience
Top command make world calls the following sequence of the commands:
make target/compile
make package/cleanup
make package/compile
make package/install
make package/preconfig
make target/install
make package/index
You may run each command independency. For example, if the process of compilation of packages stops on error, you may fix problem and next continue without cleanup:
make package/compile
make package/install
make package/preconfig
make target/install
make package/index
Warnings, errors and tracing
make V=s or make V=99
本文章由http://www.wifidog.pro/2015/08/02/OpenWrt-%E7%BC%96%E8%AF%91.html整理编辑,转载请注明出处