During this week, I have been playing extensively with the OpenWRT whiterussian Linux distribution for embedded devices, like the Linksys WRT54G wireless routers.
My initial plan was to build a custom firmware for the Linksys WRT54G wireless router in order to enable some functionality that is disabled by default — like busybox
su applet or shadow passwords — and disable some other features that come enabled by default — like USB or PCMCIA.
I followed the instructions outlined in OpenWrt Buildroot, but had only partial success.
First, I downloaded whiterussian build sources from SVN:
$ svn co https://svn.openwrt.org/openwrt/branches/whiterussian/ $ cd whiterussian/openwrt $ make menuconfig $ make
Next, I uploaded the resulting
bin/openwrt-wrt54g-squashfs.bin image to the Linksys router:
$ scp bin/openwrt-wrt54g-squashfs.bin root@linksys:/tmp
Then flashed the new image:
$ ssh root@linksys # cd /tmp # dd if=openwrt-wrt54g-squashfs.bin of=flash.trx bs=32 skip=1 # mtd -r write flash.trx linux
mtd flashed the new image and rebooted the router — as instructed per the
-r command-line flag. I could
telnet into the Linksys box, but something strange was going on: instead of seeing a bunch of symbolic links under
/etc/init.d pointing to
/rom/etc/init.d, I only found plain text, executable script files.
While looking around, I could see the JFFS2 partition was mounted under
/jffs. I ran
firstboot by hand and that seemed to create the JFFS2 filesystem layout, which mostly consists of symbolic links to files in the SquashFS volume (mounted under
/rom). Rebooting the Linksys router left an apparently useable system that mostly looked like the normal OpenWRT whiterussian images I can download from http://downloads.openwrt.org/whiterussian/rc5/, but still not identical.
Why doing a custom build of OpenWRT produces a flash image that is different from the ones available for download from the official site, and one that fails to run
firstboot on the first run after reflashing the router’s memory?
Does anyone have dealt with building custom OpenWRT images before? And what’s more, does anyone had full success in flashing and using them?