Installing Debian on a ThinkPad T420

From ThinkWiki
Revision as of 13:33, 7 January 2014 by Dgriffi (Talk | contribs) (Optimus graphics)
Jump to: navigation, search

The machine

This is a T420 that I bought secondhand off Ebay in December of 2013. I opted to buy this instead of a new Thinkpad because I dislike the new 6-row keyboards and the buttonless trackpads. This is its configuration:

  • Intel® Core™ i5-2520M (2.5GHz, 3MB L3, 1333MHz FSB)
  • Discrete NVIDIA NVS 4200M (1GB VRAM) with Optimus™ Technology
  • UEFI BIOS Version 83ET76WW (1.46)
  • 4GB DDR3 - 1333MHz main memory
  • 14.0" HD+ (1600 x 900) (230 NITS) TFT display
  • Intel® 82577LM Gigabit (Hanksville) Digital Office ethernet adapter
  • Intel Centrino Advanced-N 6205 (Taylor Peak) 2x2 AGN WLAN adapter

Installation

Preparing a Bootable Flash Drive

I installed Debian 7.3.0 (Wheezy) from a bootable flash drive. The process of creating bootable flash drive is described here. It is helpful to add firmware-iwlwifi to this drive so wireless networking can work while you're installing. The installer will notice this and install it automatically.

Installing wicd With Preseed

A helpful extra step is to use preseeding to have wicd installed automatically and to add the first user added to the sudo group. With wicd you can easily connect to a WiFi access point without a GUI. Create a text file named preseed.cfg on the flash drive and put the following in it:

d-i passwd/user-default-groups string cdrom floppy sudo audio dip \
    video plugdev netdev scanner bluetooth
d-i pkgsel/include string sudo wicd-curses wicd-cli

At the bottom of the aforementioned instructions on making a bootable flash drive are instructions on getting the preseed.cfg file installed to the drive.

When you boot into your new system, remember that you need to explicitly tell wicd what the wireless LAN device is. Use the # ifconfig command to check what it is. This turned out to be wlan0 for me, but it might be different if you have a different interface.

Preseeding is a great way to preselect what you want an install to do, saving you time and aggravation. Read more about it here and here. As demonstrated here, you don't have to have a long and drawn-out preseed.cfg file.

Booting the Flash Drive

Plug in your bootable flash drive and turn on your T420. Quickly press F1 to get into the BIOS. Check to make sure that booting from a USB flash drive is enabled. Don't change its priority. If you changed anything, save and exit to reboot the machine. Quickly press F12 to get a boot menu and select the flash drive. The Debian installation process will then begin.

Not Installing a GUI

After answering questions about what keyboard you have, timezone, root password, first user, and so on; you will be shown a menu of software to install. There are ten options. "Debian Desktop Environment", "Print server", "Laptop", and "Standard system utilities" should be preselected for you. If you don't care for Gnome3, deselect "Debian Desktop Environment". That will yield a machine with no GUI at all. Detailed below is the procedure for installing MATE.

The remaining steps of the install process are uneventful. You will end up with a bootable and usable system.

Post-Install Configuration

MATE Desktop

Add this line to /etc/apt/sources.list:

 deb http://packages.mate-desktop.org/repo/debian/ wheezy main

Then update your APT cache

 #  apt-get update

Install the MATE keys with

 #  apt-get install mate-archive-keyring

and press 'Y' when you're asked if your sure. Then do:

 #  apt-get install mate-core

This installs the basic environment. If you want more, do:

 #  apt-get install mate-desktop-environment

For even more:

 #  apt-get install mate-desktop-environment-extra

Now, if you don't want to install gdm3, you'll need to install the xinit package:

 #  apt-get install xinit

This will enable you to start an X session by typing "startx".

Sleep and Hibernate

Install the packages hibernate and nvram-wakeup. The thinkpad and nvram modules should automatically install without needing to list them in /etc/modules. After a reboot, the Fn-F4 and Fn-F12 key combinations will cause suspend-to-RAM and hibernate-to-disk respectively.

Discrete Graphics versus Integrated Graphics

Make sure you have Nvidia Optimus and switchable graphics enabled in the BIOS. Then install Bumblebee.

Read [1] from the Debian wiki about Bumblebee. This tool is now included in the Debian repos. Basically, it boils down to this:

Add this line to /etc/apt/sources.list:

 deb http://YOURMIRROR.debian.org/debian wheezy-backports main contrib non-free

Do apt-get update and then this:

 #  apt-get install -t wheezy-backports bumblebee-nvidia primus mesa-utils

This specifies that you want to use the proprietary drivers. Remove -nvidia from bumblebee-nvidia if you want the open-source ones.

Edit /etc/X11/xorg.conf and add the following "Device" section just below the first:

 Section "Device"
         Driver "nvidia"
         BusID  "PCI:1:0:0"
         Identifier "Card1"
 EndSection

Edit /etc/bumblebee/bumblebee.conf and look for the "[driver-nvidia]" section. There you will see a line that looks like this:

 KernelDriver=nvidia

Change that to:

 KernelDriver=nvidia-current

Now you should be able to start an X11 session. Start a terminal emulator and type:

 optirun glxgears --info

Unfortunately glxgears is a very poor test of 3D acceleration. http://unigine.com has several benchmarks of varying sophistication and cost (some are free as in beer).

TODO
Not Fully Tested


Integrated Webcam

TODO
Incomplete