Building From Source
From DD-WRT Wiki
Revision as of 09:58, 14 July 2006 (edit) Jcollake (Talk | contribs) (→Requirements) ← Previous diff |
Revision as of 02:27, 2 August 2006 (edit) (undo) Jcollake (Talk | contribs) (→Requirements) Next diff → |
||
Line 37: | Line 37: | ||
---- | ---- | ||
- | '''Notes from | + | '''Notes from Jeremy Collake:''' |
- | + | I've merged some proper steps for recent builds into the above instructions, but most are now unncessary. I'm in the process of writing a script to get DD-WRT ready to build.. it's not done yet though. | |
+ | |||
+ | <code> | ||
+ | echo ................................................................ | ||
+ | echo adjusting attributes | ||
+ | echo ................................................................ | ||
+ | cd $DDROOT | ||
+ | chmod +x src/router/iptables/extensions/.dccp-test | ||
+ | chmod +x src/router/iptables/extensions/.layer7-test | ||
+ | echo done | ||
+ | |||
+ | echo ................................................................ | ||
+ | echo re-building tools | ||
+ | echo ................................................................ | ||
+ | # make bb_mkdep | ||
+ | cd src/router/busybox/scripts | ||
+ | rm bb_mkdep | ||
+ | make bb_mkdep | ||
+ | # make jsformat | ||
+ | cd ../../../.. | ||
+ | cd src/router/tools | ||
+ | rm jsformat | ||
+ | make jsformat | ||
+ | cd ../../.. | ||
+ | echo done | ||
+ | </code> | ||
+ | |||
+ | Now to build, ''simply put the toolchains folder in your environment PATH variable'' and run opt/install.sh or opt/install_*.sh for a specific build. | ||
- | * 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>rm bb_mkdep</tt> | ||
- | ** <tt>make bb_mkdep</tt> | ||
- | ** <tt>cd ../../../..</tt> | ||
- | ** <tt>cd src/router/tools</tt> | ||
- | ** <tt>rm jsformat</tt> | ||
- | ** <tt>make jsformat</tt> | ||
- | ** <tt>cd ../../..</tt> | ||
- | * with root user make /opt/3.3.6 link to toolchain folder (not toolchain/bin) | ||
- | ** <tt>su</tt> | ||
- | ** <tt>mkdir /opt</tt> | ||
- | ** <tt>ln -s /opt/3.3.6 /location/of/ddwrtdirectory/DD-WRT/toolchains</tt> | ||
- | ** <tt>su myregularuser</tt> | ||
--[[User:Jcollake|Jcollake]] 11:53, 14 Jul 2006 (CEST) | --[[User:Jcollake|Jcollake]] 11:53, 14 Jul 2006 (CEST) |
Revision as of 02:27, 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.
- The first step is to download the proper source from the download page. Should be straightforward.
- Next, 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.
- 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.
- 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.
- mkdir -p /home/dev/workspace /home/backup/mikrotik
- ln -s ~yourusername/image /GruppenLW
- ln -s /location/of/ddwrtdirectory /home/dev/workspace/DD-WRT
- Link /opt/3.3.6 (warning: this step may not be accurate, but something like this ..)
- mkdir /opt
- ln -s /opt/3.3.6 /location/of/ddwrtdirectory/DD-WRT/toolchains
- Next we change some permissions:
- chmod +x src/router/iptables/extensions/.dccp-test
- chmod +x src/router/iptables/extensions/.layer7-test
- Change line 42 of src/router/zlib/Makefile:
- prefix =/location/of/ddwrtdirectory/DD-WRT
- chmod +wxxx src/router/samba
- rebuild some tools that may not be compatible with your linux install (especially if you're not using x64) **
- cd src/router/busybox/scripts
- rm bb_mkdep
- make bb_mkdep
- cd ../../../..
- cd src/router/tools
- rm jsformat
- make jsformat
- cd ../../..
- Change line 4 of opt/install.sh from export PATH=/home/release/DD-WRT/toolchains/bin to export PATH=/location/of/ddwrtdirectory/DD-WRT/toolchains/bin.
- Run opt/install.sh. Wish. Then wait a bunch.
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.
Notes from Jeremy Collake:
I've merged some proper steps for recent builds into the above instructions, but most are now unncessary. I'm in the process of writing a script to get DD-WRT ready to build.. it's not done yet though.
echo ................................................................
echo adjusting attributes
echo ................................................................
cd $DDROOT
chmod +x src/router/iptables/extensions/.dccp-test
chmod +x src/router/iptables/extensions/.layer7-test
echo done
echo ................................................................ echo re-building tools echo ................................................................
- make bb_mkdep
cd src/router/busybox/scripts rm bb_mkdep make bb_mkdep
- make jsformat
cd ../../../.. cd src/router/tools rm jsformat make jsformat cd ../../.. echo done
Now to build, simply put the toolchains folder in your environment PATH variable and run opt/install.sh or opt/install_*.sh for a specific build.
--Jcollake 11:53, 14 Jul 2006 (CEST)