User Tools

Site Tools





  • 为了保证二进制和特性兼容性,针对特定的发行版编译自定义软件
  • 编译更新版本的指定包文件
  • 使用自定义的补丁或者不同特性来重新编译已经存在的包




You should find bz2-archives ready for download in the corresponding download directory:

Create one

configuration Choose you Target System and then

[x] Build the OpenWrt SDK

After the compilation, you will find in FIXME


By default the SDK ships with no package definitions. Makefiles for packages to compile must be checked out from the OpenWrt repository and placed into the package/ directory first.

Obtain Definitions

Use the svn export command to obtain package definitions. OpenWrt's Trunk package feed is located at, the Trac browser can be used to find the appropriate subdirectory. The example below checks out the nano editor from the repository: | $ svn export package/nano A package/nano A package/nano/Makefile Exported revision 20365. |

Many packages require additional dependencies which can be found in the package Makefile:

$ grep DEPENDS package/nano/Makefile DEPENDS:=+libncurses

If there are additional dependencies, those need to be fetched and compiled as well.

Compile Packages

After the Makefile is in place, the usual buildroot commands apply:

  • make package/example/download - download the soures of example
  • make package/example/prepare - extract the sources, apply patches and download if necessary
  • make package/example/compile - compile example, prepare and download if necessary
  • make package/example/clean - clean the sourcecode
  • make package/index - build a repository index to make the output directory usable as local opkg source

The common command to recompile a package example and enable verbose output is:

$ make package/example/{clean,compile} V=99

After the compilation is finished, the generated .ipk files are placed in the bin directory.


The example below rebuilds nano.

$ svn export package/nano A package/nano A package/nano/Makefile Exported revision 20365. $ grep DEPENDS package/nano/Makefile DEPENDS:=+libncurses $ svn export package/ncurses A package/ncurses A package/ncurses/patches A package/ncurses/patches/100-ncurses-5.6-20080112-urxvt.patch A package/ncurses/patches/900-terminfo.patch A package/ncurses/patches/101-ncurses-5.6-20080628-kbs.patch A package/ncurses/patches/500-cross.patch A package/ncurses/Makefile Exported revision 20365. $ make package/ncurses/compile Collecting package info: done make[1] package/ncurses/compile make[2] -C package/ncurses compile $ make package/nano/compile make[1] package/nano/compile make[2] -C package/ncurses compile make[2] -C package/nano compile $ make package/index make[1] package/index $ ls bin/packages/mipsel/ libncurses_5.7-2_mipsel.ipk nano_2.2.3-1_mipsel.ipk Packages Packages.gz
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
zh-cn/doc/howto/obtain.firmware.sdk.txt · Last modified: 2012/09/04 12:18 (external edit)