What's new

Trying to compile asuswrt

  • 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!

maycribb

Occasional Visitor
I am trying to compile asuswrt on ubuntu 12.10

By following the procedure written in README.TXT

1. prepare environment



Install these packages (I used synaptic: "sudo synaptic")



libncurses5

libncurses5-dev

m4

bison

gawk

flex

libstdc++6-4.4-dev

g++-4.4

g++

git

gitk

zlib1g-dev

I have installed all these components, no problem so far.

2. prepare source to, ex, $HOME/asuswrt

cd $HOME

tar xvfz [tar file]

I have done that.

3. setup development system

ln -s $HOME/asuswrt/tools/brcm /opt/brcm

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

ln -s $HOME/asuswrt/tools/buildroot-gcc342 /opt/buildroot-gcc342

I get an error saying permission denied when doing this: ln -s $HOME/asuswrt/tools/brcm /opt/brcm
So I copied $HOME/asuswrt/tools/brcm to /opt/brcm
I have added those 2 paths to PATH.
And I don't see "buildroot-gcc342" in folder tools, so I did not do anything for this line.

4. build firmware, ex, rt-n16
cd release/src-rt/

make rt-n16

I replace rt-n16 with rt-n66, and got this error
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
make[1]: Entering directory `/home/ubuntu/Documents/asuswrt/release/src-rt'
bin is not a valid target!
make[1]: *** [bin] Error 1
make[1]: Leaving directory `/home/ubuntu/Documents/asuswrt/release/src-rt'
make: *** [rt-n66] Error 2

Can anyone guide me through this? What have I done wrong? Thank you
 
Check instructions on my Wiki - they should apply the same to the regular GPL code.

https://github.com/RMerl/asuswrt-merlin/wiki

You will need to be root to create that symlink.

I also always build as root (since this is a dedicated dev VM) - saves up a lot of trouble.
 
Update

I realized I made a few mistake, make rt-n66 should be replaced with make rt-n66u

And I have tried to create symbolic link using root, I got this error

ln: failed to create symbolic link `/opt/brcm': File exists

I cant find this file anywhere though
 
I fixed the symbolic link problem

What should I replace this line with?
sudo mkdir -p /media/ASUSWRT/

Should I ignore this line?
ln -s $HOME/asuswrt/tools/buildroot-gcc342 /opt/buildroot-gcc342
 
I fixed the symbolic link problem

What should I replace this line with?
sudo mkdir -p /media/ASUSWRT/

Should I ignore this line?
ln -s $HOME/asuswrt/tools/buildroot-gcc342 /opt/buildroot-gcc342

These two lines should no longer be necessary.
 
I am getting this error when compiling(lots)
mipsel-uclibc-gcc: Command not found
and this too
fatal: Not a git repository (or any of the parent directories): .git

any idea what went wrong?
 
I am getting this error when compiling(lots)
mipsel-uclibc-gcc: Command not found
and this too
fatal: Not a git repository (or any of the parent directories): .git

any idea what went wrong?

First line means you didn't properly set the default PATH as documented. The path will be to be changed everytime you log in, unless you add it to the user profile.

The second one you can ignore - this is probably part of the cleanup script used by Asus for their own development.
 
I am pretty sure I have set the PATH variable

I checked the PATH and it looks like this

root@ubuntu:/home/ubuntu/asuswrt/release/src-rt# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/brcm/hndtools-mipsel-linux/bin:/opt/brcm/hndtools-mipsel-uclibc/bin

I found mipsel-uclibc-gcc too.

I have uploaded a screenshot

root@ubuntu:/home# mipsel-uclibc-gcc
bash: /opt/brcm/hndtools-mipsel-linux/bin/mipsel-uclibc-gcc: No such file or directory

Even though mipsel-uclibc-gcc is right there in that folder.
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    48.4 KB · Views: 304
Last edited:
Do an "ls -l /opt/brcm/hndtools-mipsel-linux/bin/" in that folder, and make sure there are no broken symlinks, and that everything is set to executable. There should be over 50 entries in there:

ls -l /opt/brcm/hndtools-mipsel-linux/bin/ | wc -l
57

Also make sure you don't have another cross-compile toolchain installed, as it might conflict.
 
I did the following procedure to double check

root@ubuntu:/home/ubuntu/asuswrt/release/src-rt# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/brcm/hndtools-mipsel-linux/bin:/opt/brcm/hndtools-mipsel-uclibc/bin

it seems that PATH variable is correct

root@ubuntu:/home/ubuntu/asuswrt/release/src-rt# cd /opt
root@ubuntu:/opt# ls
brcm buildroot-gcc342
root@ubuntu:/opt# cd brcm
root@ubuntu:/opt/brcm# ls -l /opt/brcm/hndtools-mipsel-linux/bin/ | wc -l
57

it seems that symbolic link is ok.

weird
 
You might be missing some 32-bit version of system libraries if you are running on a 64-bit system. Check the Wiki I linked earlier, the author of the Ubuntu tutorial posted an actual apt-get line with all the required packages. Try re-running it in case you might be missing some of the 32-bit packages it install and that weren't in the Asus's README.
 
I switched to ubuntu 32 bit and I can compile now.

I am getting a lot of warnings. Is this normal?

For example,
btnsetup.c:1465: warning: unused variable 'from_addr'
btnsetup.c:1464: warning: unused variable 'pdubuf'
btnsetup.c:1463: warning: unused variable 'hdr'
btnsetup.c:1462: warning: unused variable 'fromlen'
btnsetup.c:1461: warning: unused variable 'iRcv'
btnsetup.c:1461: warning: unused variable 'iCount'
btnsetup.c:1461: warning: unused variable 'iRes'
btnsetup.c:1461: warning: unused variable 'iLen'
btnsetup.c:1460: warning: unused variable 'phdr'

qos.c:243: warning: zero-length printf format string
qos.c:243: warning: zero-length printf format string
qos.c:268: warning: zero-length printf format string
qos.c:268: warning: zero-length printf format string

udhcpc.c:750: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
udhcpc.c:750: warning: format '%d' expects type 'int', but argument 5 has type 'long unsigned int'
udhcpc.c:750: warning: format '%d' expects type 'int', but argument 6 has type 'long unsigned int'
udhcpc.c:750: warning: format '%d' expects type 'int', but argument 9 has type 'long unsigned int'

mssl.c: In function '_ssl_fopen':
mssl.c:216: warning: too many arguments for format
mssl.c:152: warning: unused variable 'buf'
mssl.c: In function 'mssl_init':
mssl.c:237: warning: unused variable 'r'

usbsock.c:1110: warning: integer constant is too large for 'long' type
usbsock.c:1111: warning: integer constant is too large for 'long' type
usbsock.c:1164: warning: integer constant is too large for 'long' type
usbsock.c:1165: warning: integer constant is too large for 'long' type
usbsock.c:1527: warning: integer constant is too large for 'long' type
usbsock.c:1528: warning: integer constant is too large for 'long' type
usbsock.c:1555: warning: integer constant is too large for 'long' type
usbsock.c:1556: warning: integer constant is too large for 'long' type

And much much more, seems bad coding to me
 
Those are simply what they claim: warnings. GCC can be anal at times while compiling, and will report the slightest warning. The same can be seen from almost every program - sometimes it depends on the platform on which you are compiling.
 
Wish me Luck.
I will try to compile from Git.
Its just for practice at the beginning.

I am planning to release a FW based on Tomato (Tomato Xtreme) and add OPTWARE section on it.

optxtreme.png


On this new Optware menu you can Install - Uninstall - Update - Trace - Start - Stop - Restart any Optware you want, easy -fast , using the same Web Interface of FW..

This Project started 2 years ago but i was too lazy to complete it....

The next step will be the ASUSWRT-Xtreme.... :)
 
Last edited:
Very nice to have it inside your program. Choose right Shibby or Toastman build to build from. That is most up to date.

octopus :)
 
Those are simply what they claim: warnings. GCC can be anal at times while compiling, and will report the slightest warning. The same can be seen from almost every program - sometimes it depends on the platform on which you are compiling.

Do those unused variables waste memory? And I have no idea why they would want zero-length printf format string. I remember in school when I have to write in C, I would have to fix all warnings(with -Wall).
 
Do those unused variables waste memory? And I have no idea why they would want zero-length printf format string. I remember in school when I have to write in C, I would have to fix all warnings(with -Wall).

No idea - not exactly an expert on gcc.
 
I didnt notice that it actually failed compiling after an hour or more.

I got this error. Is it because I am missing some libraries?

make[7]: *** No rule to make target `mod_smbdav.c', needed by `mod_smbdav_la-mod_smbdav.lo'. Stop.
make[7]: Leaving directory `/home/ubuntu/asuswrt/release/src/router/lighttpd-1.4.29/src'
make[6]: *** [all] Error 2
make[6]: Leaving directory `/home/ubuntu/asuswrt/release/src/router/lighttpd-1.4.29/src'
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory `/home/ubuntu/asuswrt/release/src/router/lighttpd-1.4.29'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/home/ubuntu/asuswrt/release/src/router/lighttpd-1.4.29'
make[3]: *** [lighttpd-1.4.29] Error 2
make[3]: Leaving directory `/home/ubuntu/asuswrt/release/src/router'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/ubuntu/asuswrt/release/src-rt'
make[1]: *** [bin] Error 2
 
You may have to "make clean" to get some bits to compile cleanly, to force them to reconfigure?

Lots of compiler warnings are common, "unused variable" or even whole function sholdn't have any impact on final binary - should be removed by "stripping" even if not optimized out by compiler. Agree it is not good practice and code should be fixed, so you can tell that if new warnings are a result of something done wrong, but life is too short!

The warnings that suggest long integers being used ring alarm bells - is your path correct so the correct compiler is being used?

I usually manage to get everything to compile in 64 bit, and I now never compile as 'root' BTDTGTTS - real desktop PC doesn't like router mipsel binaries installed.... I do remember problems with the shell bash or dash on Ubuntu, things seemed easier on Mint (Debian edition)
 
Last edited:
I didnt notice that it actually failed compiling after an hour or more.

I got this error. Is it because I am missing some libraries?

make[7]: *** No rule to make target `mod_smbdav.c', needed by `mod_smbdav_la-mod_smbdav.lo'. Stop.
make[7]: Leaving directory `/home/ubuntu/asuswrt/release/src/router/lighttpd-1.4.29/src'
make[6]: *** [all] Error 2
make[6]: Leaving directory `/home/ubuntu/asuswrt/release/src/router/lighttpd-1.4.29/src'
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory `/home/ubuntu/asuswrt/release/src/router/lighttpd-1.4.29'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/home/ubuntu/asuswrt/release/src/router/lighttpd-1.4.29'
make[3]: *** [lighttpd-1.4.29] Error 2
make[3]: Leaving directory `/home/ubuntu/asuswrt/release/src/router'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/ubuntu/asuswrt/release/src-rt'
make[1]: *** [bin] Error 2

Did you ever get past this error? I tried compiling on Ubuntu x64 12.04.1 under VirtualBox 4.2.6 and got the same error. I made a fresh VM install, did all the updates and then installed VirtualBox additions. Followed and refollwed the instructions in the 3.0.0.4.260 GPL release readme to the letter.
 

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!
Top