User Tools

Site Tools


Using the SDK

The SDK is a relocatable, precompiled OpenWrt toolchain suitable to cross compile single userspace packages for a specific target without compiling the whole system from scratch.

Reasons for using the SDK are:

  • Compile custom software for a specific release while ensuring binary and feature compatibility
  • Compile newer versions of certain packages
  • Recompile existing packages with custom patches or different features

Obtain SDK

You can either download an already compiled SDK, or compile it yourself by using the "make menuconfig" command.


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

Build SDK

After Buildroot installation run configuration Choose your Target System and then

[x] Build the OpenWrt SDK

After the compilation, you will find it in <build root>/bin/<arch>/


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 svn://, the Trac browser can be used to find the appropriate subdirectory.

The example below checks out the nano editor from the repository:

$ svn export svn:// 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

Some packages are built on host:

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

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 output of make might contain WARNING: your configuration is out of sync. Please run make menuconfig, oldconfig or defconfig!. That warning is misleading and wrong in the SDK case. Since everything is precompiled you cannot run oldconfig (see Why is the SDK configuration out of sync?).

Example: existing package

The example below rebuilds nano.

$ svn export svn:// package/nano
A    package/nano
A    package/nano/Makefile
Exported revision 20365.
$ grep DEPENDS package/nano/Makefile 
$ svn export svn:// 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

Build your own packages


:!: Some SDK versions have bugs.

Bug: BB SDK for BRCM2708: wants to compile with "ccache_cc" see

Bug: BB SDK for BRCM2708: static compilation broken

doc/howto/obtain.firmware.sdk.txt · Last modified: 2016/01/06 13:12 by chtseac