Sunday, September 28, 2008

EEEPC: Going back to Xandros

So I have been living on the bleeding edge for a while, running the latest and greatest code that Ubuntu has to offer. That being said there are some nasty problems trying to run Ubuntu Intrepid on the eee PC 701 series. Here are the problems I had.
  • No hotkeys - None of my hotkeys worked. That means that I couldn't use the Fn+Key combos to enable/disable wireless, control volume, or suspend. Brightness hotkeys worked fine.
  • No suspend feature - What I thought was a hotkey problem was actually a suspend to disk issue. It seems that owners of the 900/901/1000 series of eee PC are not complaining. The new eeepc_laptop driver works just fine for them. But for a 701 owner, you are out of luck. From what I see, only one or two coders are looking at this under the Red Hat Linux team. Will the change make it into the Ubuntu branch any time soon? Probably not.
  • New wireless driver - The good news is that Intrepid provides the new Ath5k driver for wireless. This will replace the madwifi driver which Ubuntu use. But upon loading the OS my wireless didn't work because it was using ... an old madwifi driver. What the hell? After disabling the "vendor specific" driver and rebooting the ath5k came to life. It worked FAR better than the madwifi drivers I had been using. Now I was able to pick up distant networks, but the strength or quality was still not accurate.

Rather than continue to bitch about how this new stuff doesn't work I thought I could try the OS that this laptop shipped with. I only gave it about 10 minutes of my time when I unboxed it, and it worked just fine if I remember right. So I drug out the restore DVD and created a restore USB drive installer. Then just minutes later I was running the default OS ... an outdated copy of Xandros Linux.

There's a lot to like with this OS. It's very small providing you with lots of free space when the installation is complete. It comes with everything you need (or almost everything). The wireless driver works VERY well. Of course, all of the hotkeys work so you can suspend it and bring it out of sleep easily. It boots on a dime!

Now the complaints: it took FOREVER to update. And after I bricked it for the third time in a single day trying to install Firefox I decided to find a work-around. The eee PC (like any other Debian Linux install) stores it's downloaded .deb packages in /var/cache/apt/archives/. So I ran through the process of installing all the updates and then copied everything in /var/cache/apt/archives/ to a directory on my SD card. Then, the next time I reinstalled I just linked all those deb packages to the directory where the OS looks for them. It looked like this: ln -s /media/D:/updates/*.deb /var/cache/apt/archives/. The result is when you install an update, it's instantaneous.

Then I went to install the overclock module that I love so dearly which gives you a full 100Mhz of power on your FSB. But there was a problem ... nobody has compiled it for the Xandros installation. Long story short I found that a French fellow had provided a patch to make the code compile cleanly. I was able to compile it, and I have made it available. So if you are running Xandros, and you want the eeepc-linux module you can grab it here ...

http://www.oddree.com/rayhaque/eeepc/eeepc-linux-2.6.21.4-eeepc.tgz

I should note that I have not needed that module too much, as the Xandros install runs pretty well without it!

My only other chief complaint is that the version of Firefox which comes with Xandros is really old 2.0.1). I have found several different threads on installing Firefox on your Xandros install, the most notable being one written back when version 3 was in BETA. Typically you can just download Firefox and extract it to a directory. But that doesn't work for the eee PC because Xandros is using GTK 2.8 and Firefox 3 requres version 2.10. One solution was to install the newer GTK 2.10 library and a slew of other packages that went with it. I was a little uneasy about mixing and matching new and old libraries together. But I tried it anyway. The result was an inoperable browser and an unstable operating system. Reload!

Then I found that another user had been successful in downloading the newer libraries but not installing them. Instead he had extracted them to a directory and then modified the Firefox startup script to point to that directory. This makes far more sense to me, and I gave it a shot. In no time I was running Firefox 3.0.1 without any problems. But I was all ready out of date. The newest is 3.0.3. Good news, that worked too. I decided I would write a script to quicken the process of installation which I will share with you now:

#!/bin/bash
mkdir /home/user/firefox303
cd /home/user/firefox303
wget http://apt.linex.org/linex/gtk-2.10/libgtk2.0-0_2.10.13-2~bpo.1_i386.deb
dpkg-deb -x libgtk2.0-0_2.10.13-2~bpo.1_i386.deb gtk2-10
wget "http://download.mozilla.org/?product=firefox-3.0.3&os=linux&lang=en-US"
tar -xjf firefox-3.0.3.tar.bz2
cd /home/user/firefox303/firefox/
sed "2i\\
export LD_LIBRARY_PATH="/home/user/firefox303/gtk2-10/usr/lib"" /home/user/firefox303/firefox/firefox > /home/user/firefox303/firefox/eeefirefox
cp /home/user/firefox303/firefox/firefox-bin /home/user/firefox303/firefox/eeefirefox-bin
ln -s /home/user/firefox303/firefox/eeefirefox /home/user/runfirefox303
chmod 755 /home/user/firefox303/firefox/firefox-bin /home/user/firefox303/firefox/eeefirefox-bin /home/user/runfirefox303
wget "http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_9_linux.tar.gz"
tar -xzf install_flash_player_9_linux.tar.gz -C /home/user/firefox303/
ln -s /home/user/firefox303/install_flash_player_9_linux/libflashplayer.so /home/user/firefox303/firefox/plugins/libflashplayer.so


Here is the play-by-play. A directory is created in your home directory called firefox303. Then we download GTK version 2.10 and extract it there (NOT install it). Then we download Firefox 3.0.3 and extract it to /home/user/firefox303/firefox. Next we use 'sed' to insert a line into the script which starts Firefox. This line tells Firefox where to find the GTK library files and will prevent the error you would otherwise get. Notice that we call the new file eeefirefox. Because that file name becomes a working variable, we also need to habe "eeefirefox-bin" file which I created through a copy process (a symbolic link would have probably worked too). Next I created a symbolic link so that the user ends up with an executable script in the root of their home directory called "runfirefox303". Lastly the script grabs the latest version of Adobe Flash Player and installs it for you (because everybody needs it).

I also shared this script with the eee PC community here: http://forum.eeeuser.com/viewtopic.php?id=45742

Now you would think I would get some kudo's for my work on this project, but I've got nothing but crap from the user base. I'm not going to troll my own threads, but I will use my Blog to vent a little bit here.

Well, the other method worked fine for me! - Oh good. Because I spent several hours trying to make it and ended up reloading four times. Which is why I took the time to put this new method together. By the way, to "make it work" you totally tainted your system when you *INSTALLED* the newer GTK libraries to Xandros.
I didn't taint my system - Yes you did. When you start downloading packages that were built for a different version of Debian Linux you have tainted your install. You are driving full speed into dependency hell. Especially when you want to compile something new and you need those dev libraries.
I didn't taint anything, it still works - You tainted it. See the above.
No I didn't - Yes you did! Get out of my head!
I get a message telling me that GTK has to be 2.10 - You have to run the link that was left conveniently in your home directory. It's called runfirefox303. Vote Palin/McCain in 2008!
I have to start this from a terminal every time? - You could link a button to the startup script. It's not that difficult. Like foreign policy. Simple stuff.
Why didn't you make a package? - Because these all ready are packages, which I am hacking together to make work. I'm not going to re-package other peoples packages. I'm pretty sure that violates the terms of use from Mozilla any way.
Firefox 3.0.3 locks up! - What do I look like, the application developer? Report that shit to Mozilla. I have found some bugs too and I'm not talking about this hacked-together crap I'm pulling. It crashes in Windows too. That just gives us something to look forward to in Firefox 3.0.4! :-)

Okay, okay. That's enough user abuse for one day.

Saturday, September 13, 2008

EEE PC: Speed boost with modern kernels

If you are at all like me, you are probably not satisfied with the 70mhz "front side bus" speed of your eee PC 701 (2G/4G Surf). These has long been a module available which you can install to control the fsb speed and crank it from the default 70mhz to the full 100mhz. The difference is noticeable *immediately*. Especially of you are running Firefox with a streaming video (like YouTube clips).

Lately there has been a lot of talk about Ubuntu Intrepid. This is the next generation of Ubuntu, still currently in development. A week or so go I installed Intrepid and took it for a spin. While it seems to "work" on the eee PC there were still a few glitchy items. Such as, the Atheros WiFi nick is supported "out of the box". But for it to work, you have to disable the vendor specific driver that it chooses as a default. The new WiFi driver of choice is "ath5k". This is replacing what will soon be the deprecated madwifi driver. I must say, this new WiFi drive alone was worth the upgrade. But what about that eee.ko module for my higher bus speeds?

First, know that the code for the FSB speed boost is completely experimental. The author of the code warns that overclocking can cause undesired performance (such as freezing) and could also overheat your system. For that matter, the same code can be used to control the speed of the one and only system fan. Bottom line: do not slow it down!

You can get the code here: http://code.google.com/p/eeepc-linux/

If you are running the 2.6.27-2 kernel aka the 2.6.27-2-generic you will have issues. I did some digging and found this discussion taking place in a bug report. It seems that you can compile the module by changing all occurences of "&proc_root" with "NULL". I went through these steps and was able to compile the driver cleanly. If you would like to just download my module for the 2.6.27-2 kernel, you can grab it here. Or, to read the conversation I had with other folks in the eee User forums, you can check this out.

But then yesterday I ran an update check and saw that there was a new kernel released. I just had to have it since I am living on the bleeding edge of technology. Of course, I had some concerns about being able to compile my front side bus hack again. And as it turns out, I was justified in my paranoia. With the new kernel installed (and my 4G of flash practically gone) I was not able to compile the eee.ko module. Piss!

Now this kept me up a bit late last night, but I was able to get it to work. When compiling, I was being told that I was missing an include file called "bounds.h". It seems that this is only generated when you actually build a kernel. Now, this is usually included with your kernel-headers package because they know you need it to build a few things. Why was it left out? It must have been an oversight. After all, this is all experimental.

In an effort to generate that bounds.h file I downloaded the kernel source, ran a "make mrproper", a "make oldconfig" and then a "make". Then I made my way off to bed. When I woke up ... my build had failed because my drive was out of space. Piss! But then I found that the one file I needed had been generated. Woo-hoo!

Now, if you came here for the eee.ko module built against the 2.6.27-3 kernel, aka the 2.6.27-3-generic kernel, you can grab it here. That archive includes the bounds.h file which is only about 10 lines long. I don't think anyone else has been crazy enough to mess around in this realm, butI shared my findings with the masses here.

Links of interest on this topic:
eeepc-linux-2.6.27-2-generic.tgz
eeepc-linux-2.6.27-3-generic.tgz
An old but still very useful Blog post about this driver

Sunday, September 07, 2008

Sunday War-Sitting

You can't really call it War-Driving when you are sitting in a Lay-Z-Boy with your favorite drink (generic grape Gatorade, aka "DRANK"). So this Sunday, I bring you the first War-Driving story in many moons. Here's the setup ...

This past week I started reading about the new Ubuntu Intrepid alpha releases which among other cool improvements contains the "ath5k" driver which is built right into the latest kernel, 2.6.27 (still in development). The new breed of ath5k driver supports the Atheros card used for the Asus eee PC (horay). So I have installed the latest Xubuntu to my eee PC 2G surf and I have al ready noticed some grand improvements in my WiFi strength. While the "quality" is still not at all accurate, I am now able to connect to distant access points which wouldn't even show up in my list before. Thank you ath5k developers, for saving me from lacking madwifi support. Now on with the show.

This morning I sat down and connected to a nearby school which I had previously only explored from my bedside using "Audrey II" (my old iBook). Installing Wireshark (from their network, thank you) I revealed some interesting packets. Namely ... these right here ...

There were half a dozen packets every thirty seconds or so in broadcast form (hence the destination address ending in .255). In the data portion of the packet was "SynchronEyes". Not having any idea what this was, I did some Googling about it. It ends up that this is some software which teachers can use to set up live exams for their kids. How hard could it possibly be to find a copy of this to download and use? I Googled: intitle:"index of" synchroneyes. The to search result was someones accidental mirror of what I was after.

For this, I went back to my home network and downloaded the software. I also took a copy of that activation key text file. That will come in handy. And while I am at it, I should figure out how I am going to run Windows software on my eee PC running Xubuntu. So I went into terminal and did a "sudo apt-get install wine". Next, I ran wine against the installer.

I opted not to install the Internet Explorer toolbar, thankyouverymuch.

Hooray, ready to launch.

Uh oh, why do you need an e-mail address? I'm not giving you that.

It says that it can't connect to the Internet and my registration is no good. That's fine, because it still opens and runs. With the teacher console I made some ill attempts to start connecting to things. My first attempt was to connect to that address that I first came across sending out the broadcast packets. Still watching with Wireshark I could see that it told me to get lost in the form of a "RST" packet.

Oh wait. I think I understand it now. This is a student looking for a teacher. Let's see what my packets look like when I go searching for "a class to join".

Oops. We're all students waiting for a class I guess.

So I did the obvious thing. I made myself a class and waited for the student to join me. No dice. In Wireshark I could see that the student workstation recognized me as a teacher, but would not automatically join the class I had just created.

This little software package could be a lot of fun if I were to join it during school hours. Then I could create duplicate classes and derail students. Or perhaps I could join as a student, and begin asking insulting questions of the teacher. But then I will be at work while school is in session ruining the possibility of any fun like that.

There is still a lot of network to explore here, but I don't expect I will spend much more time on it. For one, when this particular private network ID looked familiar I did some research on what I was connecting to. It ends up that this school is managed by my old employer who performs network monitoring and security services. When I worked there, I had many conversations with the admin of this network. He is over-stretched, over-worked, and most definitely under-paid. It would be well of me to inform him that he has an unsecured wireless network here which I am sure he is not aware of.

But I will send that e-mail later. I still want to explore a bit.

Tuesday, June 17, 2008

Kismet Newcore

I was downloading and building Kismet once again today. I have done this a lot lately, because I keep blowing up my OS and having to reinstall.

I decided to go all out and install the "newcore" distribution. This version is available through svn and basically represents what the developers want. It's been built from the ground up to offer easier development, add-ons, and better configuration for the user.

I only really used it for 10 minutes or so. It works. It looks little odd. I'm not sure the graphical representation of packets is really necessary, but of course you can customize all that.



My buddy DM thought it looked a little like Atari 2600 graphics. That got me to thinking about my favorite childhood game "Adventure". That lead to a Google search where I learned that someone made a homebrew Adventure II for the Atari 5200 emulator. Just about the time I got the game to play I had to get back to work.

Also - I joined twitter as "rayhaque", so if you are a fellow twitter feel free to stalk me. I read about the service ages ago and I didn't really understand what it's for. I still don't really get it, but I expect I will figure it out soon. :-)

EEE PC - Migrating to 8.04

Being haunted with some rather odd driver issues I have been thinking about moving to Ubuntu or Xubuntu 8.04 for a good week now. Yesterday I bit the bullet knowing full well that this installation would cripple most of my drivers and leave me fumbling to restore all my broken functionality. But you know ... it wasn't *that* bad.

Creating a Live USB stick of Xubuntu 8.04
This was a bit more challenging than I had imagined. eeeXubuntu (release 3) came with this nice little shell script that does all the work of making a thumbdrive/jumpdrive into an installation source for you, so you can skip out of some lengthy tutorial steps. That script is not part of a standard Xubuntu release, so this is what I did.

1) I needed a copy of mkusbinstall.sh from the eeeXubuntu 7.10 disc. Ths involved booting it up, and copying the file onto a thumbdrive. You can also get it from here. I mirrored it for anyone else attempting this.

2) Next I downloaded and booted up Xubuntu 8.04, and inserted my thumbdrive. Then, I copied the script my thumbdrive out to my home directory.

3) Next I prepared my thumb drive again with fdisk and mkfs. This process is documented very well in this blog entry.

4) You need "syslinux" installed for this script to run. One of the magical factors of Live distributions is installing software. Open up a terminal. Go ahead and do a 'sudo apt-get install syslinux'. This will take a moment or two, and you will be done.

5) Now in your terminal, run the script you copied over earlier like this 'sudo ./mkusbinstall.sh --autodetect'. The rest should be smooth sailing as you just wait for copying to complete. You *will* get a few error messages about symbolic links. But don't mind those.

6) Boot your eee PC up to your thumbdrive and get to installing.

Keep in mind, you will need to install madwifi drivers from source to restore your wireless settings. And there are far more tweaks and hacks to fix the remaining stuff. Since I combined about three different methods myself ... I will not try to offer advice on that topic.

Check the eeeUser.com forums for more info.

Additionally, since installing the latest svn source for the madwifi driver - I am getting about 15 percent better signal quality with the built in Atheros WiFi card. It was enough boost to allow me to connect to a network up the street from my house without using any external cards or antennas. Awesome?

Friday, June 13, 2008

EEE PC - Almost Wardriving

After all my failures yesterday I came to the realization that I would have to find a plan B and execute it. An external USB WiFi adapter might be just what the doctor ordered. Luckily I have access to an entire drawer of Linksys USB WiFi adapters which are just collecting dust.

These adapters use the rt2500 chipset which is pretty well suported thanks to the efforts of this project. I plugged the card in, and it was detected. Simple, right? Well not quite.

It seems that the OS wants to load the rt2500usb driver for this card, even though the card in reality is an rt2570. That would be fine if I wanted to *use* this card to join access points and gain Internet access. But my end goal is to use this as a weapon of wardriving. For that, it did not seem to work well. I set my source in Kismet as "source=rt2500,wlancantenna" and started it up. It detects about 3 wireless devices, but cannot seem to see the high powered b/g cisco devices which are everywhere around me.



This seemed to me to be a driver issue of sorts. Heading back to the project download page I found that there was a stand-alone driver for the rt2570 chipset. I downloaded it, built the module, and installed it - all rather easily. The problem is, when I plug in the card the OS still detects it as an rt2500. This can be fixed by opening up /etc/modprobe.d/blacklist (as root) and adding "blacklist rt2500usb" to the bottom of the file. Note that if you blacklist "rt2500" you will likely end up with a non-functioning setup.

Now, with the card removed and *ALL* "rt" related modules removed - I can reinsert the card and this is the result I get.



Note that while Kismet (in the background of this shot) picks up *EVERYTHING* - the OS now doesn't know how to read the signal levels on what it has found. I'm not sure if that is really a problem. I can live with it.

I have also taken one of these cards, gutted it, and through the miracle of duct tape I have merged it with a single cable cantenna design. It's not a pretty site, but I will take pictures at some point.

My New Toy
I am a bit destracted with this little project this morning because I got a slick new toy for fathers day. It's a Garmin Nuvi 200 which is a GPS "driving assistant" (with lot's of additional toys and uses).

Last night I unboxed it, turned it on, and started immediately setting it up. Yet, everytime I got to the part where it hooks up to satelites - it shut off. It seems that they don't send these out of the factory on a full charge. Thankfully this unut can be charged from USB (unlike some of the competitive models). There is a wall charger accessory which you can buy but really don't need. It comes with a nice mounting kit for your windshield or dash, and a 12v socket adapter too.

I went online and registered my unit, and since I am entitled to a free map update I went ahead and started that up. Alas, it needed to install a browser plugin so I had to reboot into ... Windows XP. :-( I installed the plugin, it warned me that the file download could take hours, I laughed, and started it up. But then I saw that this could take hours - because the file was 2.04GB. Meanwhile Windows XP is asking (for about the fifth time) if I would like to reboot. It had to go and install a bunch of updates and it wouldn't shut the fuck up about them. Knowing that Windows will eventually reboot my PC against my will - I rebooted it myself.

But then when I tried to go through the registration and map download again it said "you all ready got your free maps - now beat it" in so many kind words. I HATE YOU WINDOWS. After some hunting around in the web site I was able to find where I could re-download the file. But when it was completed, I had to wait another 15 minutes while Windows copied 2GB from my Temporary Internet Files - to the Desktop (why do they STILL do things this way? Firefox doesn't!). At this point I was happy to reboot back into Linux where logic still prevails.

This morning I popped out the ashtray in my bug and used my tie clip to lock the GPS onto my dash. Then I drove to work. It's two miles down a straight road and I haven't gotten lost yet (not even once) - but I was itching to see how well this thing works. As I came to where the street splits in all directions it shouted "turn left in zero point one miles" and then when I hit the spot it said "turn left". Nice. Then as I cruised down the road it told me "1.7 miles remaining". As I approached the hospital I decided to throw it a curve ball and I took a sharp right to head up the back of the hospital (opposed to going to the front door lie a visitor would). The Garmin saw that I had turned off and a moment later said "recalculating!". With that, it had a new path for me (which is the way I was heading).

I must say, this is a nice little unit. It will be fun to play with this when we head out to a cabin 350 miles from here for vacation. In the mean time, I wonder if I could rig this into my laptop and use it's GPS capabilities for wardriving?

Wednesday, June 11, 2008

EEE PC - Replacing the WiFi Card

Over the weekend I went onto eBay and bought myself a Dell TrueMobile 1390 b/g wireless card for my eee PC. I am out to replace the Atheros that comes with it, which just doesn't seem to cut the mustard when it comes to wardriving. I bought the card Sunday night for $15 (shipping and all) and it was in my mailbox Tuesday morning. Thanks US Postal Service! :-)

Back at work I got out my set of screwdrivers and went to work. Installing the card was not difficult, but it was time consuming and a little tedious. As you can imagine, everything in the eee PC is small and fragile. I found this particular forum post to be most helpful in determining how to get the lid off and expose the bottom of the motherboard. With everything back together, I booted it up.

I didn't get the "blue light" on the eee PC which was a little concerning. I hadn't thought of how I would get the card to interact with the buttons or quick keys on the eee PC. Once booted I could see that I had ... no wireless card. Not that I expected the driver to load and for everything to work that simply, but it sure would have been nice.

The first thing I tried to get it working was to look for drivers to install. I ran an apt-cache bcm43xx and I found a utility of sorts which helps to load firmware onto a Broadcom card. Why would I want to play with firmware? It seems you have to. The way this card was designed you have a file available which is used to load the card every time it comes up. This is done pretty simply in Windows using Broadcom drivers. Linux it seems, is another story.

There also seems to be a newer style and older style driver. There have been two projects over the years to make these cards work. The old bcm43xx drive has been written off as a "legacy driver" and everyone seems to be using the new b43 driver instead. All sorts of good information on the topic can be found here. I dove feet first into the instructions on the project page and about midway through realized that while I was not getting any error messages, I was having zero success in getting this to work. Additionally, I was skimming through the instructions and really had no idea what I was doing.

Also I noticed I still had no blue light. I wondered if my "hot key" still works. I did a Fn+F2 - and the light came on. Hooray! But that means all the screwing around I had done trying to load drivers was in vain, because my card was turned off the entire time. Duh. Rather than continue on with my path of driver destruction, I opted to back up my home directory to an SD card and re-install the operating system. My hope was that in reinstalling eeeXubuntu the card would be magically detected and the driver would be loaded for me like the Atheros card was when I installed the first time.

And the survey says ... NO DICE.

A fresh and clean Operating System would not find it. Perhaps an up to date Operating System would find it and use it. Next I performed a "dist-upgrade" knowing that I would probably break a ton of other stuff in the process. The dist upgrade took the better part of four hours. Yes, FOUR HOURS. When it was done, I had new versions of everything - but none of my hardware worked any more, not even the on-board wired NIC. Downer.

After having no luck getting drivers to work I began to wonder if the hardware was even being detected. After all, loading the driver didn't give a single error. I ran an 'lspci' and compared the results with what would see with an Atheros card installed. No wonder, the Dell Broadcom card wasn't being picked up at all by the BIOS. This whole thing had been a waste of time, and $15.

With that, I went downstairs, got out the screwdrivers, and put the Atheros card back in. Then, I reinstalled the eeeXubuntu OS to put me back to ground zero. Ugh.

I am not ready to give up, but whatever I come with is going to have to be external. I did some searching around for information on using the Intel 3945 in the eee PC and I was brought right back to the eeeuser.com forum to find some more bad news. That slot it seems, will not detect anything but an Atheros branded card.

For my next trick ... I am thinking of getting an external USB wireless card and making it part of a cantenna. Then the antenna connection would go right into the can - and a single USB cable would come down to the laptop. More on this revelation later.