PDA

Bekijk de volledige versie : How to build Oleg's latest custom firmware?



andy
23-05-2004, 16:01
Hi, first I want to thank Oleg, Technik and Antiloop for all the work already done on the WL-500g.

OK, I have bought one, reflashed it with Oleg's 1.7.5.6-3 firmware, it works great. Thanks! :) I am booting from a USB key, it's working great.

What I am trying to do now on my Linux Mandrake 10.0 box is to setup the toolchain to build new firmware.

So I have downloaded the ASUS GPL package and installed it following the instructions, and it compiles a new firmware image, OK.

So now how do I use Oleg's latest sources to build a new custom firmware? BTW I have applied Oleg's patch to the kernel in the ASUS package, but how do I install the rest?

I have found Oleg's previous instructions for the 1.6.xx ASUS firmware but if I understand it correctly Oleg's work now allows one to rebuild the entire firmware.

Any help from you guys will be greatly appreciated. :)

Oleg
23-05-2004, 17:19
Decompress it and type make. If everything is ok the build process will be completed in several minutes saying "You can now try your new firmware linux.trx ... bla-bla-bla".

But if you need to change modules/kernel this is something tricky - you need to compile them separately and copy to the directory with my sources. So full build looks like this:

decompress ASUS sources
patch ASUS kernel with the 1.7.5.6-1 kernel patch (to add the et modules support)
patch the same source tree with 1.7.5.6-3 kernel patch (to add all the remaining stuff)
execute "make mrproper" in the kernel tree
copy .config file from my sources
execute "make oldconfig" or "make menuconfig"
once configured type "make bzImage modules modules_install DEPMOD=true"
once completed mips modules will be in the /lib/modules/2.4.20 (so if you've something in this directory it will be lost..)
copy modules to "extra" directory in my sources (check to see it's layout)
copy arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz to the piggy.gz in build directory
once you've completed type make in my dir

Regards,
Oleg.

andy
24-05-2004, 01:30
Hi Oleg,

Thanks a lot for the help, your clear explanations are very useful.

I plan to try to compile kernel 2.4.21, 2.4.22 and so on until 2.4.26.

Also I would like to use the latest uClibc, binutils and gcc for the cross toolchain, but that's for later on.

My first cross-building test will be a classic "hello, world!" program.

I'll inform on my progress in the forum.
:)

Oleg
24-05-2004, 09:07
Hi Oleg,

Thanks a lot for the help, your clear explanations are very useful.

I plan to try to compile kernel 2.4.21, 2.4.22 and so on until 2.4.26.

Also I would like to use the latest uClibc, binutils and gcc for the cross toolchain, but that's for later on.

My first cross-building test will be a classic "hello, world!" program.

I'll inform on my progress in the forum.
:)
In fact broadcom 2.4.20 kernel is heavily patched version and includes features from the 2.4.2x

gryle
17-06-2004, 12:25
Hi

I don't know if it's just me, but when running make after untaring Oleg source code gives me an error about a missing zlib.h when compiling squashfs-tools.
That's because the mips cross compiler is being used to compile squashfs-tools.
doing:

cd build/squashfs/squashfs-tools ; make

will compile squashfs-tools with the native compiler and returning to the untared sources directory and running make sucefully builds the firmware image.

I'm recompiling the firmware because I want to try changing the firewall (to shorewall maybe) because the asus firewall setup script sucks and also because I needed to apply a patch to usb-storage to get support for my CF/smartmedia cardreader (it's available in http://www.phonk.net/Gedachten/cfreader)

Oleg
17-06-2004, 12:30
Squashfs tools are compiled with native compiler. And this works for me. Seems your build environment is something broken.

jcw@equi4.com
17-06-2004, 15:40
Using Gentoo Linux, I get the same error as gryle: zlib.h not found. And "cd build/squashfs/squashfs-tools ; make" does indeed resolve it.

Next error is "ldconfig" not found, solved by adding /sbin to PATH.

Next error was "trx" not found, solved by adding ".../WL500gb_1.7.5.6_GPL/release/tools" to PATH, which is where I downloaded the ASUS stuff.

Success!

(Now if only I had a WL-500g box... am just exploring for now)

Oleg
17-06-2004, 15:43
You need to be root to build the firmware (in this case ldconfig should be in path). If it's not, then your distro is stange enough. :) As for trx, it's better to copy it to the /usr/local/bin.

jcw@equi4.com
17-06-2004, 16:00
Hi - I prefer to build most software without root privileges. Yes, the ldconfig issue is clearly caused by /sbin not being in the path (it is when I'm root). But as you can see, your setup is almost ready for use as non-root, if you change "ldconfig" to /sbin/ldconfig it would "just work".

I'm not sure what causes the gcc mixup failure for squashfs, "which gcc" gives me "/usr/bin/gcc" as expected. Could it be a make version difference? In your Makefile, you do "CC=mipsel-uclibc-gcc", and then "make -C $(TOP)/squashfs/squashfs-tools". Could it be that the CC gets exported? Gentoo has gnu make 3.80.

Thanks for creating a such a terrific build setup, btw.

jcw
17-06-2004, 16:10
Silly browser, user name fixed now.

Oleg
17-06-2004, 16:14
The problem is that cramfs/squashfs packers will put UIDs/GUIDs as is, i.e. files, which should be owned by root will be in fact owned by other user, so firmware scripts could fail.

Oleg
17-06-2004, 16:17
As for build. I've used RH9, Fedora Core 1, Fedora Core 2 boxes for builds all went fine. Currently my FC2 has make 3.80 and everything work as expected. It should not export CC if it does not specified...

cdmp
22-06-2004, 22:36
...
But if you need to change modules/kernel this is something tricky - you need to compile them separately and copy to the directory with my sources. So full build looks like this:
[list]
decompress ASUS sources
patch ASUS kernel with the 1.7.5.6-1 kernel patch (to add the et modules support)
patch the same source tree with 1.7.5.6-3 kernel patch (to add all the remaining stuff)
...
Regards,
Oleg.

Hi Oleg, I've compiled OpenVPN for this great piece of hardware, but have problems with tun/tap device: maybe in your kernel this module was not present.

I have compiled tun from ASUS original sources (as a module) and it is loadable w/o problems ('insmod tun.o' seems ok) but OpenVPN fails trying to use it.

So I will try to rebuild the kernel (and the firmware).

ASUS's sources 1.7.5.6 can't be compiled due to lack of 'et' directory in source tree: where can I find the patches 1.7.5.6-1 & -3 to fix it?

Dave, Italy

lexi
28-06-2004, 20:32
I'm searching these patches too. Oleg can you please post a link?

Oleg
28-06-2004, 20:44
http://wl500g.dyndns.org/index1756.html contains everything

lexi
28-06-2004, 22:01
Sorry for beeing blind, should have seen the patches before...