The SDK is a pre-compiled toolchain designed to cross compile packages for a specific target without compiling the whole system from scratch.
Tasks you can do with the SDK:
The SDK has the same prerequisites as the buildroot system, so please see Build system – Installation page to install the needed software to build the packages on the SDK.
Note: On some hosts it is needed to install the ccache package
Do everything as normal user, don't use root user or sudo!
Do not build in a directory that has spaces in its full path
You can either download a precompiled SDK, or compile it yourself from sources. Compilation from source is simply enabling the menuconfig option Build the OpenWrt SDK
(CONFIG_SDK).
The precompiled SDK is found in the same download folder where you find the firmware images for your device.
After decompressing the SDK archive, optionally edit the feeds.conf.default
file to add your package feeds. By default, this will contain the feeds used when the SDK was built. You can add your own feeds, local or remote, just like using the buildroot. If you are simply rebuilding extra packages, you don't need to do this at all.
* Use ./scripts/feeds update -a
command to obtain and update package definitions.
* After the definitions have been updates, ./scripts/feeds install <packagename>
to prepare the package and its dependencies.
./scripts/feeds install -a
Will make all packages available, again, just like in the buildroot.
Open a terminal in the SDK's folder and then open the SDK's menu by writing make menuconfig
The SDK menuconfig system is the same as the buildroot. Instructions are at the top, and help is available via the ?
key.
You probably want to disable some default settings, which build every available package.
Enter Global Build Settings
and in the submenu, deselect/exclude the following options:
Select all target specific packages by default
Select all kernel module packages by default
Select all userspace packages by default
Still in the menu, find the package you want to build and select it by pressing “m”, this will also select all the dependencies, and you will see that they are all tagged with “<M>” in the menu. You can select multiple packages too.
Save the configuration and exit the menu.
After the Makefile is in place, the usual buildroot commands apply:
make package/example/download
- download the soures of examplemake package/example/prepare
- extract the sources, apply patches and download if necessarymake package/example/compile
- compile example, prepare and download if necessarymake package/example/clean
- clean the sourcecodemake package/index
- build a repository index to make the output directory usable as local opkg source
Or just make
to build everything selected. (You can compile faster by writing make -j5
or similar as appopriate for your build host)
After the compilation is finished, the generated .ipk files are placed in the bin/packages and bin/targets directories inside the directory you extracted the SDK into.
Some SDK versions have bugs….