This article details the process of building the stock firmware for the SMCWAPS-G from the sources on Ubuntu Hardy (8.04.1.) The SMC SMCWAPS-G is on one hand an 802.11g access point with two USB2 ports and a 2.5" form factor ATA/IDE connector, and on the other a small and extremely low power consumption x86-compatible linux-based server with the same. While the included GPL compliance CD is relatively worthless to the casual user, the company does make the same content available in a more useful form for free download via their web site. This article explains how I built the sources; Read my review of the SMCWAPS-G for more information on the device in general.
I am performing this build on my early-model Compaq nw9440, which has a Core Duo and not a Core 2 Duo, thus has only 32 bit capability and not 64. I intend to repeat the process under amd64 in the future; in theory this should be fairly trivial as the build package includes a cross-compiler, which I used. I hope a future guide will include the process of building a working firmware with a 2.6 kernel, and without the included cross-compiler. This compiler, by the way, is simply an i386 compiler (gcc 3.3.6) built for i386.
Rationale
The reason for wanting to hack this device is simple. At the moment there is probably no other device with the same price-performance ratio. I have it running on a ZIP power supply right now, which provides 5 volts at 1 amp. I should probably record the actual power draw sometime, which I can probably do for ages even on my cheap meter. Naturally, you will have to add the draw of your storage device to the total, but you could actually achieve a good amount of storage on the device with nothing but a pair of 32GB USB2 keys. Just make sure they're very, very narrow, because the ports are right next to each other. The point is that this is basically a 486, with 32 MB of RAM!
Just to put this in perspective, I used to operate a system which provided a website at www.circus.com. We had a class C allocated to us, because our access was provided by scruz.net, which had scored themselves a very tasty class B-sized chunk of address space "back in the olden days" and because of a variety of personal relationships involved. This was at least the second system to host the site; because I was the most Unix-friendly person in the household I took the task of making things go. Because I had never seen an x86 BSD system at that point (although I did have my own Sun 4/260) I went with Linux, with which I had former experience in the form of Slackware 2.0.
The "old" system was a NeXT Turbo '040 Slab; the new one a Compaq 486 with 16 megs of RAM and about 500 megabytes of IDE disk, maybe 1.2 gigabytes at the outside. It didn't matter back then; Slackware would fit into around a hundred megabytes with a decent selection of software. We had a SLIP and later a CSLIP connection to scruz.net, with Hayes Accura 28.8kbps modems at each end of our dedicated POTS lines... with our class C. :) Here's the really fun part: This system ran apache, sendmail, netatalk, samba, and a variety of other services including nfs, bind (we hosted our own name resolution) and ftp. You could have four or five users logged in using the forums (some fairly local software) or playing nethack or reading their email and everything would tick along nicely. Eventually I even made this system a netboot host for a Sun SLC (using Xkernel) and ran netscape and xterms on it in addition to everything else. This cute little $40 box from SMC has twice as much memory, and people throw away 500 MB laptop hard drives every day. Meanwhile, the device uses less power than the hard disk that was in that server.
Getting the build system working is the first step towards being able to use the SMCWAPS-G as a low-power, general-purpose server device.
The Build System
The build system provided from SMC includes a toolchain and the complete sources. This actually produces the complete system on the device. This includes busybox, samba, netatalk, and some other goodies. The unit has an internal serial console which is configured at 38400 bps. It uses 3.3 volt levels, so you will need a circuit which adapts this to match the capabilities of your serial port if you want to use it. Typically a cellular phone cable with a MAX232 (or similar) chip in it is adapted to the purpose.
After much thrashing around, I got the build to work. Here are some selected history entries (and other commands which might be necessary for someone else and which won't hurt, I hope. Always think before you copy and paste! I edited some of these commands! Et cetera.) A friend actually brought the source file over on a flash drive (modem, whee) and I put it on the desktop. I will warn you up front that if you are more careful about partitioning than I am with my desktop systems, you might not have room for all this stuff in your root (/) partition... which is why I don't get more complicated. Someday I will have an SSD, and then I will use the LVM and grow all partitions as I need them because the penalty for egregious seeking is far lower. Enough of this diversion: on with the history, and the future.
unzip ~/Desktop/UT_SMCWAPSG_sources.zip
cd UT_SMCWAPSG_sources/
for i in *.tgz; do tar xfz $i; done
sudo mkdir /opt
sudo mv buildroot /opt/
sudo mv i386-linux /opt/
This is all pretty much according to instructions (see UT_SMCWAPSG_sources/GPL_readme.txt) but from here there are a few things that you have to do to account for the fact that you are not running on Fedora Core 4, and have not waved a magic wand over your system either. (Even if you have, you will likely have to do some or all of the following things.) I can only imagine that some or all of the following commands will be necessary on FC4 as well, although I admit I was also tempted to just assemble an FC4 VM. I could have had my friend bring me the FC4 ISO, or even the CD (or whatever) but decided that Linux is more or less Linux. I've had good luck with a wide range of Fedora and even Red Hat RPMs for a variety of software, converted with alien. I should also apologize for not using fakeroot for this process. Sorry. Don't forget to go back and clean up after yourself later...
First, install texinfo. Then:
sudo ln -s /usr/bin/awk /bin/awk
sudo ln -s /opt/buildroot/target/device/AMD/DBAu1500/depmod.pl /sbin/depmod.old
Finally, run the following command as root. I used "sudo bash" to get a root shell, which worked fine.
PATH=/opt/i386-linux/bin:$PATH make -j2 linuxall
I specify the -j2 flag to make because I have a dual-core processor. (Some argue that one should use -j3 but I like my computer to remain responsive during this process even if I'm playing a game.) The build does not take an excessively long time, but you are build a linux kernel, samba, and a bunch of other software. You can run make with no options to get a little bit of help; you can restart the build process at a variety of points.
-rw-r--r-- 1 root root 3483418 2008-08-01 13:02 upgrade.img
Did this image actually work? I'm still trying to figure that out. So far I seem to have not bricked my system.