What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Howto: Compile RMerlin's Asus firmware mod from source

Gingernut

Senior Member
Howto: Build RMerlin's Asus firmware mod from source

I'm no Linux expert so these are just instructions that I thought I'd share from what I've gathered up from different places on the net. This is all done on Ubuntu 12.04 LTS 64bit installed on a Virtual Box.

Start by installing needed dependencies and build tools:

Open up a terminal session and type or copy:

sudo apt-get install autoconf automake bash bison bzip2 diffutils file flex g++ gawk groff-base libncurses-dev libtool libslang2 make patch perl sed shtool subversion tar texinfo zlib1g zlib1g-dev git-core gettext libexpat1-dev libssl-dev cvs gperf unzip python libxml-parser-perl gcc-multilib gconf-editor gperf

If for some reason you get a package not found error or any other strange apt-get issuse use this command and try installing packages again:

sudo dpkg --configure -a && sudo apt-get install –f

Download RMerlin's super source:


Below where 'ginger' is stated you'll need to replace it with your user name:

sudo ln -s /home/ginger/asuswrt-merlin/tools/brcm /opt/brcm

export PATH=$PATH:/opt/brcm/hndtools-mipsel-linux/bin:/opt/brcm/hndtools-mipsel-uclibc/bin

sudo mkdir -p /media/ASUSWRT/

sudo ln -s /home/ginger/asuswrt-merlin /media/ASUSWRT/asuswrt-merlin

Your build environment is now prepared to go ahead and build the firmware image, it will probably take around 1 hour to finish building an image depending on your system.


To build an image for the RT-N66U

cd /home/ginger/asuswrt-merlin/release/src-rt

make clean

make rt-n66u

To build an image for the RT-AC66U:

sudo mkdir /home/ginger/asuswrt-merlin/release/src-rt-6.x/wl/sysdeps/default/linux

cd /home/ginger/asuswrt-merlin/release/src-rt-6.x

make clean

make rt-ac66u


Important notes:

Never issue a "make distclean", or else you'll have to reconfigure everything (kernel, firmware and all user time built in features)

While you can run make menuconfig inside the router/ folder to configure build options, these will be overriden by the parent Makefile.
To enable or disable an option, you have to edit $HOME/asuswrt/release/src-rt/target.mak . You can see the name of the available options by running make menuconfig from inside the router/ directory.

If your router does not boot after flashing a firmware built by you following these instructions I do not take any responsibility.

A ginormous thank you to RMerlin for all his hard work and dedication on this mod and to everybody elses sources for this howto.
 
Last edited:
Good job on detailing on the original details. Those were often quite vague.

I recommend people stick to one of the recommended distro versions mentionned by Asus. Any different version, and you'll be entirely on your own. Their build system isn't really designed to accommodate every single Linux distro out there. :)

One thing I'd like to add: it's VERY hard to brick an RT-N66U. The bootloader contains everything required to reflash a firmware through both web or the Asus provided recovery tool, and that bootloader does not get touched when flashing. So if you screwed up something, just turn the router on while keeping the reset button pressed until the power led starts blinking. At that point you will be in Recovery Mode, with the router accessible at 192.168.1.1 (don't forget to put your PC on a static IP inside that same network!).

So far in about 4 months of development I have gone through 4 bad flashes, all of them easily recoverable through this procedure.

That does not mean you should not be cautious. Firmware development isn't for everyone. Just that if something seems to have gone wrong, there is no need to panic - it's most likely quite recoverable.
 
libfuse (missing?) error during compile

I follow your istruction on ubuntu platform.

when I run 'make rt-n66u' I get this error during compilation of
/home/cesare/asuswrt-merlin/release/src/router/linux-ntfs-2.0.0/ntfsprogs:

mipsel-uclibc-gcc -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -DFUSE_USE_VERSION=26 -DBCMWPA2 -D__CONFIG_WPS__ -Wall -o .libs/ntfsmount ntfsmount-ntfsmount.o ntfsmount-utils.o -pthread ../libntfs/.libs/libntfs.so -lfuse -lrt -ldl
/home/cesare/asuswrt-merlin/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/mipsel-linux-uclibc/4.2.4/../../../../mipsel-linux-uclibc/bin/ld: cannot find -lfuse
collect2: ld returned 1 exit status

do you know something about?
Thank you,
Cesare
 
Another person ran into a similar issue under Gentoo. Be advised that compiling the firmware is only supported under Fedora 8, Fedora 9, and some versions of Ubuntu (I use 10.04 personally). Asus does not validate it under any other distro.
 
I follow your istruction on ubuntu platform.

when I run 'make rt-n66u' I get this error during compilation of
/home/cesare/asuswrt-merlin/release/src/router/linux-ntfs-2.0.0/ntfsprogs:

mipsel-uclibc-gcc -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -DFUSE_USE_VERSION=26 -DBCMWPA2 -D__CONFIG_WPS__ -Wall -o .libs/ntfsmount ntfsmount-ntfsmount.o ntfsmount-utils.o -pthread ../libntfs/.libs/libntfs.so -lfuse -lrt -ldl
/home/cesare/asuswrt-merlin/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/mipsel-linux-uclibc/4.2.4/../../../../mipsel-linux-uclibc/bin/ld: cannot find -lfuse
collect2: ld returned 1 exit status

do you know something about?
Thank you,
Cesare

I haven't seen this error yet so I'm not sure.

Are you building as root?

I got strange errors if I didn't build as root.

If you are building as root try straight after you get this error to readd the toolchain to PATH:

export PATH=$PATH:/opt/brcm/hndtools-mipsel-linux/bin:/opt/brcm/hndtools-mipsel-uclibc/bin

Sorry not sure but give these a shot and report.
 
:) thank you for reply,
I solved using ubuntu 10.04 clean install on virtualbox machine.
I don't know why, but on 12.04 LTS compilation didn't work. probably because the OS was not clear,a lot of programs were installed before, but I don't know which applications made the problem...

I need to recompile because I added a new feature, dnsmasq extra parameters, with web interface in DHCP server tab, just like ddwrt platforms...

Here the modified source code, if you are interested at this implementation.

thank you,
cesare
 

Attachments

Just made a build with your attached code and I'm in the process of testing it out.

Great addition thanks.

Maybe RMerlin can take a look and maybe include it in next release.
 
I have a more flexible way to implement this in mind.
 
Good idea in your mind!
I like it.
Tell me if I can help you in some way for your TO DO.
Opening to edit with user-friendly web interface important config files may be the right way to make more usable asus-wrt firmware.

very good.
Ce
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top