Getting the RT3070 USB wifi adapter working in linux

Ralink must be one of the shittiest Linux supported network cards ever. I have a friend who’s not so good on computers, to the point where after reinstalling every  week for 3 weeks i suggested linux.

That sure saved me a lot of long drives to fix whatever went one, i could fix it with SSH. This has worked out great for both of us, especially since i moved 200 km away. She began on linux and is used to how it works, she loved it when we moved to ubuntu and she could install and remove things herself, and run updates.

Anyway, i digress, shes moving house on the coming weekend, and has a few coins leftover, and she wants to move to a wireless network. I thought “great! Linux support for most usb wifi isn’t too shabby, ill get something that works ‘out of the box’ if i can”. I went to ascent.co.nz and found this cheap card that said ‘Linux Compatible”. Well, I guess it was hoping for too much , but wasn’t expecting the problems i had.

The drivers on the cd wouldn’t compile because of the age/code/dependencies. I went to the ralink website and downloaded the latest drivers ( DPO_RT3070_LinuxSTA_V2.3.0.2_20100412 ). I ran into problems right away compiling for various reasons. Eventually i followed the following recipe to get this going.

unpackage it ;

cd DPO_RT3070_LinuxSTA_V2.3.0.2_20100412/
vi os/linux/usb_main_dev.c

Look for the following line
MODULE_DESCRIPTION(“RT2870 Wireless Lan Linux Driver”);
And add this one below it
MODULE_LICENSE(“GPL”);

Exit the editor, then do the following

sudo make
sudo cp RT2870STACard.dat RT3070STACard.dat
sudo cp RT2870STA.dat RT3070STA.dat
sudo make install
cd /etc/Wireless/
sudo ln -s RT3070STA RT2870STA
cd RT3070STA
sudo ln -s RT3070STA.dat RT2870STA.dat
sudo modprobe rt3070sta

if that works, throw the module in /etc/modules  (just the name rt3070sta ) so it loads on boot.

Now the key to all this is that ralink are cheap. They give a chip a new name, even though its clearly the same as previous ones. They do a quick run over the code to change all instances of 2870 to 3070 and of course forget half them, this is why there are odd cp’s and having to link thinks to work.

It seems that debian based distros like/need the GNU in the file, which seems to have been moved into another file in these drivers and its not registering. By adding it in it will load and work.

Let me know if this has helped you 🙂

Refs : http://www.linuxforums.org/forum/wireless-internet/161550-rt3070sta-module-license-unspecified-taints-kernel-solved.html

Chrome OS install, hints and tips & my first experience

Horay! Chrome OS is out at http://www.chromium.org/
You can preview it a bit here http://www.engadget.com/2009/11/19/googles-chrome-os-revealed/

First you need to go to install all the pre-requisites to compile it on your Linux system listed here http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites – OR
If you run ubuntu just do this
wget http://src.chromium.org/svn/trunk/src/build/install-build-deps.sh
sh install-build-deps.sh (hit Y near the end when it wants to install binutils-gold ok?)

Download the tar.gz from here http://build.chromium.org/buildbot/archives/chromiumos-0.4.22.8.tar.gz
Or grab the git repo

sudo apt-get install git-core
mkdir [chromiumos]
cd [chromiumos]
gclient config http://src.chromium.org/git/chromiumos.git
gclient sync

Note: This process may appear to hang while downloading the kernel source. It may take anywhere up to 10-20 minutes before you get more feedback

Follow the build instructions here http://sites.google.com/a/chromium.org/dev/chromium-os/building-chromium-os/build-instructions.

Once its booted up and running, you will realize very quickly its just a bootable web browser. There’s nothing else installed or to install. No logout button, no shutdown, no nothing.
If you are cunning like me and want to play then nothing like a ctl+alt+t to bring up a terminal then use your sudo to get root access. (no tutorials on this, if you dont know the power of sudo you shouldn’t be messing with things!)

First thing i noticed was that the main root file system was mounted what seems to be read-only. This i can only presume is for speed (and it is blimmin fast!) amoung other things.

The home directory was mounted read-write however to allow for downloading etc.
Package management or editing system files is impossible without remounting the root filesystem as read-write
mount -o remount,rw /

It appears to be based on Ubuntu, and its so cut down nothing much is installed. However in saying this, its still 589MB on disk when installed, which considering the fact that its not actually running anything other than a web browser, that’s pretty shocking. I can get a full debian install with xwindows and basic apps in that size fairly easily. Perhaps they havn’t had time to strip more garbage from it yet?
I noticed when its running that its using 653MB of my 1GB RAM, and has no swap at all. I presume its entirely running in RAM which contributes to its speed.

Catch 22, ChromeOS uses your google user/pass to login, if you use this then it will automatically log you in to your google acct at the same time, however, Wireless networking doesn’t come up until you are logged in (WPA key) .

I decided I wanted to add another offline user, so i did. My default username/password was chronos/chronos and i didn’t want that (yes downloaded a precompiled image). I added myself a user, then added my user to the admin,video,etc groups identical to the main user. I was still not able to login using this user which sucked, so i copied the homedir over from the first user to the second.

Still no go, so i checked in /etc for hard coded user names and found a few
/etc/security/pam_mount.conf.xml had the homedir to be mounted hard coded into it
/etc/init.d/start_login.sh has export USER=firstusername
/etc/init.d/session_manager.sh has su firstusername -c “/etc/init.d/start_login.sh ${MCOOKIE}”
/etc/acpi/lid.sh has export HOME=/home/firstusername

I edited all these to point to the new username, also copied the firstusername to secondusername homedir, chown’d all the files and grep -r’d and changed all instances of username hard coding.

Whilst editing these files i noticed that the pam_mount.conf contained information for mounting the home directory as an encrypted area.
I rebooted and hoped like heck after editing it would all go well. I should mention here that I’m using my 701 EEE PC laptop here, its a great test bed for lots of things.

After reboot i was still unable to login as the new user, so i checked directories other than /etc and found /usr/lib/chomeos-cryptohome/common

At this point, im tired, its late on a sunday evening and i never quiet got it the other user going. Since i need that offline user account to login before my WPA key/WIFI works, i will pursue this one further, for now im heading to bed (may update post later)