<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.thinkwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kanal108</id>
	<title>ThinkWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.thinkwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kanal108"/>
	<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/wiki/Special:Contributions/Kanal108"/>
	<updated>2026-05-10T00:45:13Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.12</generator>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52848</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52848"/>
		<updated>2011-08-26T12:23:05Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Minimal grub.cfg */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HDD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
There are still no correct settings for MTRR: [https://bugzilla.redhat.com/show_bug.cgi?id=584493 Link]&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you have a SSD, you should use Trim (discard)&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime,discard	0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi/efi/grub -p}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
===== Optimized grub.cfg =====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=3&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to following links (threads), you should set i915.i915_enable_rc6=1, i915.i915_enable_fbc=1 and i915.lvds_downclock=1 for less power consumption (used kernel: 3.1.0rc3). &lt;br /&gt;
:[http://forum.notebookreview.com/lenovo-ibm/575569-linux-x220-19.html Link Forum Notebookreview]&lt;br /&gt;
:[https://bugs.launchpad.net/ubuntu/+source/linux/+bug/818830 Link Ubuntu Launchpad Bugs]&lt;br /&gt;
:[https://bbs.archlinux.org/viewtopic.php?pid=974592#p974592 Link Archlinux BBS] &lt;br /&gt;
:[http://www.phoronix.com/scan.php?page=article&amp;amp;item=intel_i915_power&amp;amp;num=12 Link Phoronix Tweaks To Extend The Battery Life Of Intel Linux Notebooks]&lt;br /&gt;
:[https://bugzilla.redhat.com/show_bug.cgi?id=727579 RedHat Bugzilla]&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52842</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52842"/>
		<updated>2011-08-24T10:57:09Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Optimized grub.cfg */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HDD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
There are still no correct settings for MTRR: [https://bugzilla.redhat.com/show_bug.cgi?id=584493 Link]&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you have a SSD, you should use Trim (discard)&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime,discard	0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi/efi/grub -p}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
===== Optimized grub.cfg =====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=3&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to following links (threads), you should set i915.i915_enable_rc6=1, i915.i915_enable_fbc=1 and i915.lvds_downclock=1 for less power consumption (used kernel: 3.1.0rc3). &lt;br /&gt;
:[http://forum.notebookreview.com/lenovo-ibm/575569-linux-x220-19.html Link Forum Notebookreview]&lt;br /&gt;
:[https://bugs.launchpad.net/ubuntu/+source/linux/+bug/818830 Link Ubuntu Launchpad Bugs]&lt;br /&gt;
:[https://bbs.archlinux.org/viewtopic.php?pid=974592#p974592 Link Archlinux BBS] &lt;br /&gt;
:[http://www.phoronix.com/scan.php?page=article&amp;amp;item=intel_i915_power&amp;amp;num=12 Link Phoronix Tweaks To Extend The Battery Life Of Intel Linux Notebooks]&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52841</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52841"/>
		<updated>2011-08-24T10:55:14Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Optimized grub.cfg */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HDD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
There are still no correct settings for MTRR: [https://bugzilla.redhat.com/show_bug.cgi?id=584493 Link]&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you have a SSD, you should use Trim (discard)&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime,discard	0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi/efi/grub -p}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
===== Optimized grub.cfg =====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=3&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to following links (threads), you should set i915.i915_enable_rc6=1, i915.i915_enable_fbc=1 and i915.lvds_downclock=1 for less power consumption. &lt;br /&gt;
:[http://forum.notebookreview.com/lenovo-ibm/575569-linux-x220-19.html Link Forum Notebookreview]&lt;br /&gt;
:[https://bugs.launchpad.net/ubuntu/+source/linux/+bug/818830 Link Ubuntu Launchpad Bugs]&lt;br /&gt;
:[https://bbs.archlinux.org/viewtopic.php?pid=974592#p974592 Link Archlinux BBS] &lt;br /&gt;
:[http://www.phoronix.com/scan.php?page=article&amp;amp;item=intel_i915_power&amp;amp;num=12 Link Phoronix Tweaks To Extend The Battery Life Of Intel Linux Notebooks]&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52840</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52840"/>
		<updated>2011-08-24T10:54:05Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Optimized grub.cfg */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HDD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
There are still no correct settings for MTRR: [https://bugzilla.redhat.com/show_bug.cgi?id=584493 Link]&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you have a SSD, you should use Trim (discard)&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime,discard	0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi/efi/grub -p}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
===== Optimized grub.cfg =====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=10&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to following links (threads), you should set i915.i915_enable_rc6=1, i915.i915_enable_fbc=1 and i915.lvds_downclock=1 for less power consumption. &lt;br /&gt;
:[http://forum.notebookreview.com/lenovo-ibm/575569-linux-x220-19.html Link Forum Notebookreview]&lt;br /&gt;
:[https://bugs.launchpad.net/ubuntu/+source/linux/+bug/818830 Link Ubuntu Launchpad Bugs]&lt;br /&gt;
:[https://bbs.archlinux.org/viewtopic.php?pid=974592#p974592 Link Archlinux BBS] &lt;br /&gt;
:[http://www.phoronix.com/scan.php?page=article&amp;amp;item=intel_i915_power&amp;amp;num=12 Link Phoronix Tweaks To Extend The Battery Life Of Intel Linux Notebooks]&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52839</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52839"/>
		<updated>2011-08-24T10:46:12Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Optimized grub.cfg */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HDD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
There are still no correct settings for MTRR: [https://bugzilla.redhat.com/show_bug.cgi?id=584493 Link]&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you have a SSD, you should use Trim (discard)&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime,discard	0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi/efi/grub -p}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
===== Optimized grub.cfg =====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=10&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to following Links (Threads), you should set i915.i915_enable_rc6=1, i915.i915_enable_fbc=1 and i915.lvds_downclock=1 for less power consumption. &lt;br /&gt;
:[http://forum.notebookreview.com/lenovo-ibm/575569-linux-x220-19.html Link Forum Notebookreview]&lt;br /&gt;
:[https://bugs.launchpad.net/ubuntu/+source/linux/+bug/818830 Link Ubuntu Launchpad Bugs]&lt;br /&gt;
:[https://bbs.archlinux.org/viewtopic.php?pid=974592#p974592 Link Archlinux BBS] &lt;br /&gt;
:[http://www.phoronix.com/scan.php?page=article&amp;amp;item=intel_i915_power&amp;amp;num=12 Link Phoronix Tweaks To Extend The Battery Life Of Intel Linux Notebooks]&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52806</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52806"/>
		<updated>2011-08-17T17:28:31Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Optimized grub.cfg */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HDD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
There are still no correct settings for MTRR: [https://bugzilla.redhat.com/show_bug.cgi?id=584493 Link]&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you have a SSD, you should use Trim (discard)&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime,discard	0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi/efi/grub -p}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
===== Optimized grub.cfg =====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=10&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force i915.i915_enable_rc6=1 rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to [http://forum.notebookreview.com/lenovo-ibm/575569-linux-x220-19.html this],  [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/818830 this] and [https://bbs.archlinux.org/viewtopic.php?pid=974592#p974592 this] Thread, you should set i915.i915_enable_rc6=1 for less power consumption.&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52785</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52785"/>
		<updated>2011-08-12T11:35:13Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Required kernel modules for the X220 hardware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HDD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
There are still no correct settings for MTRR: [https://bugzilla.redhat.com/show_bug.cgi?id=584493 Link]&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you have a SSD, you should use Trim (discard)&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime,discard	0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi/efi/grub -p}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
===== Optimized grub.cfg =====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=10&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force i915.i915_enable_rc6=1 rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to [http://forum.notebookreview.com/lenovo-ibm/575569-linux-x220-19.html this] and [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/818830 this] Thread, you should set i915.i915_enable_rc6=1 for less power consumption.&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52784</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52784"/>
		<updated>2011-08-12T11:34:19Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Required kernel modules for the X220 hardware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HDD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
There are still no optimal settings for MTRR: [https://bugzilla.redhat.com/show_bug.cgi?id=584493 Link]&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you have a SSD, you should use Trim (discard)&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime,discard	0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi/efi/grub -p}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
===== Optimized grub.cfg =====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=10&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force i915.i915_enable_rc6=1 rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to [http://forum.notebookreview.com/lenovo-ibm/575569-linux-x220-19.html this] and [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/818830 this] Thread, you should set i915.i915_enable_rc6=1 for less power consumption.&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52783</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52783"/>
		<updated>2011-08-12T11:22:08Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Optimized grub.cfg */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HDD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you have a SSD, you should use Trim (discard)&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime,discard	0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi/efi/grub -p}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
===== Optimized grub.cfg =====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=10&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force i915.i915_enable_rc6=1 rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to [http://forum.notebookreview.com/lenovo-ibm/575569-linux-x220-19.html this] and [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/818830 this] Thread, you should set i915.i915_enable_rc6=1 for less power consumption.&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52782</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52782"/>
		<updated>2011-08-12T11:16:19Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Minimal grub.cfg */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HDD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you have a SSD, you should use Trim (discard)&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime,discard	0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi/efi/grub -p}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
===== Optimized grub.cfg =====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=10&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force i915.i915_enable_rc6=1 rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to [http://forum.notebookreview.com/lenovo-ibm/575569-linux-x220-19.html this] Thread, you should set i915.i915_enable_rc6=1 for less power consumption.&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Category:X220&amp;diff=52781</id>
		<title>Category:X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Category:X220&amp;diff=52781"/>
		<updated>2011-08-11T21:00:28Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;&amp;quot;&amp;gt;&lt;br /&gt;
=== ThinkPad X220 ===&lt;br /&gt;
This page gives an overview of all ThinkPad X220 related topics.&lt;br /&gt;
&lt;br /&gt;
==== Machine Type ====&lt;br /&gt;
* 4287, 4290, 4291&lt;br /&gt;
&lt;br /&gt;
==== Features ====&lt;br /&gt;
*One of the following [[Intel Core i5]] or [[Intel Core i7]] processors:&lt;br /&gt;
** Intel® Core™ i5-2410M (2.3GHz, 3MB L3 cache)&lt;br /&gt;
** Intel® Core™ i5-2520M (2.5GHz, 3MB L3 cache)&lt;br /&gt;
** Intel® Core™ i5-2540M (2.6GHz, 3MB L3 cache)&lt;br /&gt;
** Intel® Core™ i7-2620M (2.7GHz, 4MB L3 cache)&lt;br /&gt;
* [[Intel Mobile QM67 Express Chipset]]&lt;br /&gt;
* Up to 8GB [[PC3-10600]] DDR3 memory at 1333MHz&lt;br /&gt;
* [[Intel HD Graphics]] 3000&lt;br /&gt;
* One of the following [[TFT display|TFT displays]]:&lt;br /&gt;
** 12.5&amp;quot; TFT display with 1366x768 resolution with LED backlight&lt;br /&gt;
** 12.5&amp;quot; extra bright wide-viewing IPS TFT display with 1366x768 resolution with LED backlight&lt;br /&gt;
* 2.5&amp;quot; × 7mm hard drive bay with one of the following hard drives:&lt;br /&gt;
** 4GB SSD SATA&lt;br /&gt;
** Intel 80GB Micro SSD SATA&lt;br /&gt;
** 128GB SSD SATA&lt;br /&gt;
** Intel 160GB SSD SATA&lt;br /&gt;
** 160GB 7200RPM SATA&lt;br /&gt;
** 250GB 5400RPM SATA&lt;br /&gt;
** 250GB 7200RPM SATA (with limited OPAL FDE technology)&lt;br /&gt;
** 320GB 5400RPM SATA&lt;br /&gt;
** 320GB 7200RPM SATA&lt;br /&gt;
* [[MiniPCI Express slot]] 1 with zero or one of the following:&lt;br /&gt;
** [[Intel Centrino Wireless-N 1000]]&lt;br /&gt;
** [[Intel Centrino Ultimate-N 6300]]&lt;br /&gt;
** [[Intel Centrino Advanced-N 6205]]&lt;br /&gt;
** [[Intel Centrino Advanced-N + WiMAX 6250]]&lt;br /&gt;
* [[MiniPCI Express slot]] 2 with zero or one of the following:&lt;br /&gt;
** [[Qualcomm Gobi 3000]] WWAN&lt;br /&gt;
** [[LeadCore TD-SCDMA (LC5730D)]] WWAN&lt;br /&gt;
** [[Ericsson HSPA + (F5521gw)]] WWAN&lt;br /&gt;
** [[Huawei EV-DO (EM660)]] WWAN&lt;br /&gt;
* [[Intel Gigabit Ethernet PCI-Express Controller]]&lt;br /&gt;
* [[ThinkPad Bluetooth Daughter Card with Enhanced Data Rate (BDC-2)|ThinkPad Bluetooth Daughter Card with Enhanced Data Rate (BDC-2.1)]]&lt;br /&gt;
* [[ExpressCard slot|ExpressCard/54 slot]]&lt;br /&gt;
* [[SD Card slot]]&lt;br /&gt;
* Three USB ports (of which one is [[USB 3.0]] on the i7 model)&lt;br /&gt;
* 720p HD [[Integrated camera]]&lt;br /&gt;
* Stereo digital microphones&lt;br /&gt;
* Stereo speakers &lt;br /&gt;
* Combined headphone and microphone jack&lt;br /&gt;
* [[Trackpoint]] and [[Buttonless Touchpad]]&lt;br /&gt;
* [[Integrated Fingerprint Reader]] (UPEK)&lt;br /&gt;
* Comes with 65W AC Adapter&lt;br /&gt;
* Supports [[ThinkPad UltraBase Series 3]], [[ThinkPad Mini Dock Series 3]], etc.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|style=&amp;quot;vertical-align:top&amp;quot; |&lt;br /&gt;
[[Image:ThinkPadX220.png|ThinkPad X220|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Resources ===&lt;br /&gt;
* [http://shop.lenovo.com/ISS_Static/ww/wci/us/ww/pdf/x220_datasheet.pdf Datasheet]&lt;br /&gt;
&lt;br /&gt;
[[Category:X Series]]&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
The CPU speed will be throttled back to 800MHz if the machine is run on the 65W AC adapter with no battery installed.  To avoid this throttling&lt;br /&gt;
* run on a 90W AC adapter, or&lt;br /&gt;
* install a battery pack.&lt;br /&gt;
&lt;br /&gt;
=== mSATA SSD ===&lt;br /&gt;
&lt;br /&gt;
It's possible to use a mSATA SSD within the second MiniPCI Express slot. Using an Intel Series 310 mSATA SSD requires a UEFI-BIOS 1.19.&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Category:X220&amp;diff=52780</id>
		<title>Category:X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Category:X220&amp;diff=52780"/>
		<updated>2011-08-11T21:00:14Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;&amp;quot;&amp;gt;&lt;br /&gt;
=== ThinkPad X220 ===&lt;br /&gt;
This page gives an overview of all ThinkPad X220 related topics.&lt;br /&gt;
&lt;br /&gt;
==== Machine Type ====&lt;br /&gt;
* 4287, 4290, 4291&lt;br /&gt;
&lt;br /&gt;
==== Features ====&lt;br /&gt;
*One of the following [[Intel Core i5]] or [[Intel Core i7]] processors:&lt;br /&gt;
** Intel® Core™ i5-2410M (2.3GHz, 3MB L3 cache)&lt;br /&gt;
** Intel® Core™ i5-2520M (2.5GHz, 3MB L3 cache)&lt;br /&gt;
** Intel® Core™ i5-2540M (2.6GHz, 3MB L3 cache)&lt;br /&gt;
** Intel® Core™ i7-2620M (2.7GHz, 4MB L3 cache)&lt;br /&gt;
* [[Intel Mobile QM67 Express Chipset]]&lt;br /&gt;
* Up to 8GB [[PC3-10600]] DDR3 memory at 1333MHz&lt;br /&gt;
* [[Intel HD Graphics]] 3000&lt;br /&gt;
* One of the following [[TFT display|TFT displays]]:&lt;br /&gt;
** 12.5&amp;quot; TFT display with 1366x768 resolution with LED backlight&lt;br /&gt;
** 12.5&amp;quot; extra bright wide-viewing IPS TFT display with 1366x768 resolution with LED backlight&lt;br /&gt;
* 2.5&amp;quot; × 7mm hard drive bay with one of the following hard drives:&lt;br /&gt;
** 4GB SSD SATA&lt;br /&gt;
** Intel 80GB Micro SSD SATA&lt;br /&gt;
** 128GB SSD SATA&lt;br /&gt;
** Intel 160GB SSD SATA&lt;br /&gt;
** 160GB 7200RPM SATA&lt;br /&gt;
** 250GB 5400RPM SATA&lt;br /&gt;
** 250GB 7200RPM SATA (with limited OPAL FDE technology)&lt;br /&gt;
** 320GB 5400RPM SATA&lt;br /&gt;
** 320GB 7200RPM SATA&lt;br /&gt;
* [[MiniPCI Express slot]] 1 with zero or one of the following:&lt;br /&gt;
** [[Intel Centrino Wireless-N 1000]]&lt;br /&gt;
** [[Intel Centrino Ultimate-N 6300]]&lt;br /&gt;
** [[Intel Centrino Advanced-N 6205]]&lt;br /&gt;
** [[Intel Centrino Advanced-N + WiMAX 6250]]&lt;br /&gt;
* [[MiniPCI Express slot]] 2 with zero or one of the following:&lt;br /&gt;
** [[Qualcomm Gobi 3000]] WWAN&lt;br /&gt;
** [[LeadCore TD-SCDMA (LC5730D)]] WWAN&lt;br /&gt;
** [[Ericsson HSPA + (F5521gw)]] WWAN&lt;br /&gt;
** [[Huawei EV-DO (EM660)]] WWAN&lt;br /&gt;
* [[Intel Gigabit Ethernet PCI-Express Controller]]&lt;br /&gt;
* [[ThinkPad Bluetooth Daughter Card with Enhanced Data Rate (BDC-2)|ThinkPad Bluetooth Daughter Card with Enhanced Data Rate (BDC-2.1)]]&lt;br /&gt;
* [[ExpressCard slot|ExpressCard/54 slot]]&lt;br /&gt;
* [[SD Card slot]]&lt;br /&gt;
* Three USB ports (of which one is [[USB 3.0]] on the i7 model)&lt;br /&gt;
* 720p HD [[Integrated camera]]&lt;br /&gt;
* Stereo digital microphones&lt;br /&gt;
* Stereo speakers &lt;br /&gt;
* Combined headphone and microphone jack&lt;br /&gt;
* [[Trackpoint]] and [[Buttonless Touchpad]]&lt;br /&gt;
* [[Integrated Fingerprint Reader]] (UPEK)&lt;br /&gt;
* Comes with 65W AC Adapter&lt;br /&gt;
* Supports [[ThinkPad UltraBase Series 3]], [[ThinkPad Mini Dock Series 3]], etc.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|style=&amp;quot;vertical-align:top&amp;quot; |&lt;br /&gt;
[[Image:ThinkPadX220.png|ThinkPad X220|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Resources ===&lt;br /&gt;
* [http://shop.lenovo.com/ISS_Static/ww/wci/us/ww/pdf/x220_datasheet.pdf Datasheet]&lt;br /&gt;
&lt;br /&gt;
[[Category:X Series]]&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
The CPU speed will be throttled back to 800MHz if the machine is run on the 65W AC adapter with no battery installed.  To avoid this throttling&lt;br /&gt;
* run on a 90W AC adapter, or&lt;br /&gt;
* install a battery pack.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== mSATA SSD ===&lt;br /&gt;
&lt;br /&gt;
It's possible to use a mSATA SSD within the second MiniPCI Express slot. Using an Intel Series 310 mSATA SSD requires a UEFI-BIOS 1.19.&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52779</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52779"/>
		<updated>2011-08-11T20:56:40Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* General specs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HDD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you have a SSD, you should use Trim (discard)&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime,discard	0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi/efi/grub -p}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
===== Optimized grub.cfg =====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=10&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=User:Kanal108&amp;diff=52778</id>
		<title>User:Kanal108</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=User:Kanal108&amp;diff=52778"/>
		<updated>2011-08-11T20:55:06Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Lenovo x220 University (Type 4290-W4H)&lt;br /&gt;
&lt;br /&gt;
* Core i7 - 2620M&lt;br /&gt;
* 4 GB RAM (1 slot)&lt;br /&gt;
* 80 GB INTEL 310 Series mSATA SSD&lt;br /&gt;
* Empty HDD slot :-)&lt;br /&gt;
* IPS Panel&lt;br /&gt;
* Intel Centrino Advanced-N 6205&lt;br /&gt;
* 9 cell battery&lt;br /&gt;
&lt;br /&gt;
* Gentoo x64 unstable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Installing_Gentoo_on_a_ThinkPad_X220]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=User:Kanal108&amp;diff=52777</id>
		<title>User:Kanal108</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=User:Kanal108&amp;diff=52777"/>
		<updated>2011-08-11T20:54:38Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Lenovo x220 University (Type 4290-W4H)&lt;br /&gt;
&lt;br /&gt;
* Core i7 - 2620M&lt;br /&gt;
* 4 GB RAM (1 slot)&lt;br /&gt;
* 80 GB INTEL 310 Series mSATA SSD&lt;br /&gt;
* Empty HDD slot :-)&lt;br /&gt;
* IPS Panel&lt;br /&gt;
* Intel Centrino Advanced-N 6205&lt;br /&gt;
* 9 cell battery&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Installing_Gentoo_on_a_ThinkPad_X220]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=User:Kanal108&amp;diff=52776</id>
		<title>User:Kanal108</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=User:Kanal108&amp;diff=52776"/>
		<updated>2011-08-11T20:52:55Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: â†Created page with 'Lenovo x220 University (Type 4290-W4H)  * Core i7 - 2620M * 4 GB RAM (1 slot) * 80 GB INTEL 310 Series mSATA SSD * Empty HDD slot :-) * IPS Panel * Intel Centrino Advanced...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Lenovo x220 University (Type 4290-W4H)&lt;br /&gt;
&lt;br /&gt;
* Core i7 - 2620M&lt;br /&gt;
* 4 GB RAM (1 slot)&lt;br /&gt;
* 80 GB INTEL 310 Series mSATA SSD&lt;br /&gt;
* Empty HDD slot :-)&lt;br /&gt;
* IPS Panel&lt;br /&gt;
* Intel Centrino Advanced-N 6205&lt;br /&gt;
* 9 cell battery&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52775</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52775"/>
		<updated>2011-08-11T20:47:43Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Gentoo stage3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you have a SSD, you should use Trim (discard)&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime,discard	0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi/efi/grub -p}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
===== Optimized grub.cfg =====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=10&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52774</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52774"/>
		<updated>2011-08-11T20:47:16Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Kernel configuration remarks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi/efi/grub -p}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
===== Optimized grub.cfg =====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=10&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52773</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52773"/>
		<updated>2011-08-11T20:41:37Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Kernel configuration remarks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi/efi/grub -p}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
===== Optimized grub.cfg =====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=10&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
* If you have a SSD, you should use Trim (discard)&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime,discard	0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52772</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52772"/>
		<updated>2011-08-11T20:34:18Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Grub with EFI support installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi/efi/grub -p}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
===== Optimized grub.cfg =====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=10&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52771</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52771"/>
		<updated>2011-08-11T20:32:43Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Optimized grub.cfg */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
===== Optimized grub.cfg =====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=10&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52770</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52770"/>
		<updated>2011-08-11T20:32:25Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Minimal grub.cfg */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
==== Optimized grub.cfg ====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=10&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52769</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52769"/>
		<updated>2011-08-11T20:31:51Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Optimized grub.cfg */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Optimized grub.cfg ====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=10&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52768</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52768"/>
		<updated>2011-08-11T20:31:28Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Optimized grub.cfg */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Optimized grub.cfg ====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=10&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52767</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52767"/>
		<updated>2011-08-11T20:31:06Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Minimal grub.cfg */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cfg in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Optimized grub.cfg ====&lt;br /&gt;
&lt;br /&gt;
Use 'threadirqs' with kernel &amp;gt; 3.0.0 and because PCIE_ASPM is not detected correct (and you may want longer battery life) you should use 'pcie_aspm=force'. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=10&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro fastboot splash=silent quiet threadirqs pcie_aspm=force rootfstype=ext4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52766</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52766"/>
		<updated>2011-08-11T20:11:03Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* make.conf */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cf in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With gcc &amp;gt; 4.2:&lt;br /&gt;
&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=native -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5 -l5&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52765</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52765"/>
		<updated>2011-08-11T20:07:40Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Working Fingerprint reader */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cf in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j 4&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52764</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52764"/>
		<updated>2011-08-11T20:07:17Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Working Fingerprint reader */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cf in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j 4&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards edit following:&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/etc/pam.d/system-auth&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
{{cmdroot|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52763</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52763"/>
		<updated>2011-08-11T20:05:25Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* Fingerprint reader */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cf in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j 4&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
=== Working Fingerprint reader ===&lt;br /&gt;
&lt;br /&gt;
If you'd like to use the fingerprint sensors, just emerge following:&lt;br /&gt;
{{cmdroot|emerge sys-auth/fprintd}}&lt;br /&gt;
&lt;br /&gt;
Afterwards:&lt;br /&gt;
{{File|/etc/pam.d/system-auth|&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
auth       sufficient   pam_fprintd.so&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Enroll your finger :-)&lt;br /&gt;
{{Root|fprintd-enroll}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52762</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52762"/>
		<updated>2011-08-11T19:55:48Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* General specs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (proved with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cf in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j 4&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52761</id>
		<title>Installing Gentoo on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52761"/>
		<updated>2011-08-11T19:55:04Z</updated>

		<summary type="html">&lt;p&gt;Kanal108: /* General specs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Installing Gentoo on a Lenovo X220 with UEFI and GPT =&lt;br /&gt;
&lt;br /&gt;
The goal is a working {{Gentoo}} installation utilizing UEFI and GPT on an SSD. I work on improving the page step-by-step, but it's more or less for the advanced gentoo user. But you can always ask me for clarification. :)&lt;br /&gt;
&lt;br /&gt;
== Model specs ==&lt;br /&gt;
&lt;br /&gt;
=== General specs ===&lt;br /&gt;
{{X220}} - 4290-W1B, i5-2520M, 4GB RAM&lt;br /&gt;
&lt;br /&gt;
Replaced internal HD with SSD Intel 320 Series 120GB, 2.5&amp;quot;, SATA II (SSDSA2CW120G310). It's a SSD with 7.5mm height, so it fits nicely in the X220. 2.5&amp;quot; 9mm SSDs fit too, but you have to remove parts of the SSDs case.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Some Intel 320 Series SSDs are affected by a [http://communities.intel.com/message/133505 firmware bug]}}&lt;br /&gt;
{{WARN| The mSATA Intel 310 Serices SSD requires UEFI BIOS 1.19 (used with X220 4290-W4H)}}&lt;br /&gt;
&lt;br /&gt;
=== cpuinfo ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
processor       : 0&lt;br /&gt;
vendor_id       : GenuineIntel&lt;br /&gt;
cpu family      : 6&lt;br /&gt;
model           : 42&lt;br /&gt;
model name      : Intel® Core™ i5-2520M CPU 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KiB&lt;br /&gt;
physical id     : 0&lt;br /&gt;
siblings        : 4&lt;br /&gt;
core id         : 0&lt;br /&gt;
cpu cores       : 2&lt;br /&gt;
apicid          : 0&lt;br /&gt;
initial apicid  : 0&lt;br /&gt;
fpu             : yes&lt;br /&gt;
fpu_exception   : yes&lt;br /&gt;
cpuid level     : 13&lt;br /&gt;
wp              : yes&lt;br /&gt;
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid&lt;br /&gt;
bogomips        : 4983.17&lt;br /&gt;
clflush size    : 64&lt;br /&gt;
cache_alignment : 64&lt;br /&gt;
address sizes   : 36 bits physical, 48 bits virtual&lt;br /&gt;
power management:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lspci ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)&lt;br /&gt;
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)&lt;br /&gt;
00:16.3 Serial controller: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller (rev 04)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)&lt;br /&gt;
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation QM67 Express Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)&lt;br /&gt;
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)&lt;br /&gt;
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required kernel modules for the X220 hardware ===&lt;br /&gt;
* Intel Gigabit Ethernet: {{kernelconf|CONFIG_E1000EI||||||}}&lt;br /&gt;
* Intel WLAN: {{kernelconf|CONFIG_IWLAGNI||||||}}&lt;br /&gt;
* Intel HD Graphic: {{kernelconf|CONFIG_DRM_I915I||||||}}&lt;br /&gt;
* TPM Chip {{kernelconf|CONFIG_TCG_TIS||||||}}&lt;br /&gt;
&lt;br /&gt;
== BIOS update ==&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
There a ways to boot the .iso image with grub. &lt;br /&gt;
I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. &lt;br /&gt;
But got stuck there. &lt;br /&gt;
After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. &lt;br /&gt;
'''Lenovo has to do better here'''. &lt;br /&gt;
For example by providing some sort of Linux BIOS update tool, or at least an UEFI bootable USB stick image.&lt;br /&gt;
&lt;br /&gt;
== Boot from USB stick ==&lt;br /&gt;
Sysresccd (2.2.0), which has a pretty nice script to create a bootable USB-Stick, failed to boot on the X220. &lt;br /&gt;
Created an bootable usb stick from the gentoo-minimal.iso with unetbootin. Works.&lt;br /&gt;
&lt;br /&gt;
=== Partition the drive ===&lt;br /&gt;
{{cmdroot|parted}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mklabel gpt|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary fat32 1 201|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|We don't start with sector 0 because of alignment. I am not sure if the result is optimal, but at least parted doesn't complain}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|set 1 boot on|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart primary linux-swap 202 4047|(parted)}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkpart pimrary ext2 4048 120GB|(parted)}}&lt;br /&gt;
&lt;br /&gt;
=== Format the partitions ===&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.vfat /dev/sda1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkfs.btrfs /dev/sda3}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The ''mkfs.btrfs'' binary is not yet on the gentoo minimal image.}}&lt;br /&gt;
&lt;br /&gt;
== Gentoo installation ==&lt;br /&gt;
&lt;br /&gt;
=== Gentoo stage3 ===&lt;br /&gt;
Just like the [http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml handbook]:&lt;br /&gt;
*  Boot from gentoo-minimal-image. &lt;br /&gt;
*  Unpack stage3 and portage. &lt;br /&gt;
*  Edit fstab&lt;br /&gt;
{{path|/etc/fstab}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev/sda1		/boot/efi	vfat		noauto		1 2&lt;br /&gt;
/dev/sda3		/		btrfs		noatime		0 1&lt;br /&gt;
/dev/sda2		none		swap		sw		0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*  Set a root password. &lt;br /&gt;
*  Everything else can be done later on.&lt;br /&gt;
&lt;br /&gt;
=== Grub with EFI support installation ===&lt;br /&gt;
This was by far the hardest part yet. &lt;br /&gt;
Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. &lt;br /&gt;
Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set.&lt;br /&gt;
If it finds one it tries to start {{path|/EFI/boot/bootx64.efi}} from this partition. (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
A grub-1.99 ebuild is needed. Unfortunately the one from the scarabeus is broken. You could fix the STRIP_MASK error by removing the last &amp;quot;a&amp;quot;. &lt;br /&gt;
Or you use the [https://gitorious.org/flow-s-ebuilds/flow-s-ebuilds/blobs/master/sys-boot/grub/grub-1.99.ebuild fixed ebuild] from my overlay.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|layman -a flow}}&lt;br /&gt;
&lt;br /&gt;
Enable GRUB_PLATFORMS=efi-64 in make.conf or if you don't see the effect enable the GRUB_PLATFORM as USE flag. &lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;USE=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v =sys-boot/grub-1.99&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a mountpoint for the UEFI partition and mount the partition.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mount /dev/sda1 /boot/efi}}&lt;br /&gt;
&lt;br /&gt;
{{HELP|I don't think that this is needed, it's from the [https://wiki.archlinux.org/index.php/GRUB2#UEFI_systems Arch Wiki on UEFI boot]. Maybe outdated, please report if it works without for you or simply delete this part.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/efi/efi/grub/}}&lt;br /&gt;
&lt;br /&gt;
Important part:&lt;br /&gt;
&lt;br /&gt;
{{NOTE| The efi_gop grub module is very important. If it's not loaded, you won't see anything on boot after grub}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|grub2-mkimage -d /lib/grub/x86_64-efi -O x86_64-efi -p &amp;quot;&amp;quot; -o /boot/efi/efi/boot/bootx64.efi part_gpt btrfs fat ext2 normal chain boot configfile linux multiboot efi_gop linux}}&lt;br /&gt;
&lt;br /&gt;
Optional but useful:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.mod /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cp /lib/grub/x86_64-efi/*.lst /boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
==== Minimal grub.cfg ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set prefix(hd0,gpt1)/efi/boot&lt;br /&gt;
pager=1&lt;br /&gt;
timeout=20&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo Linux&amp;quot; {&lt;br /&gt;
        set root=(hd0,gpt3)&lt;br /&gt;
        linux /boot/bzImage root=/dev/sda3 ro raid=noautodetect&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Put grub.cf in same directory as bootx64.efi: {{path|/boot/efi/efi/boot/}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Thanks to Finnbarr P. Murphy for [http://blog.fpmurphy.com/2010/03/grub2-efi-support.html his] [http://blog.fpmurphy.com/2010/11/boot-fedora-14-using-uefi-and-grub2.html blog] [http://blog.fpmurphy.com/2011/06/boot-fedora-15-using-uefi-and-grub2.html posts] about Grub and UEFI.'''&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&lt;br /&gt;
For UEFI on the X220 you have to use a kernel &amp;gt; 3.0-rc1. Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6.&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc6)]. &lt;br /&gt;
Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. &lt;br /&gt;
The config is hosted as github gist, so you can easily ask for merges with your version. &lt;br /&gt;
This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration remarks ====&lt;br /&gt;
* using deadline I/0 scheduler because of the SSD. If you don't have an SSD, use CFQ.&lt;br /&gt;
&lt;br /&gt;
=== make.conf ===&lt;br /&gt;
{{path|/etc/make.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-march=core2 -O3 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j 4&amp;quot;&lt;br /&gt;
GRUB_PLATFORMS=&amp;quot;efi-64&amp;quot;&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel vesa fbdev&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finishing touches ===&lt;br /&gt;
&lt;br /&gt;
==== Set timezone ====&lt;br /&gt;
{{cmdroot|cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime}}&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
{{cmdroot|nano /etc/locale.gen}}&lt;br /&gt;
{{cmdroot|locale-gen}}&lt;br /&gt;
&lt;br /&gt;
Set LANG in {{path|/etc/env.d/90locale}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LANG=en_US.utf8&lt;br /&gt;
LC_TIME=de_DE.utf8&lt;br /&gt;
LC_COLLATE=de_DE.utf8&lt;br /&gt;
LC_MONETARY=de_DE.utf8&lt;br /&gt;
LC_NUMERIC=de_DE.utf8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read more here: [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]&lt;br /&gt;
&lt;br /&gt;
== Hardware setup ==&lt;br /&gt;
&lt;br /&gt;
=== WLAN Intel Advanced 6205 ===&lt;br /&gt;
{{cmdroot|emerge wpa_supplicant linux-firmware}}&lt;br /&gt;
{{NOTE| You will see a lot of &amp;quot;DMAR:[DMA Write] Request device [03:00.0] fault addr XXXXXXXX&amp;quot; errors in syslog, caused by the WLAN module/firmware. But the device seems to work just fine}}&lt;br /&gt;
&lt;br /&gt;
= Further installation steps =&lt;br /&gt;
== Emerging the system ==&lt;br /&gt;
=== xorg ===&lt;br /&gt;
{{cmdroot|emerge xorg-x11}}&lt;br /&gt;
The touchpad can be accessed by the evdev and the synaptics driver, which can lead to X11 not starting. &lt;br /&gt;
To fix this add the following lines to {{path|/usr/share/X11/xorg.conf.d/50-synaptics.conf}}.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     MatchDevicePath &amp;quot;/dev/input/event*&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton1&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton2&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
            Option &amp;quot;TapButton3&amp;quot; &amp;quot;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== DPI ====&lt;br /&gt;
{{cmduser|xdpyinfo}} gets the displays dimensions wrong, while {{cmduser|xrandr}} shows the correct screen size (277x156mm). Although it seems to make no big difference (yet), you '''could''' specify the displays dimensions/DPI via one of these two methods manually:&lt;br /&gt;
&lt;br /&gt;
* Via an xorg.conf:&lt;br /&gt;
{{path|/usr/share/X11/xorg.conf.d/10-monitor.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Monitor&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;&amp;lt;default monitor&amp;gt;&amp;quot;&lt;br /&gt;
#    Option   &amp;quot;DPI&amp;quot; &amp;quot;125 x 125&amp;quot;&lt;br /&gt;
    DisplaySize 277 156    # In millimeters&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But this doesn't fix the ''xdpyinfo'' either (at least in my case).&lt;br /&gt;
&lt;br /&gt;
* Via xrandr&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
&lt;br /&gt;
==== KMS ====&lt;br /&gt;
One quick word about Kernel mode-setting (KMS) which comes with Linux 3.0. The i915 driver seems to support it flawlessly and it's really impressing how fast the switch console &amp;lt;-&amp;gt; x11 is done now.&lt;br /&gt;
&lt;br /&gt;
=== GNOME and GDM ===&lt;br /&gt;
{{cmdroot|emerge gnome}}&lt;br /&gt;
&lt;br /&gt;
{{WARN| nss failes to emerge on systems with a 3.0 kernel. See Gentoo Bug 372001 }}&lt;br /&gt;
[https://bugs.gentoo.org/show_bug.cgi?id=372001 Bug 372001] workaround from [https://bugs.gentoo.org/show_bug.cgi?id=372001#c2 here] allows you to emerge nss.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge gdm}}&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager ===&lt;br /&gt;
Emerge a newer version of NetworkManager which comes with a built-in gentoo module. You can read more about the module on [http://qiaomuf.wordpress.com/2010/07/29/good-news-the-plug-in-has-been-added-to-portage/ Mu Qioa's Blog]&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;emerge =net-misc/networkmanager-0.8.2-r10 --autounmask-write&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|rc-update add NetworkManager default}}&lt;br /&gt;
&lt;br /&gt;
Make sure that the ifnet module (gentoo interface handling) is enabled:&lt;br /&gt;
{{path|/etc/NetworkManager/nm-system-settings.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
plugins=ifnet,keyfile&lt;br /&gt;
[ifnet]&lt;br /&gt;
managed=true&lt;br /&gt;
auto_refresh=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ecryptfs home ==&lt;br /&gt;
I have setup an ecryptfs home for my user account and written an how-to about it in the gentoo-wiki. &lt;br /&gt;
Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;br /&gt;
&lt;br /&gt;
== Fingerprint reader ==&lt;br /&gt;
While I don't use the fingerprint reader for auth purposes (It's [http://dasalte.ccc.de/biometrie/fingerabdruck_kopieren?language=en just] [http://www.ccc.de/en/updates/2007/umsonst-im-supermarkt insecure]). &lt;br /&gt;
It would be nice to scan some fingers for fun :-). &lt;br /&gt;
Unfortunately there [https://bugs.freedesktop.org/show_bug.cgi?id=33666 is a bug] in libfprint that fails every enroll with '''&amp;quot;Enroll failed with error -22&amp;quot;'''. Hopefully it will be fixed soon.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|emerge fprint_demo}}&lt;br /&gt;
&lt;br /&gt;
== Extra keys ==&lt;br /&gt;
Another overview can be found [http://www.thinkwiki.org/wiki/Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220#Key_table here]&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
Most keys work out of the box. Tested so far are:&lt;br /&gt;
*  {{key|Fn}}{{key|F2}} lock screen&lt;br /&gt;
*  {{key|Fn}}{{key|F3}} display battery status&lt;br /&gt;
*  {{key|Fn}}{{key|F4}} suspend to RAM&lt;br /&gt;
*  {{key|Fn}}{{key|F5}} enable/disable WLAN (Note that there is also a hardware switch on the left side of the X220 which disabled WLAN '''and''' bluetooth&lt;br /&gt;
*  {{key|Fn}}{{key|End}} and {{key|Fn}}{{key|Pos 1}} brightness controll&lt;br /&gt;
*  Volume up/down/mute incl. sound mute indicator LED&lt;br /&gt;
*  {{ibmkey|ThinkVantage|#495988}}, emits ''XF86Launch1''&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
From [https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Software_Toggle ArchWiki]: Add the following file and make it executable. Then set the file to be executed when XF86TouchpadOn is pressed via System -&amp;gt; Preferences -&amp;gt; Keyboard Shortcuts.&lt;br /&gt;
&lt;br /&gt;
{{Path|&amp;lt;nowiki&amp;gt;/usr/bin/touchpad-toogle&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then&lt;br /&gt;
    synclient TouchpadOff=1&lt;br /&gt;
else&lt;br /&gt;
    synclient TouchpadOff=0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional with some limitations ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. Also the LED is not controllable yet. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
== ThinkLight ==&lt;br /&gt;
Can be enabled and disabled with the hardware button and the /sys interface. More information can be found on [[ThinkLight]]&lt;/div&gt;</summary>
		<author><name>Kanal108</name></author>
		
	</entry>
</feed>