Most of this manual, or similar, can be found from OpenWRT, DD-WRT or Tomato sites. This manual is more like a statement that at least Tomato works on this box and a collection of information that I found useful. REMEMBER! do this on your own risk, because this can result into a bricked box.
The box itself is interesting. When I bought the device the packaging stated that the device is Buffalo Airstation Turbo G 125* or something of that sort. The serial stickers say the device is WHR-G54S-2 or if you are reading the other sticker on the box it says that the device is WHR-G54S-EU. The serial is starting with 8407...
Download Tomato_1_21.7z or newer from the Tomato website. Unpack the firmware to a folder of your choosing. Install tftp package on your machine with command "sudo aptitude install tftp". Now you have all the necessary binaries and programs to flash the device.
By default the box seems to listen to 192.169.11.1 for few seconds in the start of the boot sequence. This is usefull if something goes wrong you can try to reset the device and try to tftp the firmware to the box as normal. Connect your machine directly to the switch of the device. Some web sites state that the slots 3 and 4 are best but for me the slot 1 worked as well as the others. If you are flashing a "virgin" box your machine should get address from the box otherwise you may have to manually assign address to your machine (use something like 192.168.11.161/24).
You need to know about the reset sequence of the box. Take the box detach it from the power. Press and hold the reset/init button. In this state you can start the tftp put and put the power plug back while holding the init button pressed. After the box gets power and the red light in front of the device is flashing you can release the init button. The tftp instructions are below.
tftp 192.168.11.1 tftp> binary tftp> trace tftp> rexmt 1 tftp> timeout 60 ... wait and do the reset sequence start the put operation ... tftp> put tomato.trx
Repeat the last command and the reset again if necessary. Tftp says transfer timeouts, on success tftp says how many bytes it transfered and in how many seconds. This is pretty straight forward. I noticed that the reset/init of the box can be simplified. simply push the init button and hold it until the red light in front of the box flashes and start the put operation and release the init button. After a successful tftp transfer power cycle the device and Tomato should be ready and waiting.
Also tried with OpenWRTs White Russian and it seemed to work as well. The instructions are the same except the put operations filename is different. Just remember that OpenWRT listens in 192.168.1.1 in port 23 for telnet connections and you need to configure it a bit more to get everything working, like the wireless.
All of these manuals/tutorials are provided as is. They worked for me and that is all the help I give with them, so if I forgot something or there is a typo you can inform me but do not expect me to solve your problems :) Oh and almost forgot, use them at your own risk.