Lenovo S205 wifi woes

I finally decided to stop mincing about my netbooks wifi compatibility woes with Linux and fix them.  My friends and colleagues should be relieved that my constant moaning about the worst linux compatibility problem I’ve had with a computer in a long time will be over.  I should definitely thank them though, as it was their suggestions and research that has helped me solve this issue in the end.

The core problem I’ve had, along with a lot of other S205 users, is that the wifi doesn’t work out of the box with Linux.  This won’t affect every S205, just those that report their wifi hardware switch in a particular way.  The irony is that the wifi driver is loaded and works fine, it’s just that the kernel believes that the hardware disable switch for the wifi has been permanently set to disabled.  

As with lots of manufacturers, Lenovo produce their laptops with lots of variants, so you can choose the specification that suits you.  There may also be variants based on what parts they decided to put under the hood, even though two computers may functionally have the same spec.  They quite handily label these differences as models.  Commonly things like 10382JG and 1038DPG (Lenovo tend to use a consistent length string for the model info which also turns out to be handy).  You can find this model name here, /sys/class/dmi/id/product_name.

This bug appears to reference my problem, but unfortunately, it didn’t actually cure *my* problem.  

Those 3 links are various relevant bugs and patches, but a quick comparison of the models revealed that this didn’t fix my problem, simply because my model was different.  Looking at that patch shows that there is a quirks mechanism to detect  the S205 based on the product name.  If that’s the case then it looks at EC register 0x78 for the hardware switch.

The first thing to do was to confirm whether my computer used that same register, in which case I’d just need to enable the quirk.  Otherwise, I’d have to delve deeper, and add my own.

I downloaded acer_ec.pl from this site – http://code.google.com/p/aceracpi/wiki/EmbeddedController.  And gave it a run.

When I flipped the hardware switch it did appear to signal using the 0x78 EC register as suggested in the patch.  Since it did, it looked like all I’d need to do is enable the quirk the patch is designed to enable.  

Here be dragons – don’t do this unless you’ve read it all, and made backups.

I then started to prepare my computer to build kernel modules before laziness kicked in.  I found my acer-wmi.ko module in /lib/modules/$(uname -r)/kernel/drivers/platform/x86/ and  took a backup of it.  I then took a second copy of the file and modified it.  I found the existing reference to 10382JG and changed the 2 letters ‘2J’ at the end to DP to make it specify my module.  This was possible because the new value I wanted was an identical length to the existing one.  I then did an ls -l to check the files were the same length as a sanity check.  Once I copied the modified module back to it’s original location and rebooted I had wifi!  Theory confirmed.

The tool I used to modify the file was bless, since obviously using a text editor for that is generally not a good idea.  Just remember to make sure you switch to overwrite mode and that you don’t append any characters to the file.

Now all I need to do is ask the nice kernel people to add a reference to the quirk for this model.

Turning a list items on lines into a horizontal list

I just realised I can use xargs to quickly turn a list of items into a horizontal list for further use on the command line.  Well of course that’s the fundamental purpose of xargs, but with echo I can do it without having xargs execute the actual command in question.


cat my.csv | cut -d, -f 2 | xargs echo

Can take a column from a csv and turn it into a horizontal list, like,



12354 32132 77632 09211 99321

Kind of a no brainer when you think about it, if only I thought of it more often.

Lenovo Thinkpad sleep issues and Ubuntu

Recently I’ve been having problems with Ubuntu and sleeping my laptop and it turns out it has the strangest cause.  I even rolled back to a 9.10 version since that used to work.  And it did for a while.  Then it stopped.  All I got was the sleep light flashing constantly.

It looks like the issue was actually having an SD card in the reader on my laptop.  As soon as I took it out I could sleep as usual.

Thanks to this thread for the suggestion – http://ubuntuforums.org/showthread.php?t=1470067

Mounting a MAC OS X disk (HPFS) on ubuntu

As usual, the internet has an answer to everything – http://jclark.org/weblog/2005/05/24/ubuntumount/.  There was one thing I did differently to get going so I figured I’d note it here, in case I need to do it again.

In order to figure out where my disk was so that I could use parted to examine it I used fdisk -l.

root@subfocus:~# fdisk -l

... the info about my other drives, then ...

Disk /dev/sdc: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/sdc doesn't contain a valid partition table

So that identified the hard disk as being on /dev/sdc (this was a usb drive).

Then I used parted as he did in the article,

root@subfocus:~# parted
GNU Parted 1.7.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) select /dev/sdc
Using /dev/sdc
(parted) print

Disk /dev/sdc: 320GB
Sector size (logical/physical): 512B/512B
Partition Table: mac

Number  Start   End     Size    File system  Name                  Flags
1      0.51kB  32.8kB  32.3kB               Apple
3      134MB   320GB   320GB   hfs+         Apple_HFS_Untitled_1

(parted) quit

Note the select to switch to the correct hard disk.  You can then use that Number to identify which partition to mount.  I therefore needed to mount /dev/sdc3.

root@subfocus:~# mount -t hfsplus /dev/sdc3 /mnt/macosx

As Mr Clark mentions, you should remember to unmount the hard disk,

root@subfocus:~# umount /dev/sdc3