I've setup a machine last week to compile dd-wrt. I took me about 3h till my first successful compile. Basically you have to create a few dirs and symlinks. You find out which one if you checkout the Makefiles and by reading the compile errors:-)
Since the first attempt was just a quick setup inside a virtual machine I did not write down all the neccessary steps.
But I intend to prepare my main linux workstation in order to compile dd-wrt. This time I'm going to write down all the neccessary steps.
Hi guys,
I am now trying to compile DD-WRT by myself to install it on my WNR3500L.
I have downloaded all source codes and toolchains from the DD-WRT's web site and their SVN.
But their tutorials looks old, and some of them can not be applied to the current revision. (Especially, to compile the toolchains.)
Does any one have a tutorial to compile the source codes?
Please, help me.
Best regards,
Yong.
Thanks for your comment. I am trying to follow the thread from the DD-WRT forum. I will update, if I succeed compiling with that.
Thanks again,
Yong woon Ahn
Hi, where did you got the toolchain?
I ask because the link for the toolchain in the above said thread isn't working anymore (the toolchain with the name "Debian" in it).
I need the toolchain for x86 PC environment (Debian 6, 32bit).
Ralf said: Hi, where did you got the toolchain? I ask because the link for the toolchain in the above said thread isn't working anymore (the toolchain with the name "Debian" in it). I need the toolchain for x86 PC environment (Debian 6, 32bit).
Hi, Ralf,
Actually, I also could not find the toolchain mentioned in their tutorial to compile the toolchain.
Maybe some people like me are facing on the same problem. See this page. I think you also need to find out the particular toolchains which are not located the dd-wrt web site.
If you find a solution for this problem. please, post here.
Best regards,
Yong
I think I have to give up compiling dd-wrt.
Just for curiosity I tried openwrt, and to my surprise its process of compilation is IMHO exceptionally good made. Just try yourself:
svn co svn://svn.openwrt.org/openwrt/trunk/
cd trunk
make menuconfig (<-- that's cool made!)
make
Beware: One must do it as a non-root user!
Mine is compiling right now, and not even a single warning so far! :-)
admin2@comp11:/FILES/openwrt_svn/trunk$ make
make[4]: Entering directory `/FILES/openwrt_svn/trunk/target/linux'
make[5]: Entering directory `/FILES/openwrt_svn/trunk/target/linux/brcm-2.4'
make[6]: Entering directory `/FILES/openwrt_svn/trunk/target/linux/brcm-2.4/image'
make[6]: Leaving directory `/FILES/openwrt_svn/trunk/target/linux/brcm-2.4/image'
make[5]: Leaving directory `/FILES/openwrt_svn/trunk/target/linux/brcm-2.4'
make[4]: Leaving directory `/FILES/openwrt_svn/trunk/target/linux'
make[1] world
make[2] tools/install
make[3] -C tools/m4 compile
make[3] -C tools/m4 install
make[3] -C tools/autoconf compile
make[3] -C tools/autoconf install
make[3] -C tools/automake compile
make[3] -C tools/automake install
make[3] -C tools/bison compile
make[3] -C tools/bison install
make[3] -C tools/sed compile
make[3] -C tools/sed install
make[3] -C tools/pkg-config compile
make[3] -C tools/pkg-config install
make[3] -C tools/mklibs compile
make[3] -C tools/mklibs install
make[3] -C tools/sstrip compile
make[3] -C tools/sstrip install
make[3] -C tools/ipkg-utils compile
make[3] -C tools/ipkg-utils install
make[3] -C tools/genext2fs compile
make[3] -C tools/genext2fs install
make[3] -C tools/libuuid compile
make[3] -C tools/libuuid install
make[3] -C tools/mtd-utils compile
make[3] -C tools/mtd-utils install
make[3] -C tools/mkimage compile
make[3] -C tools/mkimage install
make[3] -C tools/firmware-utils compile
make[3] -C tools/firmware-utils install
make[3] -C tools/patch-cmdline compile
make[3] -C tools/patch-cmdline install
make[3] -C tools/quilt compile
make[3] -C tools/quilt install
make[3] -C tools/yaffs2 compile
make[3] -C tools/yaffs2 install
make[3] -C tools/lzma-old compile
make[3] -C tools/lzma-old install
make[3] -C tools/squashfs compile
make[3] -C tools/squashfs install
make[2] toolchain/install
make[3] -C toolchain/binutils prepare
...
@Yong woon Ahn
Just use the latest toolchain which is linked on the wiki "Development" Page.
All you have to do is add toolchain-mipsel_gcc4.1.2/bin to your PATH. It is the only toolchain you will need to compile K26 for the wnr3500l
@Ralf, if you are feeling fine with kernel 2.4 which your are compiling right now, ok:-)
@Kong
yes, at the moment kernel 2.4 is enough for me because I've also a WGR614v9
which does not have that much memory.
Generally, I really don't need that much options in the firmware, not even a webserver on the router; iptables is enough for me :-)
# Still TRYING to compile ANY ONE of the target versions of "dd-wrt"...
# (of course my attempts continue failing misarebly... :-)
# set these:
DDWRT_DIR=/FILES/dd-wrt
TOOLCHAIN_DIR=/FILES/dd-wrt_toolchains/toolchain-mipsel_gcc4.1.2
TOOLCHAIN_VERSION=4.1.2
ln -s $TOOLCHAIN_DIR /opt/$TOOLCHAIN_VERSION
export MYPATH=$PATH
export PATH=/opt/$TOOLCHAIN_VERSION/bin:$MYPATH
cd $DDWRT_DIR
#cd $DDWRT_DIR/src/router
#cp .config_mini.v24 .config
#cp ../linux/linux/.config_std ../linux/linux/.config
make configure
make
#----- And the result is... ----- :-)
comp11:/FILES/dd-wrt# ./MY_make.sh
make: *** No rule to make target `configure'. Stop.
make -C src all
make[1]: Entering directory `/FILES/dd-wrt/src'
make -C router all
make[2]: Entering directory `/FILES/dd-wrt/src/router'
rules/iptables.mk:37: warning: overriding commands for target `iptables-clean'
rules/iptables.mk:2: warning: ignoring old commands for target `iptables-clean'
rules/all.mk:114: rules/mmc-ixp4xx.mk: No such file or directory
rules/all.mk:181: rules/strace.mk: No such file or directory
[ ! -d rules/strace.mk ] || make -C rules/strace.mk
[ ! -d rules/mmc-ixp4xx.mk ] || make -C rules/mmc-ixp4xx.mk
rm -rf /FILES/dd-wrt/src/router/mipsel-uclibc/target
rm -rf /FILES/dd-wrt/src/router/mipsel-uclibc/install
rm -f /FILES/dd-wrt/src/router/mipsel-uclibc/linux.trx /FILES/dd-wrt/src/router/mipsel-uclibc/vmlinuz /FILES/dd-wrt/src/router/mipsel-uclibc/target.squashfs
make -C nvram
make[3]: Entering directory `/FILES/dd-wrt/src/router/nvram'
mipsel-linux-uclibc-gcc -Os -pipe -mips32 -mtune=mips32 -funit-at-a-time -I. -I/FILES/dd-wrt/src/include.v24 -Wall -s -Os -pipe -mips32 -mtune=mips32 -funit-at-a-time -fPIC -c -o nvram_linux.o nvram_linux.c
/opt/4.1.2/bin/mipsel-linux-uclibc-gcc: 1: Syntax error: "(" unexpected
make[3]: *** [nvram_linux.o] Error 2
make[3]: Leaving directory `/FILES/dd-wrt/src/router/nvram'
make[2]: *** [nvram] Error 2
make[2]: Leaving directory `/FILES/dd-wrt/src/router'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/FILES/dd-wrt/src'
make: *** [all] Error 2
comp11:/FILES/dd-wrt#
I wonder where *I* did a mistake? did I? :-)
Below is the DD-WRT compilation procedure for WNR3500L board
Requirement:
1.) 64-bit machine with kernel version 2.6.23 above.
Procedure:
1.) Checkout source code.
2.) Go to router directory.
3.) Copy .config-mini.v24 to .config
4.) Edit .config file
a.) LINUXDIR=$(SRCBASE)/linux/brcm/linux-2.6.23.
b.) Add CONFIG_BCMMODERN=y
c.) Remove CONFIG_SPUTNIK_APD macro.
5.) Open the file $(BASEDIR)/src/linux/brcm/linux-2.6.23/drivers/net/wireless/Kconfig and remove the following lines.
source "drivers/net/wireless/hostap/Kconfig"
source "drivers/net/wireless/bcm43xx/Kconfig"
source "drivers/net/wireless/zd1211rw/Kconfig"
source "drivers/net/wireless/madwifi/Kconfig"
6.) export PATH=/opt/toolchain-mipsel_gcc4.1.2/bin/:$PATH
7.) Build trx in $(BASEDIR)/opt/tools/
8.) In router directory run make -f Makefile.brcm26 configure.
9.) In router directory run make -f Makefile.brcm26 clean all install.
@Tathagata, thanks for replying.
Now, I can understand why the compilation command in the make scripts has 64 bit options. Actually, I have tried modify them to 32 bit options manually because of my 32 bit OS.
To compile any kinds of openWRT based firmware for WNR3500L, do we have to use 64bit machine, or only for DD-WRT?
(Actually, as Ralf posted, it looks OpenWRT's menu_config has no problem with compiling OpenWRT.)
However, it looks really hard to retrieve source codes, make a modification, and recompile for WNR3500L.
Since my final goal is to implement a new QoS mechanism for WNR3500L with 802.11n, I am now trying to play with Tomato. (The stock opened source codes only have precompiled wireless drives by Broadcom.)
Best regards,
Yong
Every firmware has pre-compiled wireless driver.
For OpenWRT, you do not need to have 64bit machine. This is only for DD-WRT with 2.6.23 kernel.
I think with the "multilib" library one should be able to compile also 64bit under a 32bit OS (and vice versa), at least under Debian / Ubuntu.
# dpkg -l | grep -i multilib
ii g++-4.4-multilib 4.4.3-5 The GNU C++ compiler (multilib files)
ii gcc-4.4-multilib 4.4.3-5 The GNU C compiler (multilib files)
ii gcc-multilib 4:4.4.3-1 The GNU C compiler (multilib files)
Tathagata Das said: Below is the DD-WRT compilation procedure for WNR3500L board Requirement: 1.) 64-bit machine with kernel version 2.6.23 above. Procedure: 1.) Checkout source code. 2.) Go to router directory. 3.) Copy .config-mini.v24 to .config 4.) Edit .config file a.) LINUXDIR=$(SRCBASE)/linux/brcm/linux-2.6.23. b.) Add CONFIG_BCMMODERN=y c.) Remove CONFIG_SPUTNIK_APD macro.The .config file(ie. config_mini.v24) says at top "# Automatically generated make config: don't edit",
and yes it's a fresh checkout done just two days ago.
It seems the above edit tasks under #4 must be done somewhere else, right?..
I addition to what Tathagata said, with the latest svn checkout compile stopps when building bird since some files are not in sync, so one needs to go into bird directory run make clean ./configure and make, after that compile will succeed.
If you want to change some of the build options in .config you can run:
make menuconfig
in dir "router"
.config files are normally generated automatically.
Here we do not do "make menuconfig", rather we modify .config file manually as described in #4. So #4 is right.
I did yesterday, using trunk with basically the same steps as Tathagata mentioned.
Ah and of course you have to compile some tools:
#!bin/bash
cd ~/DD-WRT/src/router/tools
rm jsformat
make jsformat
cd ~/DD-WRT/src/squashfs-tools/lzma/C/7zip/Compress/LZMA_Alone
mv makefile makefile.disabled
mv makefile.gcc makefile
make
cp -vf lzma ~/DD-WRT/opt/loader-0.02/
mv makefile makefile.gcc
mv makefile.disabled makefile
cd ~/DD-WRT/src/squashfs-tools
rm mksquashfs-lzma
make
cp mksquashfs-lzma ../linux/brcm/linux-2.6.23/scripts/squashfs
cd ~/DD-WRT/tools/
rm ./strip
gcc strip.c -o ./strip
rm ./write3
gcc write3.c -o ./write3
rm ./write4
gcc write4.c -o ./write4
rm ./webcomp
gcc -o webcomp -DUEMF -DWEBS -DLINUX webcomp.c
gcc -o trx trx.c
Sorry little error in the script posted before:
gcc -o trx trx.c
you need to cd:
cd ~/DD-WRT/opt/tools/
Tathagata Das said: I personally able to compile that code.thank Tathagata Das a lot, your instruction is very useful :)
SVN=14875
1 to 8 ok
9.) In router directory run make -f Makefile.brcm26 clean all install.
NOK
make : [bird-symlinks] Error 1 ( no tiene efecto)
cf-parse.y: In function 'cf_parse'
cf-parse.y:892 error : too few arguments to function 'proto_debug'
cf-parse.y:1464 error : 'bgp_as4_support' undeclared (first use in thins function)
cf-parse.y:1464 error : (Each undeclared indentifier is reported only once
cf-parse.y:1464 error : for each function it appears in.)
make[3]: **** [cf-parse.tab.o] Error 1
make[2]: **** [subdir] Error 2
make[1]: **** [all] Error 2
make: **** [bird] Error 2
solved bird issue with make clean and ./configure and make
now have another error: missing defconfig-bcm947xx
missing file ../DD-WRT/src/linux/brcm/linux2.6.23/arch/mips/defconfig-bcm947xx
i view only defconfig-bcm947xx-slimrtr
Hi, maybe this is a stupid question, but what do I need to download in svn://svn.dd-wrt.com/DD-WRT to compile firmware for WNR3500L? Do I need to download the whole site or just a part of it?
You need to download all applications, toolchain. But you do not require to download all variant of Linux distribution, only brcm is needed.
If you have no problem with disk space then you can download everything from dd-wrt's svn.

RSS

