Building From Source

From DD-WRT Wiki

Revision as of 17:17, 4 August 2006 by Jcollake (Talk | contribs)
Jump to: navigation, search

Building DD-WRT from source is quite a daunting task. There isn't much documentation on this process on the official site, although Peter Cardoe's site is indeed very helpful. Hopefully expanding on his work will make it an easier process for newbies like me.


To build DD-WRT, you need a Linux machine. It should work on any reasonably modern machine, as long as you have a compiler installed - note that this may not be strictly necessary but I haven't tried it any other way.

  1. The first step is to download the proper source from the download page or check it out of the subversion repository at svn:// Should be straightforward.
  2. If you downloaded an archive, unpack it into a directory of your choice by running tar jxvf FILENAME. Change to the directory that process creates, probably named "DD-WRT" or something similar.
  3. Download the appropriate toolchain. This is a set of cross-compile tools. Unpack the toolchain wherever, but one suggestion is /location?/of?/ddwrtdirectory?/toolchain.
  4. Make a workspace directory and some folders needed by the build process. The name of the "toolchain" directory must be as shown. You may need to be "root" to create the first directory.
    1. mkdir -p /home/dev/workspace /home/backup/mikrotik
    2. ln -s ~yourusername/image /GruppenLW
    3. ln -s /location/of/ddwrtdirectory /home/dev/workspace/DD-WRT
  5. Link /opt/3.3.6 (warning: this step may not be accurate, but something like this ..)
    1. mkdir /opt
    2. ln -s /opt/3.3.6 /location/of/ddwrtdirectory/DD-WRT/toolchains
  6. Need this symlink as of 08/01/06 (or somewhere around there)
    1. ln -s src/linux/brcm/linux.v23/include/asm-mips src/linux/brcm/linux.v23/include/asm
  7. Next we change some permissions:
    1. chmod +x src/router/iptables/extensions/.dccp-test
    2. chmod +x src/router/iptables/extensions/.layer7-test
    3. chmod +wxxx src/router/samba
  8. rebuild some tools that may not be compatible with your linux install (especially if you're not using x64) **
    1. cd src/router/busybox/scripts
    2. rm bb_mkdep
    3. make bb_mkdep
    4. cd ../../../..
    5. cd src/router/tools
    6. rm jsformat
    7. make jsformat
    8. cd ../../..
  9. Set the toolchain bin folder to your PATH environment.
  10. Run opt/ to build all DD-WRT renditions (long process) or opt/install_*.sh to build a specific version, i.e. opt/

This page is only marginally useful; you do a lot of work and end up with a stock firmware. You may also want to see modifying DD-WRT (todo: fix this link).