_______                     ________        __
|       |.-----.-----.-----.|  |  |  |.----.|  |_
|   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
|_______||   __|_____|__|__||________||__|  |____|
         |__| W I R E L E S S   F R E E D O M

Some basic stuff you maybe want to know about OpenWrt package development.

Building OpenWrt

Linux Development Environment

I had no trouble building OpenWrt using the following Linux distributions:

  • Debian - Seems to be the best choice because all tools are available and stable
  • Gentoo - Very nice because I love it

I had trouble building OpenWrt using the following distributions:

  • Fedora - I had much trouble to get it running and some patches where needed. I don't use Fedora for OpenWrt development anymore; It is a pain!

Getting the source code

Use this command to check out the base system trunk and toolchain:

git clone

Getting the OpenWrt packages

cd openwrt
git clone

Creating packages

Example Makefile

This is not complete yet; I will try to keep records of relevant sections and settings.

You need to know that there are many small differences in each software available. It is mostly not possible to use the same Makefile parameters for multiple pieces of software. Therefore you really need to take a look at other Makefiles to learn what is possible. In most cases there is a simple way to fix every build problems but when not you simply could aplly patches to the original code to make it work.

# Copyright (C) 2008
# This is free software, licensed under the GNU General Public License v2.

include $(TOPDIR)/



# Sart make install at build time

        -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
        -Wl,-rpath-link=$(STAGING_DIR)/usr/lib/libiconv/lib \

include $(INCLUDE_DIR)/

define Package/foo
  TITLE:=The Foo Manager

define Package/foo/description
  Foo software for making foo...

define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install

$(eval $(call BuildPackage,foo))

Adding patches


Adding default files to packages

TODO! files like /etc/config/foo.etc ...

Mark packages broken

Just add the @BROKEN flag to the DEPENDS section and your packages will not be selectable in menuconfig.

define Package/pidgin-x-session
  TITLE:=pidgin X session support
  DEPENDS:=pidgin +libX11 @BROKEN

Package repositories

Add your own local repository

Go to the root of your OpenWrt source directory.

hanez@phantom ~ % cd /home/hanez/openwrt/new
hanez@phantom new % cp feeds.conf.default feeds.conf

Edit feeds.conf with your favorite $EDITOR. Add a line like the following to add a local filesystem based repository with the name "hanez":

src-link hanez /home/hanez/openwrt/packages

My file looks like this:

src-svn packages
src-svn xwrt
src-svn luci
src-link hanez /home/hanez/openwrt/packages

After that you need to update the OpenWrt repository cache. You need to use the following command for updating the the feed named "hanez":

hanez@phantom new % scripts/feeds update hanez
Updating feed 'hanez' from '/home/hanez/openwrt/packages' ...
Create index file './feeds/hanez.index'
Collecting package info: done

Now you need to install the packages:

hanez@phantom new % scripts/feeds install -p hanez
++ mkdir -p /home/hanez/openwrt/new/staging_dir/toolchain-arm_gcc4.1.2
++ cd /home/hanez/openwrt/new/staging_dir/toolchain-arm_gcc4.1.2
++ mkdir -p bin lib include stamp

Building packages

Show output at build time

You need to add the parameter V=99 if you want full output of the configure and make process while building a package or the toolchain.

make V=99

Compile a single package

If you want to compile a single package you need the following command. Make shure to select the package in menuconfig before. If it is not selected you need to add DEVELOPER=1 to compile it. Replace $PACKENAME with the name of your software package.

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