The DD-WRT v23 SP1 Final building guide

Post new topic   Reply to topic    DD-WRT Forum Index -> Generic Questions
Author Message

Joined: 01 Jan 1970

PostPosted: Fri Aug 04, 2006 20:18    Post subject: The DD-WRT v23 SP1 Final building guide Reply with quote
The DD-WRT v23 SP1 Final building guide

This guide describes step by step how to build DD-WRT v23 SP1 final firmware from source on Ubuntu 6.06 and 6.06.1 LTS (32bit, x86).

This was tested running Ubuntu in VMware. To start download and install the VMware player and also get a ready to use Ubuntu VMware image (direct torrent link). The user name and password for the image is "ubuntu". With these two programs you can directly start building DD-WRT on Windows without installing any Linux on your PC. To get files of your virtual machine e.g. use Apache, SAMBA, SCP or whatever.

If you find any errors, mistakes or have suggestions do not hesitate to discuss here. Feel free to add this document to the DD-WRT Wiki.

It’s recommended that you create a normal user account („dd-wrt“ username recommended). Do NOT use „root“ to build DD-WRT. Add the „dd-wrt“ user to /etc/sudoers or use System / Administration / Users and Groups / Properties from „dd-wrt“ user / Register User privileges / check „Executing system administration tasks“

Lets start :)

1. Install the following Ubuntu packages and its dependencies (use apt-get or System / Administration / Synaptic Package Manager)
sudo apt-get install gcc g++ binutils patch bzip2 flex bison make autoconf gettext texinfo unzip sharutils subversion libncurses5-dev zlib1g-dev openssh-server apache2 samba uml-utilities

2. Download the sources (toolchain (69M) and the SP1 final (84M))
cd /home/dd-wrt

3. Unpack the toolchain
tar -jxf toolchains.x86.debian.sp1.tar.bz2

3.1 Install the toolchain
cd /home/dd-wrt/toolchains
ln -sf 3.4.6-uclibc-0.9.28 3.4.6
ln -sf 4.1.0-uclibc-0.9.28 4.1.0

3.2 Add the toolchains bin folder to your PATH environment variable
export PATH=/home/dd-wrt/toolchains/4.1.0/bin:$PATH

4. Create some folders and symbolic links needed by the build process
cd /home/dd-wrt
mkdir -p /home/dd-wrt/image
sudo mkdir -p /home/dev/workspace /home/backup/mikrotik
sudo ln -sf /home/dd-wrt/image /GruppenLW
sudo ln -sf /home/dd-wrt /home/dev/workspace
sudo ln -sf /home/dd-wrt/toolchains /home/backup/mikrotik/toolchain

5. Unpack the v23 SP1 final tarball
tar -jxf dd-wrt.v23.SP1-Final.src.tar.bz2

5.1 Fix some permissions
cd /home/dd-wrt/DD-WRT
chmod +x src/router/iptables/extensions/.dccp-test
chmod +x src/router/iptables/extensions/.layer7-test
chmod +wxxx src/router/samba

5.2 Fix the path in the zlib Makefile (line 42)
vi src/router/zlib/Makefile
   -prefix =/usr/local
   +prefix =/home/dd-wrt/DD-WRT

5.3 Some more fixes
cd /home/dd-wrt/DD-WRT/opt
ln -sf libgcc/
cd /home/dd-wrt/DD-WRT/src/linux
ln -sf linux.v23 linux

5.4 Set the toolchain bin folder to your PATH environment. (skip this point if your username is „dd-wrt“, line 3 and line 27)
cd /home/dd-wrt/DD-WRT/opt
   -export PATH=/home/dd-wrt/toolchains/3.4.6/bin:$MYPATH
   +export PATH=/home/dd-wrt/toolchains/3.4.6/bin:$MYPATH
   -export PATH=/home/dd-wrt/toolchains/4.1.0/bin:$MYPATH
   +export PATH=/home/dd-wrt/toolchains/4.1.0/bin:$MYPATH

5.5 To be able to build SP1 final on a 32bit operating system you need a 32bit version of the mksquashfs-lzma file. You can follow the relevant parts at Compiling DD-WRT Sources. I recommend you download my precompiled mksquashfs-lzma file (attached to this post) and move it into the right folder:
cd /home/dd-wrt
wget -O mksquashfs-lzma.tar.gz ""
tar -xzf mksquashfs-lzma.tar.gz
chmod +x mksquashfs-lzma
mv -f mksquashfs-lzma /home/dd-wrt/DD-WRT/src/linux/linux.v23/scripts/squashfs

6. Finally start the build process. If breaks just rerun it. If it runs the second time it finishes the build process and creates valid images
cd /home/dd-wrt/DD-WRT/opt

6.1 After several coups of tea or coffee (or after about 1.5 hours) later you should have images in /home/dd-wrt/image

7. Information for this guide was taken from
- Compiling DD-WRT Sources
- Building From Source
- Firmware Modification Kit
- µTorrent

I hope this is helpful and make things more clear. Have fun! :)

To compile only a single file for DD-WRT see the compile own programs thread.

mksquashfs-lzma (32bit)

 Filename:  mksquashfs-lzma.tar.gz
 Filesize:  83.79 KB
 Downloaded:  3543 Time(s)

Last edited by on Tue Aug 29, 2006 12:46; edited 19 times in total
DD-WRT Novice

Joined: 07 Jun 2006
Posts: 32

PostPosted: Fri Aug 04, 2006 23:33    Post subject: Reply with quote
thank you for the guide. i think this should go on the wiki.

Joined: 01 Jan 1970

PostPosted: Sun Aug 27, 2006 7:40    Post subject: Reply with quote
Added torrent link for a Ubuntu 6.06 VMware image which can be used with the free available VMware player.

Joined: 01 Jan 1970

PostPosted: Mon Sep 04, 2006 10:04    Post subject: Reply with quote
There will be no more updates on this guide.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Generic Questions All times are GMT


Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum