Wednesday, February 18, 2015

Levovo w540 and Fedora 21

It's been a quick succession of new portable systems.  For the last few years I've been rolling with a Mac Air, while I love the form factor and weight, I'm not a fan of the dwindling battery and 4GB memory limit.  To that end I decided to get a beefier laptop to allow me to run VM's and have a bigger screen to work with, thus the W540.

Since my day job is working for the Shadow Man as a consultant, I'm going to run Fedora or RHEL.

Overall I've found the process of getting Fedora 21 on the W540 more challenging than getting it on the Microsoft Surface Pro 3, go figure.  That's especially perplexing since Lenovo is the laptop vendor of choice for Red Hat.

Before upgrading to F21, I recommend installing any hardware updates available via the pre-installed Windows OS from the vendor.  After that I started using a USB flash drive with a live ISO and installed the OS using the normal means.  Do not be surprised if the computer freezes up at random moments.  For me it took a few attempts before I was able to get F21 installed, as best I can tell there is a bug with the Open Source Nvidia driver, nouveau.  Thus I would suggest focusing on getting X working, before updating the OS.  For me this involved removing the nouveau driver and trying to get the proprietary drivers working from RPM before I found the eventual solution below.  I don't have the time to go back and redo this from scratch, so hopefully my notes here can help someone else.

I tried installing the nvidia driver from RPMforge but that didn't work, Gnome kept showing a sad face and a message "and error has occurred."  In looking at the logs (journalctl) it looked like Gnome was failing to detect 3d acceleration and thus failing.  WTF, I was running the proprietary nvidia drivers from RPMforge, more digging was needed.

In many of my searches I kept seeing references to bumblebee, most often on the ArchLinux Wiki's.  A little digging suggested this was the way forward.  Bumblebee is a project for systems with two graphics drivers and one display, such as laptops, where the processor has a built in graphics controller and there's an external graphics controller as well.

Fortunately there's a very useful wiki page for this: http://fedoraproject.org/wiki/Bumblebee. After following the instructions listed everything came up without issue.  It is worth noting that in order to get bumblebee to install I did need to remove the nvidia drivers installed from RPMforge, I had also removed the nouveau driver at an earlier point as well.  I am not able to test, but I think it would be best to try installing Bumblebee before configuring RPMforge.

Now that X is working I can work on getting the rest of the laptop configured and copy over my old home directory.

Monday, February 9, 2015

Fedora 21 and the Microsoft Surface Pro 3

Recently I decided I'd try to upgrade from my MacbokAir running Fedora and thus I decided to try out the Surface Pro 3.  Overall I have to say I'm rather impressed, it's not perfect, and there are still some warts, but it's a functional option, in fact I'm writing this on the Surface now.

The basic steps are as follows:
  1. Shrink the windows volumes to allow for a space to install Fedora
  2. Put Fedora on to a USB Fash drive and boot the Surface Pro to the USB flash drive.
  3. Install Fedora
  4. Tweak and enjoy!
For the prep steps I found the following blog useful: http://winaero.com/blog/how-to-install-linux-on-surface-pro-3/. You can safely ignore most of the Distro specific steps with the exception of the firmware step.  Fortunately the cover keyboard and touchscreen and pen work out of the box with Fedora 21, however the touch pad mouse does not, although the buttons do.

After installing the OS, download the marvel firmware git repo and copy the contents to the appropriate directory:
$ git clone git://git.marvell.com/mwifiex-firmware.git
# mkdir -p /lib/firmware/mrvl/
# cp mwifiex-firmware/mrvl/* /lib/firmware/mrvl/

The Wifi device may be unstable before the firmware is updated, and bluetooth will not be available.

Next you will need to add a configureation for the touchpad mouse to work. It is worth noting that most instructions include the matching statement for the product.  I found that by removing this line the touchpad worked after updating the kernel.

/etc/X11/xorg.conf.d/10-touchpad.conf
Section "InputClass"
    Identifier "Surface Pro 3 Cover"
    MatchIsPointer "on"
    MatchDevicePath "/dev/input/event*"
    Driver "evdev"
    Option "vendor" "045e"
#    Option "product" "07dc"
    Option "IgnoreAbsoluteAxes" "True"
EndSection
If you have not already, update your OS "yum -y update" and reboot.  After rebooting you should have a working touchpad and bluetooth adapter along with a much more stable wifi connection.