Linksys WRT54GS v4.0
From DD-WRT Wiki
 How To Flash
This is the process I developed based on comments left below. I was unsuccessful in flashing the router directly to the standard dd-wrt firmware, as some of the comments state is possible. I decided to err on the side of caution; I don't know if all of the resets are necessary.
Please, if this is the first time you're flashing a router with dd-wrt, read up on the basics before starting this process. You will avoid yourself a world of annoyance as a result.
1) Upgrade the router to the latest Linksys firmware (version 1.06.3). This can be obtained from the manufacturer's website.
2) Perform a hard (30-30-30) reset.
3) Flash router with the dd-wrt.v23_mini_wrt54gsv4.bin firmware. I got this from the dd-wrt download page (click on stable->dd-wrt.v23->mini).
4) Wait 5 minutes. Perform another hard reset.
6) You are now able to upgrade to the latest version of dd-wrt (at this time, v.24_SP1). I flashed with the std_generic firmware from the download page (under v24-sp1->Consumer->Linksys->WRT54GS_v4).
7) Wait 5 minutes and then a third hard reset.
8) Wait for the router to reboot, then profit!
 Other Notes
The stock firmware from Linksys on the WRT54GS v4 won't accept a firmware image over 3MB in size (you will get the error: "Upgrade are failed!"(sic) if you try) so you will need to flash the mini version of DD-WRT onto the router BEFORE flashing the std or voip versions. (Remember to hold reset button for 30 sec after flashing mini version.)
[Comment added 10/07/07 by gatorback] V24 mini would not load: V23 mini wrt54gsv4.bin would load. After this success, V24 VPN generic (9/13/07) loaded successfully. Based on observations below, I recommend loading V23_mini_wrt54gsv4 first before loading the final target firmware.
[Comment added 11/01/06 by bigbloke of cownet.org] Today I purchased a 'GS V4 not having read this note previously. It flashed V23 standard perfectly first time from the specific file (dd-wrt.v23_wrt54gsv4.bin) therefore there may be some additional factors influencing this) - I hope this is useful feedback
[Comment added 12/01/06 by Mart] I just purchased a GS V4 too. After reading bigbloke's note, i decided to try skip the warning and directly flash V23 VPN from the (dd-wrt.v23_vpn_generic.bin) file without any problems too. I simply followed the "right way to flash" instructions step by step. Looks like the warning mentioned above does not apply with this version.
[Comment added 18/01/06 by Macks] I can second the above, just flashed a GSv4 from Linksys original and used dd-wrt.v23_vpn_wrt54gsv4.bin without problems, directly without going via the mini.
[Comment added 22/01/06 by JD] I can confirm the statement from Macks. Two days ago I bought also a 'GS v4' and I flashed it with the v23 standard without problems (directly without going via the mini)
[Comment added 19/02/06 by markusk] and i did it that way as well and after that got the weirdest behaviour of a router i've ever seen, mainly giving something like unstable wan-connection by going with high traffic over the router (be it via bittorrent, icq-filetransfers and similar).. unfortunately reflashing with mini and then a "big" one didn't help at all..
[Comment added 28/02/06 by mfb] Like Macks I flashed my 'GS v4' with v23 vpn direct, without mini first - working fine, no problems.
[Comment added 09/04/06 by zonk] I also can confirm the above statements of flashing two fresh bought WRT54GS v4 routers using the vpn version (v23) instead of the mini version. I used Firefox 1.5 and Opera 7.5 without any failed message. Both routers run stable.
[Comment added 04/06/06 by Yusuf Motiwala] I too can confirm that it can be upgraded directly to standard version. Even after reading this, I experimented upgrading my WRT54GSv4 directly with v23 SP1 standard image without any problem. May be stated limitation is firmware version dependent. At the time of upgrade, my linksys stock firmware version was 1.5.2.
[Comment added 13/09/07 by [hajj_3] DO NOT PUT FULL VERSION ON FIRST, i just did that and now my router is bricked:( make sure you do mini first guys!