2006/12/12

Wireless router project w/Linux.

I wrote this up several months ago, but never finished it. The project ended up being a bit of a bear; I never completed it because the problem I was trying to solve went away through other means. Still, it's a good start and look at getting Linux running fom the perspective of a Windows guy with only a little Linux experience.

-----------------

I've been working on setting up a wireless router which will route a wireless signal back to some ethernet clients (backwards to the way most people consider normal). Working with what I have has been quite a challenge.

I started out using an IBM Thinkpad T21 with some issues as my platform. My goal was to use an Intel 2100 MiniPCI as my wireless card and an old 3Com 10Mbps PCMCIA card for my clients. As an alternate plan, I lined up a standard Intel Pro/100+ MiniPCI and an old Lucent WaveLAN PCMCIA card.

For software, I originally thought I'd use a Linux CD distribution, but some research into my options didn't leave me terribly impressed. I could always do something with Windows, which would be the easiest, if not the most satisfying option.

There's been a bit of work recently in distributions that will fit into small spaces, such as compact flash. A lot of this work has been focused on an embedded platform called (http://www.soekris.com/). One distribution designed for these boards (but apparently works with just about any x86 box) is Pyramid. Pyramid is based on Ubuntu Linux. I started trying to get Pyramid going, but after a day's work figuring out how to get the IMG file onto my HDD and get it to boot, I realized that they haven't enabled PCMCIA yet. Pyramid is still in beta.

I then moved to Pebble Linux, based on Debian, which is the predecessor to Pyramid. It has PCMCIA support and decent hardware support, from what I've read.

I hooked my laptop's 4GB hard drive to my SUSE 10.1 workstation via a USB adapter and opened up a terminal session as root. I used cfdisk to clear the partitions, create a new partition, and make it bootable. Then, I did mke2fs to format the parition.

At this point, I downloaded and extracted the Pebble v42 tarball. The tarball is essentially like a zip file in windows, but keeps a lot more attributes intact. I extracted the tarball to a directory off of my home directory, and was somewhat concerned to see an error popup multiple times:

tar: : Cannot mknod: Operation not permitted.

As I found out later, mknod allows you to create special folders, like /dev/hda. Not realizing this, I ignored the error and continued on. Still as root, I attempted to run the pebble.update script, which is used to copy and configure Linux on the target partition. I then got the following error:

cp: setting attributes for 'filename': Operation not supported

Followed by:

Failed to install Pebble Linux onto /media/disk.

Poop.

I checked /media/disk (which is where my Hard Drive on /dev/sda1, the USB adapter, was mounted). It seemed like all the files were there. I started hacking on the script to bypass the errors, but it just went from bad to worse. I screwed with permissions, ownership, and all kinds of stuff before throwing my hands up in frustration.

I threw the drive into the laptop, plugged into the network, and booted off of a DamnSmallLinux CD. I erased all the data off of the drive, redownloaded the Pebble v42 install to the RAMdisk and extracted it. Without error. I then ran the pebble.update file. Without error. Now we're getting somewhere! DSL is a Debian-based distribution, too, which might explain why it worked without a hitch, unlike SUSE.

I popped the DSL disc, rebooted, and was greeted by a friendly ISOLINUX notice as the system booted. It looked like standard Linuxie stuff, but I watched as the text flew by. ETH0 and the wireless connection were not detected. Startup continued, then the login prompt, then a bunch of gibberish about no.cat.auth and Windows Update. I'm really not sure what Windows Update has to do with anything...

I powered down and switched to my alternate configuration with the MiniPCI LAN card and PCMCIA wireless card and rebooted. Same thing. Back to the net...

It turns out that in Linux you use something called modules to load drivers into the kernel at boot time. There's a file, /etc/modules that lists the modules that are enabled. I edited it to include the eepro100 module and attempted to add "wlan.o", thinking that was probably the wavelan driver. I rebooted and saw in the boot process that the internal NIC appeared to be detected, but still no love from the wireless card. I looked back at /etc/modules and realized that none of them had the .o after the name except the one I added. Whoops. Removed the .o and rebooted. Still no good.

Long story short (too late!), I found that this system uses orinoco_cs instead of wavelan_cs. Set that module up, added the PCMCIA modules, and rebooted. I still don't think I'm getting anywhere. I commented a few lines out of inittab and now get to a login prompt, but the keyboard was unresponsive.

I did a few more reboots to try to make some sense out of what was up. Then I noticed it. I had ETH0 and ETH1! My wireless card was loaded, just not as WLAN0! I went and edited /etc/network/interfaces and set ETH1 to DHCP and ETH0 to static at 192.168.90.1. I rebooted...

Now that the wlan0 errors are out of the way, I was able to see more of the boot process.

I'm not sure that I'm going to end up finishing this project since my need has gone away, but it was certainly a good learning experience!

References:
http://www-128.ibm.com/developerworks/library/l-wap.html?ca=dnt-429
http://www.nycwireless.net/tiki-index.php?page=PebbleLinux
http://www.nycwireless.net/pebble
Damn Small Linux.

0 Comments:

Post a Comment

<< Home