Updated August 2
As I prepare to replace the hard drive in my Yoga with an SSD, I revisited some of the issues that I had with Ubuntu since I will have to fix them again. I then found a newer and better solution to this WiFi problem. It is still about fixing the ideapad-laptop module, but with this new fix, the changes to the module are not just an ugly hack which you then had to turn off – in effect disabling some other functionality of the module.
This new fix repairs the module and leaves it active.
I have updated the post for the new solution, and I have also updated the files for download. As with the previous solution, it wasn’t me who created it. This time it was a clever guy named Hans De Goede, and the new ideapad-laptop.c source file is copied straight from the original author”s space at fedorapeople.org. I didn’t want to link to it there since the link the Hans wrote in a forum post only two months ago is already broken.
Two days ago I bought a Lenovo Ideapad Yoga 2 11 laptop. It came with Windows 8.1 pre-installed, but as I’ve written about earlier, I really hate Windows 8. I had planned to “downgrade” (in quotes since I actually consider it an upgrade) to Windows 7, but decided to give Ubuntu Linux a (new) try first.
Installing Ubuntu 14.4 “Trusty Tahr” (or just “Trusty”) went rather smoothly once I found out how to boot from a USB drive, but I immediately noticed that WiFi wasn’t working. Ubuntu reported that the laptop’s WiFi hardware switch was OFF, which was rather confusing since the Yoga 2 doesn’t even have a physical switch for WiFi.
Searching the web soon revealed that the Linux module for Ideapad laptops is broken. It clears (sets to zero) a couple of enable-bits that it shouldn’t touch and thereby turns the RF hardware OFF. I suppose this will be corrected eventually, but until then there is another fix. It takes a bit of work, but it’s not hard to do if following the instructions below.
I want to be clear on that I did not come up with this solution. I copied almost all of it from a forum post by the signature haohe, who in turn got the idea from an earlier post by the signature kainz. I have clarified the instructions somewhat, and worked some steps into the make-file to make it a bit easier.
Update: The new solution is similar to, but not the same as, the one described in the links above, but I wanted to keep the links anyway since I still use the instructions on how to prepare, build and load the new module from those. The solution described below is however taken from this post written (and created) by Hans De Goede.
Is this why my WiFi doesn’t work?
This solution will work (I hope) if you can answer yes to all three statements below:
- Your laptop is a Lenovo Ideapad Yoga 2 (not Pro). For example, mine is a Yoga 2 11, meaning that it has an 11″ screen.
- You have installed Ubuntu 14.04 (Trusty Tahr) on it.
- WiFi doesn’t work (cannot be activated) and entering the command “rfkill list” in a terminal window tells you that your Wireless LAN is “Hard blocked”.
The solution is to build a new version of the Linux ideapad-laptop module, and replace the existing one with it.
Sounds complex? Well, it is complex, but not difficult if you follow the detailed instructions below.
In order to build the module, you will need to download the source for the Linux kernel. This is a simple thing to do, but it (of course) requires an internet connection. For this you need a USB-to-Ethernet Adapter (like this one) since you don’t have WiFi and the Yoga 2 doesn’t have en RJ-45 connector. Just plug it in – there’s nothing more to it.
I suppose you could also connect your laptop to the Internet through a mobile phone or similar, though I haven’t tried that myself on Ubuntu.
If you cannot somehow connect your laptop to the Internet, you will need to download to another computer and copy the files to the Yoga. I’m just going to assume that your Yoga is now connected to the Internet.
First you need a directory to work in. In the instructions below, we create the directory ~/workspace/ideapad for this. You can use any directory you want, but then you will need to determine for yourself how to modify the instructions accordingly.
Open a terminal window and enter the commands below.
$ cd ~
$ mkdir workspace <span style="color: #ff6600;"># Skip if you already have this one</span>
$ mkdir workspace/ideapad <span style="color: #ff6600;"># Or similar if that one already exists</span>
Step 1 – Download the kernel source
Updated September 28: It has been reported to me that this step is no longer necessary after I modified the solution in August. I haven’t had time to verify that myself, but you might want to try to skip this. If the “make” command in Step 3 fails, you can always come back here and download the build essentials and the Linux headers (the “sudo apt-get” command below) after that. In any case, you do not need to download the kernel source code (the “git clone” command below) unless you want to have the original source code for the module to compare the changes with.
By entering the commands below, you will download the source code you need to build modules (and other stuff too). After doing this, you can find the original ideapad-laptop.c source file in ~/workspace/ubuntu-trusty/drivers/platform/x86/ should you need it for some reason (such as to compare the new source file with if you want to see what changes that have been made to it).
$ sudo apt-get install build-essential linux-headers-$(uname -r)
$ cd ~/workspace
$ git clone git://kernel.ubuntu.com/ubuntu/ubuntu-trusty.git
$ cd ideapad
Step 2 – Download the make-file and new source code
Download the following two files by right-clicking on each link below and save with the same names (“Makefile” and “ideapad-laptop.c” respectively) in ~/workspace/ideapad:
Step 3 – Build and use the new module
Now that you have Makefile in your work directory, building a new version of the module is as simple as giving the following command:
Do this. You shouldn’t get any errors unless you made any changes of your own to the files. If you did, check and correct your changes, run “make” again, and repeat until it works without errors.
Once you have built the new module, all you need to do to load it and use it to turn on WiFi is to run the following command:
$ make install
This will unload the current ideapad-laptop module and load your new version. If this does not automatically turn on WiFi (and Bluetooth), enter the following command.
$ rfkill unblock all
You should now be able to turn on and off WiFi and Bluetooth from the usual menus.
If something went wrong so that you want to revert to the original module after running “make install”, the original module file (ideapad-laptop.ko) has been backed up as ideapad.ko.backup_<date-and-time> where <date-and-time> is the time-stamp for when the module was replaced. To restore it, rename this backup file as ideapad-laptop.ko and run “make install” again.
That’s it. Easy as doughnuts
Contents of the file Makefile
LIB_BASE = /lib/modules/$(shell uname -r)
LIB_BUILD = $(LIB_BASE)/build
LIB_PLATFORM = $(LIB_BASE)/kernel/drivers/platform/x86
BACKUP_FILE = ideapad-laptop.ko.backup_$(shell date +%Y-%m-%d.%H:%M:%S)
obj-m += ideapad-laptop.o
make -C $(LIB_BUILD) M=$(PWD) modules
make -C $(LIB_BUILD) M=$(PWD) clean
@\cp $(LIB_PLATFORM)/ideapad-laptop.ko ./$(BACKUP_FILE)
@sudo \cp ideapad-laptop.ko $(LIB_PLATFORM)
@sudo modprobe -r ideapad-laptop
@sudo modprobe ideapad-laptop