Building From Source

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 02:33, 2 August 2006 (edit)
Jcollake (Talk | contribs)
(Requirements)
← Previous diff
Revision as of 02:41, 2 August 2006 (edit) (undo)
Jcollake (Talk | contribs)
(Requirements)
Next diff →
Line 4: Line 4:
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. 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.
-* The first step is to download the proper source from the [http://www.dd-wrt.com/dd-wrtv2/downloads/index.php?path=sourcecode/ download page] or check it out of the subversion repository at svn://svn.dd-wrt.com/DD-WRT. Should be straightforward.+# The first step is to download the proper source from the [http://www.dd-wrt.com/dd-wrtv2/downloads/index.php?path=sourcecode/ download page] or check it out of the subversion repository at svn://svn.dd-wrt.com/DD-WRT. Should be straightforward.
-* Next, unpack it into a directory of your choice by running <tt>tar jxvf FILENAME</tt>. Change to the directory that process creates, probably named "DD-WRT" or something similar.+# Unpack it into a directory of your choice by running <tt>tar jxvf FILENAME</tt>. Change to the directory that process creates, probably named "DD-WRT" or something similar.
-* Next download the appropriate toolchain. This is a set of cross-compile tools. Unpack the toolchain wherever, but one suggestion is /location?/of?/ddwrtdirectory?/toolchain.+# Download the appropriate toolchain. This is a set of cross-compile tools. Unpack the toolchain wherever, but one suggestion is <tt>/location?/of?/ddwrtdirectory?/toolchain</tt>.
-* Next we'll make a workspace directory and some 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.+# 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.
-** <tt>mkdir -p /home/dev/workspace /home/backup/mikrotik</tt>+## <tt>mkdir -p /home/dev/workspace /home/backup/mikrotik</tt>
-** <tt>ln -s ~yourusername/image /GruppenLW</tt>+## <tt>ln -s ~yourusername/image /GruppenLW</tt>
-** <tt>ln -s /location/of/ddwrtdirectory /home/dev/workspace/DD-WRT</tt>+## <tt>ln -s /location/of/ddwrtdirectory /home/dev/workspace/DD-WRT</tt>
-* Link /opt/3.3.6 (warning: this step may not be accurate, but something like this ..)+# Link /opt/3.3.6 (warning: this step may not be accurate, but something like this ..)
-** <tt>mkdir /opt</tt>+## <tt>mkdir /opt</tt>
-** <tt>ln -s /opt/3.3.6 /location/of/ddwrtdirectory/DD-WRT/toolchains</tt>+## <tt>ln -s /opt/3.3.6 /location/of/ddwrtdirectory/DD-WRT/toolchains</tt>
-* Next we change some permissions:+# Next we change some permissions:
-** <tt>chmod +x src/router/iptables/extensions/.dccp-test</tt>+## <tt>chmod +x src/router/iptables/extensions/.dccp-test</tt>
-** <tt>chmod +x src/router/iptables/extensions/.layer7-test</tt>+## <tt>chmod +x src/router/iptables/extensions/.layer7-test</tt>
-* Change line 42 of src/router/zlib/Makefile:+# Change line 42 of src/router/zlib/Makefile:
-** prefix =/location/of/ddwrtdirectory/DD-WRT+## prefix =/location/of/ddwrtdirectory/DD-WRT
-* <tt>chmod +wxxx src/router/samba</tt>+# <tt>chmod +wxxx src/router/samba</tt>
-* rebuild some tools that may not be compatible with your linux install (especially if you're not using x64) **+# rebuild some tools that may not be compatible with your linux install (especially if you're not using x64) **
-** <tt>cd src/router/busybox/scripts</tt>+## <tt>cd src/router/busybox/scripts</tt>
-** <tt>rm bb_mkdep</tt>+## <tt>rm bb_mkdep</tt>
-** <tt>make bb_mkdep</tt>+## <tt>make bb_mkdep</tt>
-** <tt>cd ../../../..</tt>+## <tt>cd ../../../..</tt>
-** <tt>cd src/router/tools</tt>+## <tt>cd src/router/tools</tt>
-** <tt>rm jsformat</tt>+## <tt>rm jsformat</tt>
-** <tt>make jsformat</tt>+## <tt>make jsformat</tt>
-** <tt>cd ../../..</tt>+## <tt>cd ../../..</tt>
-* Change line 4 of ''opt/install.sh'' from <tt>export PATH=/home/release/DD-WRT/toolchains/bin</tt> to <tt>export PATH=/location/of/ddwrtdirectory/DD-WRT/toolchains/bin</tt>.+# Set the toolchain bin folder to your PATH environment.
-* Run <tt>opt/install.sh</tt>. Wish. Then wait a bunch.+# Run <tt>opt/install.sh</tt> to build all DD-WRT renditions (long process) or <tt>opt/install_*.sh</tt> to build a specific version, i.e. <tt>opt/install_micro.sh</tt>.
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)''. 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)''.
[[Category:English documentation]] [[Category:English documentation]]

Revision as of 02:41, 2 August 2006

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.

Requirements

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://svn.dd-wrt.com/DD-WRT. Should be straightforward.
  2. 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. Next we change some permissions:
    1. chmod +x src/router/iptables/extensions/.dccp-test
    2. chmod +x src/router/iptables/extensions/.layer7-test
  7. Change line 42 of src/router/zlib/Makefile:
    1. prefix =/location/of/ddwrtdirectory/DD-WRT
  8. chmod +wxxx src/router/samba
  9. 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 ../../..
  10. Set the toolchain bin folder to your PATH environment.
  11. Run opt/install.sh to build all DD-WRT renditions (long process) or opt/install_*.sh to build a specific version, i.e. opt/install_micro.sh.

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).