Silly projects: Gentoo on a WRT54GL

I have one silly project I should probably look forward to work on this weekend to vent off some steam: getting my WRT54GL router to run with Gentoo/MIPS. I know it’s probably going to fail because I know near to nothing about MIPS, I know nothing about Gentoo/MIPS, and I remember being told that the mipsel target that WRT54GL are is not well supported by Gentoo. Either way, I’m going to try.

You could probably be wondering why I would be trying something as silly as this, and the reasons are actually a bit of a series. The first problem is that I lack an IPMI agent for accessing Yamato remotely (for remote light out and other things) and I’m sure that’s going to be useful to me soonish. The second one is that I need to set up again the routing of my office with a single wireless client, instead of the current setup which I prepared last year with Yamato having a wireless card.

The problem with IPMI is that I plan on not being at home all day every day in the future; I actually hope to be able to get a driving license this year and make good use of it by finding a job out of home (especially important for my mental health lately!) and in that case I’d be likely to need a way to access Yamato remotely if it gets messed up. Having a low-power system like the WRT to work as a jump box is acceptable I’d say.

With routing, the issue is at the same time simpler and more complex. Simpler because I just need a router to route between the general wireless network (which is accessible by almost anybody) and the wired network that I use for the office and my bedroom. More complex because the original setup used the WRT54GL, then I decided to move to just a single network card, but now I’m in a setup that is quite messed up: Yamato routes all the traffic of PlayStation 3, AppleTV, and iMac, as well as the eventual computers I need to fix and other stuff like that which actually translates the whole thing into a real mess, especially because I ended up splitting the network to such extents that applying NFS ACLs simply by IP masks is impossible.

Of course I could just be using OpenWRT like I did before, but since every upgrade of OpenWRT has been a real mess to deal with (with all their changes into setup, interfaces, nvram and so on), I’m actually thinking that Gentoo would be easier to maintain for me, given I’d just have to update the image once in a blue moon hopefully. I could also just start the router through a TFTP-provide image and then leave it to be with that. At any rate, it would also be a nice experiment and a way to learn a bit more about embedded systems, so…

Right now I only found how to take it apart and I noticed that I have to solder in myself the pins for serial console access, unfortunately it’s almost 1am so soldering them in right now is out of question (I also have to find the pins, which I’m not sure I have at home, worse case scenario I’m going to desolder them from somewhere). I should probably go taking a look to whether the Linus kernel tree can boot on this thing. When I last used it, OpenWRT only supported 2.4 on it; while 2.6 was being worked on it didn’t work on this model, and the wireless network was supposed never to work on it, since it’s using the infamous Broadcom wireless chip (which nowadays might actually work out of the Linus tree via the b43 driver).

If anybody (especially the colleagues actually working on Gentoo/MIPS) have a clue about what I’m to expect out of this, I’d be quite happy to hear it, even if it’s “You’re crazy, it’s never going to work” or “Leave it alone, it’s too much hassle to bother with”.

Oh and yah, I know this thing is not powerful enough to build and it’ll have to go through cross-compiling, and cross-compiling with Portage is not nice, and all the stuff like that. I guess the point is that I intend to work a bit more on that matter, even if currently I’m not paid to do so (I was for a while some time ago). There are more than a few things that I’m interested in looking at to find a solution, actually. It’s very low priority (unless someone bribes me to pick it up) but maybe I can be of help to the broader picture somehow.

9 thoughts on “Silly projects: Gentoo on a WRT54GL

  1. That sounds like a fun project, albeit crazy. I run tomato firmware on my WRT54G, it works nicely. Looking forward to hearing your progress ;)

    Like

  2. Be sure and let us know how it goes, as I’ve been thinking about doing the exact same thing to mine.On the kernel, according to OpenWRT Kamikaze documentation (I’m presently running Kamikaze on mine), works on the WRT54GL with EITHER a 2.4 or a 2.6 kernel — it’s an install option. The caveat is the Broadcom wireless, as you mention, but even it was “sort of” working in 2.6 as of Kamikaze. However, it wasn’t yet stable on that chip and the 2.4 series kernel was therefore still recommended for anyone doing wireless. But that was several kernel releases ago, and one would hope they’ve stabilized the 2.6 wireless driver since, in which case it should be fine. But the 2.6 kernel itself, other than the wireless driver, was working just fine on the WRT54GL as of Kamikaze, so you shouldn’t have any problems at all in that regard.FWIW, I selected the image with the 2.4 kernel in ordered to get the wireless, but I’ve kept it deactivated so I would have been fine with the 2.6 kernel. I have an Acer Aspire One netbook that I’m going to be putting Gentoo on first, and that was the reason I got the wireless router instead of an Ethernet-only router to begin with, but I’ve another project I want to finish before I work on that, thus I’ve done little with the AA1, and I’ve simply kept the wireless off for security reasons as I don’t have anything else that would use it. Since I got it tho, I’ve almost decided I’ll only use it on Ethernet while at home anyway, so keeping the WRT54GL wireless off isn’t going to be a big deal anyway and next time I upgrade the router, it’ll probably be to a 2.6 kernel even if the wireless isn’t stable, for that reason.Also, regardless of whether you are going to keep using OpenWRT or not, they have links to quite a bit of hardware hacking info for the WRT54GL on their site as well, including as you mentioned a serial port, but with SD storage expansion and some other stuff as well. (They have USB info too, but I’m not sure if that’s only for other OpenWRT compatible routers that already have a USB stub-out or if it’s possible to add to the WRT54GL too. Of course, once USB can be added, it opens up ALL SORTS of other choices, more storage options without further hacking, webcam, there’s a whole list of stuff.)Meanwhile, OpenWRT is decently flexible on its own and for folks accustomed to binary distributions would probably be great. But as I started looking at hacking the firmware, groking the boot process, etc, I realized just how much work I was going to have to do to wrap my head around it if I wanted to /really/ use it, thought how much easier it’d be if it ran Gentoo which I already understand very well, and remembered that Gentoo does have a MIPS port too. I’ve not asked if anyone has tried it yet, but that was on my list to do when I decided to really get into hacking the thing, so any experience you get and as talented as you are, anything you can do to smooth the process of putting Gentoo on it for the rest of us, will CERTAINLY be appreciated. =:^)Duncan

    Like

  3. I managed to get Gentoo running on the PS2 about 3 years ago. It required a lot of horrible tweaks to get some stuff to work but I think that was mainly due to being stuck with Linux 2.4.17 and GCC 3.0.4. With the latest stuff, you should have little problem. If I managed to get Xorg 7.0 to work on it, anything is possible.

    Like

  4. This sounds awesome. This is something that has been on my whishlist for a long time. However due to the fact that the router is always used and it might take some time to finish the project, it would not make me very popular to do this right now.I hope you will keep track of your activities as some form of documentation!

    Like

  5. I managed to get OpenWRT onto my Netgear modem/router less than two weeks ago. It was a pretty traumatising experience, almost bricked it. Then I found out it didn’t include an ATM driver I needed…I’d be interested to see where this goes. Hope you have better luck than I did. :|

    Like

  6. In theory this shouldn’t be _too_ hard — I’m pretty sure OpenWRT kamikaze 8.09 is using a 2.6 Linus kernel tree and the b43 driver. I’m running it on an ASUS Wl500G (which also has broadcomm wifi, although maybe a different chipset) without any wireless issues.I learned more about firmware (de)construction via the DD-WRT project than I did via OpenWRT, too, so you may find their resources (wiki, forum) useful, especially their JTAG’ing and de-bricking instructions.I haven’t done much cross-compiling, but I do remember cross-compiling in Gentoo was easier than trying to build (for instance) a kernel package for openwrt’s cross-compile environment..It sounds like a fun project and I wish you best of luck!

    Like

  7. Sounds like fun!Be sure and let us know how it goes, as I’ve been thinking about doing the exact same thing to mine WRTG[L,S].

    Like

  8. ka boom!https://bitbucket.org/gener…Its exactly what you was looking for?ps: im looking how to setup openwrt on top of gentoo and all running on x86 (atom, hdd, etc) … should be something interesting. can we work on that together? if you interesting let me know plz. thnx.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s