Notis

onsdag 28 september 2011

Linksys WRT54GL with SD-card

A guide of how to add a SD-card to your WRT54GL router and use it as root filesystem.

Add the card

I use a A-Data 2GB sd-card (cost me 59 sek 2010-10-21) and it works good, write speed about 600kb/s.
This is how the card should be wired:
source: http://www.adamkowalewski.com/linksys-wrt54gl/wrt54gl-sd-mod.html (404'ed last i checked: 2011-09-28)
I wont go into details about the soldering, for info about that i recommend to search around in forums and wikies in the WRT-community, if someone want to add that part to this guide your very welcome!

If it's somehing like "mmc_init got error calling mmc_card_init" then it probably short circuit or bad contact with the SD-card

Use the card as root filesystem

I have tested a lot of guides and failed on them till i found this old wiki: http://oldwiki.openwrt.org/OpenWrtDocs(2f)KamikazeConfiguration(2f)BootFromExternalMediaHowTo.html (does not exist last i checked: 2011-09-28)
But i needed to do some changes and ugly hack to make it work
First, if you haven't created a ext2-partition on your SD-card you should now, I don't recommend doing it on the router, I failed when doing it but I think it was because i forgot to write 0x9c to /proc/diag/gpiomask
Use fdisk to create a partition if you don't got one already, then create the filesystem, this is how to do it:

fdisk /dev/mmc/disc0/disc
mkfs.ext2 /dev/mmc/disc0/part1
mount /dev/mmc/disc0/part1 /mnt # mounting it to check if it works