<?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=Flow</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=Flow"/>
	<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/wiki/Special:Contributions/Flow"/>
	<updated>2026-04-08T09:39:08Z</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=54985</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=54985"/>
		<updated>2013-12-02T10:39:11Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* 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 at the moment it's more or less for the advanced gentoo user. Anyways, 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;
{{WARN| Always use an up-to-date BIOS version. Old versions are known to cause problems with shutdown and wakeup after suspend-to-RAM.}}&lt;br /&gt;
&lt;br /&gt;
1. Get the bios update iso (8duj10uc.iso here﻿) from the lenovo support site.&lt;br /&gt;
&lt;br /&gt;
2. Get 'geteltorito' and extract the boot image from the iso (isobar.c probably works too)&lt;br /&gt;
&lt;br /&gt;
{{cmduser|wget '﻿﻿http://www.uni-koblenz.de/~krienke/ftp/noarch/geteltorito/geteltorito.pl﻿'}}&lt;br /&gt;
&lt;br /&gt;
{{cmduser|perl geteltorito.pl ﻿﻿8duj10uc.iso &amp;gt; biosupdate.img}}&lt;br /&gt;
&lt;br /&gt;
3. Copy the image to the usb thumdrive&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|ddrescue biosupdate.img /dev/usbthumdrive}}&lt;br /&gt;
&lt;br /&gt;
Reboot, Press F12 and boot from thumb drive.&lt;br /&gt;
&lt;br /&gt;
The latest BIOS for the X220 can be found [http://support.lenovo.com/en_US/research/hints-or-tips/detail.page?&amp;amp;LegacyDocID=MIGR-77280 here].&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;
{{NOTE|X220s will not boot GPT partitioned drives using Legacy BIOS, so you will have to setup UEFI if you use GPT.}}&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. Because UEFI and GPT a relatively new, I am not so familiar with it and the documentation isn't so good at the time of writing. &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;
Enable GRUB_PLATFORMS=efi-64 in make.conf and emerge &amp;gt;=sys-devel/grub-1.99.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|&amp;lt;nowiki&amp;gt;GRUB_PLATFORMS=&amp;quot;grub_platforms_efi-64&amp;quot; emerge -v sys-boot/grub&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;
* Use the deadline I/0 scheduler when you have an SSD. If you don't have an SSD, use the CFQ scheduler.&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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=54984</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=54984"/>
		<updated>2013-12-02T10:38:47Z</updated>

		<summary type="html">&lt;p&gt;Flow: grub2 is now stable in gentoo&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 at the moment it's more or less for the advanced gentoo user. Anyways, 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;
{{WARN| Always use an up-to-date BIOS version. Old versions are known to cause problems with shutdown and wakeup after suspend-to-RAM.}}&lt;br /&gt;
&lt;br /&gt;
1. Get the bios update iso (8duj10uc.iso here﻿) from the lenovo support site.&lt;br /&gt;
&lt;br /&gt;
2. Get 'geteltorito' and extract the boot image from the iso (isobar.c probably works too)&lt;br /&gt;
&lt;br /&gt;
{{cmduser|wget '﻿﻿http://www.uni-koblenz.de/~krienke/ftp/noarch/geteltorito/geteltorito.pl﻿'}}&lt;br /&gt;
&lt;br /&gt;
{{cmduser|perl geteltorito.pl ﻿﻿8duj10uc.iso &amp;gt; biosupdate.img}}&lt;br /&gt;
&lt;br /&gt;
3. Copy the image to the usb thumdrive&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|ddrescue biosupdate.img /dev/usbthumdrive}}&lt;br /&gt;
&lt;br /&gt;
Reboot, Press F12 and boot from thumb drive.&lt;br /&gt;
&lt;br /&gt;
The latest BIOS for the X220 can be found [http://support.lenovo.com/en_US/research/hints-or-tips/detail.page?&amp;amp;LegacyDocID=MIGR-77280 here].&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;
{{NOTE|X220s will not boot GPT partitioned drives using Legacy BIOS, so you will have to setup UEFI if you use GPT.}}&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. Because UEFI and GPT a relatively new, I am not so familiar with it and the documentation isn't so good at the time of writing. &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;
Enable GRUB_PLATFORMS=efi-64 in make.conf and emerge &amp;gt;=sys-devel/grub-1.99.&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&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;
* Use the deadline I/0 scheduler when you have an SSD. If you don't have an SSD, use the CFQ scheduler.&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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=54983</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=54983"/>
		<updated>2013-12-02T10:36:46Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* 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 at the moment it's more or less for the advanced gentoo user. Anyways, 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;
{{WARN| Always use an up-to-date BIOS version. Old versions are known to cause problems with shutdown and wakeup after suspend-to-RAM.}}&lt;br /&gt;
&lt;br /&gt;
1. Get the bios update iso (8duj10uc.iso here﻿) from the lenovo support site.&lt;br /&gt;
&lt;br /&gt;
2. Get 'geteltorito' and extract the boot image from the iso (isobar.c probably works too)&lt;br /&gt;
&lt;br /&gt;
{{cmduser|wget '﻿﻿http://www.uni-koblenz.de/~krienke/ftp/noarch/geteltorito/geteltorito.pl﻿'}}&lt;br /&gt;
&lt;br /&gt;
{{cmduser|perl geteltorito.pl ﻿﻿8duj10uc.iso &amp;gt; biosupdate.img}}&lt;br /&gt;
&lt;br /&gt;
3. Copy the image to the usb thumdrive&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|ddrescue biosupdate.img /dev/usbthumdrive}}&lt;br /&gt;
&lt;br /&gt;
Reboot, Press F12 and boot from thumb drive.&lt;br /&gt;
&lt;br /&gt;
The latest BIOS for the X220 can be found [http://support.lenovo.com/en_US/research/hints-or-tips/detail.page?&amp;amp;LegacyDocID=MIGR-77280 here].&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;
{{NOTE|X220s will not boot GPT partitioned drives using Legacy BIOS, so you will have to setup UEFI if you use GPT.}}&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. Because UEFI and GPT a relatively new, I am not so familiar with it and the documentation isn't so good at the time of writing. &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;
* Use the deadline I/0 scheduler when you have an SSD. If you don't have an SSD, use the CFQ scheduler.&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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=54093</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=54093"/>
		<updated>2012-11-17T14:59:31Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* BIOS update */&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 at the moment it's more or less for the advanced gentoo user. Anyways, 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;
{{WARN| Always use an up-to-date BIOS version. Old versions are known to cause problems with shutdown and wakeup after suspend-to-RAM.}}&lt;br /&gt;
&lt;br /&gt;
1. Get the bios update iso (8duj10uc.iso here﻿) from the lenovo support site.&lt;br /&gt;
&lt;br /&gt;
2. Get 'geteltorito' and extract the boot image from the iso (isobar.c probably works too)&lt;br /&gt;
&lt;br /&gt;
{{cmduser|wget '﻿﻿http://www.uni-koblenz.de/~krienke/ftp/noarch/geteltorito/geteltorito.pl﻿'}}&lt;br /&gt;
&lt;br /&gt;
{{cmduser|perl geteltorito.pl ﻿﻿8duj10uc.iso &amp;gt; biosupdate.img}}&lt;br /&gt;
&lt;br /&gt;
3. Copy the image to the usb thumdrive&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|ddrescue biosupdate.img /dev/usbthumdrive}}&lt;br /&gt;
&lt;br /&gt;
Reboot, Press F12 and boot from thumb drive.&lt;br /&gt;
&lt;br /&gt;
The latest BIOS for the X220 can be found [http://support.lenovo.com/en_US/research/hints-or-tips/detail.page?&amp;amp;LegacyDocID=MIGR-77280 here].&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;
{{NOTE|X220s will not boot GPT partitioned drives using Legacy BIOS, so you will have to setup UEFI if you use GPT.}}&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;
* Use the deadline I/0 scheduler when you have an SSD. If you don't have an SSD, use the CFQ scheduler.&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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=53579</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=53579"/>
		<updated>2012-03-20T22:02:36Z</updated>

		<summary type="html">&lt;p&gt;Flow: added warning about up to date bios versions&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 at the moment it's more or less for the advanced gentoo user. Anyways, 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;
{{WARN| Always use an up-to-date BIOS version. Old versions are known to cause problems with shutdown and wakeup after suspend-to-RAM.}}&lt;br /&gt;
Turns out to be very Linux '''unfriendly'''. &lt;br /&gt;
I was only able to update the BIOS via the [http://www.thinkwiki.org/wiki/BIOS_Upgrade#Using_grub4dos_.28also_for_Linux.29 grub4dos method].&lt;br /&gt;
&lt;br /&gt;
'''Lenovo could 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;
The latest BIOS for the X220 can be found [http://support.lenovo.com/en_US/research/hints-or-tips/detail.page?&amp;amp;LegacyDocID=MIGR-77280 here].&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;
{{NOTE|X220s will not boot GPT partitioned drives using Legacy BIOS, so you will have to setup UEFI if you use GPT.}}&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;
* Use the deadline I/0 scheduler when you have an SSD. If you don't have an SSD, use the CFQ scheduler.&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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=53578</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=53578"/>
		<updated>2012-03-20T21:16:12Z</updated>

		<summary type="html">&lt;p&gt;Flow: deleted text about wakeup regression, since it's actually an bios problem&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 at the moment it's more or less for the advanced gentoo user. Anyways, 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;
{{NOTE|X220s will not boot GPT partitioned drives using Legacy BIOS, so you will have to setup UEFI if you use GPT.}}&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;
* Use the deadline I/0 scheduler when you have an SSD. If you don't have an SSD, use the CFQ scheduler.&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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=53427</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=53427"/>
		<updated>2012-01-29T11:47:05Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* 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 at the moment it's more or less for the advanced gentoo user. Anyways, 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;
{{NOTE|X220s will not boot GPT partitioned drives using Legacy BIOS, so you will have to setup UEFI if you use GPT.}}&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;
* Use the deadline I/0 scheduler when you have an SSD. If you don't have an SSD, use the CFQ scheduler.&lt;br /&gt;
&lt;br /&gt;
==== Kernel &amp;gt;= 3.1.6 S3R wakeup regression ====&lt;br /&gt;
Kernels 3.1.6 and above are unable to wakeup the notebook after suspend-to-RAM. The cause is currently unknown. The only related bug I found is here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=656433&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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52980</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=52980"/>
		<updated>2011-10-11T08:10:50Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* Installing Gentoo on a Lenovo X220 with UEFI and GPT */&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 at the moment it's more or less for the advanced gentoo user. Anyways, 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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52760</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=52760"/>
		<updated>2011-08-10T09:46:39Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* 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;
&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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52759</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=52759"/>
		<updated>2011-08-10T09:36:25Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* 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;
&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|grub-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}}&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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52758</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=52758"/>
		<updated>2011-08-10T09:31:14Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* 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;
&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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52757</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=52757"/>
		<updated>2011-08-10T09:27:01Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* 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;
&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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
GRUP_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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Integrated_Fingerprint_Reader&amp;diff=52440</id>
		<title>Integrated Fingerprint Reader</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Integrated_Fingerprint_Reader&amp;diff=52440"/>
		<updated>2011-07-30T09:12:31Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* Models featuring this Technology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top;padding-right:20px;width:10px;&amp;quot; | [[Image:fingerprintreader.jpg|IBM Integrated Fingerprint Reader]] __NOTOC__&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;
===Integrated Fingerprint Reader===&lt;br /&gt;
IBMs second generation of T42 models (released in Autumn 2004) was the first to feature an integrated fingerprint reader. Various models since then have had this feature, actually implemented with a number of different devices, all of which appear on the USB bus. Some are just scanners, others do the recognition in the device itself. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! USB ID !! Reader !! Software &lt;br /&gt;
|-&lt;br /&gt;
|0483:2016|| [http://reactivated.net/fprint/wiki/Upekts UPEK/Thomson]  || thinkfinger or fprint &lt;br /&gt;
|-&lt;br /&gt;
|147e:1000|| UPEK TCS4C || unsupported ??&lt;br /&gt;
|-&lt;br /&gt;
|147e:2016|| [http://www.reactivated.net/fprint/wiki/Upeksonly Upeksonly] || [https://bugzilla.redhat.com/show_bug.cgi?id=504399 fprint patches]&lt;br /&gt;
|-&lt;br /&gt;
|08ff:1600|| [http://reactivated.net/fprint/wiki/Aes1610 Authentec AES1610] || fprint &lt;br /&gt;
|-&lt;br /&gt;
|08ff:2580 || [http://reactivated.net/fprint/wiki/Aes2501 Authentec AES2501] || fprint &lt;br /&gt;
|-&lt;br /&gt;
|08ff:2810 || Authentec 2810 || unsupported&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Read more about the various models of reader on the [http://reactivated.net/fprint/wiki/Supported_devices libfprint wiki]&lt;br /&gt;
&lt;br /&gt;
The UPEK device is supported by thinkfinger. Those devices and Authentec ones are supported by libfprint. &lt;br /&gt;
&lt;br /&gt;
However: The fingerprint reader is an INSECURE device and gives a false sense of security! There has been quite a bit of research by a hacker named Starbug, a member of the Chaos Computer Club, Berlin, Germany. He outlined in two very good talks how to forge each and every available fingerprint sensor available at the cost of a few euros, using materials from your local hardware store, a digicam and a laser printer! Here's some links:&lt;br /&gt;
* [http://www.ccc.de/updates/2007/umsonst-im-supermarkt?language=en  Fingerprint recognition in supermarkets]&lt;br /&gt;
* [ftp://ftp.ccc.de/pub/documentation/Fingerabdruck_Hack/fingerabdruck.mpg?language=en Video tutorial for forging fingerprints]&lt;br /&gt;
Remember, using fingerprints for authentication is much similar to having a password which is written on anything you touch.&lt;br /&gt;
&lt;br /&gt;
==Free Software==&lt;br /&gt;
===fprint===&lt;br /&gt;
For some time various projects provided support for various readers. That work mostly been unified under the [http://reactivated.net/fprint/wiki/Main_Page fprint] library, and thus libfprint and libpam-fprint (which provides authentication via PAM) are the best way to go, and in the meantime included by default in most Linux distributions. However, it seems that lately this project has stalled, and no support for newer chips has emerged for some time.&lt;br /&gt;
===Thinkfinger===&lt;br /&gt;
Alternatively, the original Thinkfinger project is at http://thinkfinger.sourceforge.net. It only provides support for the 1st generation reader, and has not been updated since 2007; see the [[How to enable the fingerprint reader with ThinkFinger]] for detailed instructions. It is also in Debian Lenny. This integrates seamlessly with PAM and doesn't produce a tacky graphical prompt.&lt;br /&gt;
&lt;br /&gt;
{{HINT|If you've followed the instructions and &amp;quot;tf-tool --verify&amp;quot; works, but nothing else does, make sure that the &amp;quot;uinput&amp;quot; module is loaded.}}&lt;br /&gt;
&lt;br /&gt;
===Fingerprint GUI===&lt;br /&gt;
Feb 2011: The following works as smoothly on Ubuntu and T410s: https://launchpad.net/~fingerprint/+archive/fingerprint-gui&lt;br /&gt;
&lt;br /&gt;
==Binary Only==&lt;br /&gt;
A closed source driver for the UPEK device is available.  It interfaces to the hardware as a user-space USB driver through {{path|/proc/bus/usb|}} and provides a BioAPI 1.10 device, which can then be interfaced to pam for authentication by user programs.  The driver can be downloaded from [http://www.upek.com/support/downloads/linux/ http://www.upek.com/support/downloads/linux/]; see the [[How to enable the fingerprint reader|corresponding HOWTO]] for detailed instructions. It however tends to be less stable than the above opensource drivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Related Links==&lt;br /&gt;
* [http://www.trustedreviews.com/article.aspx?page=1643&amp;amp;head=36 Review from TrustedReviews of the fingerprint scanner]&lt;br /&gt;
* [http://www.reactivated.net/fprint/wiki/Main_Page fprint project]&lt;br /&gt;
* [http://biomark.org.ru/en/ A (Russian) project that provides support for a (different model) of fingerprint scanner] (also a USB device, though)&lt;br /&gt;
* [http://www.upek.com/support/pdf/UPEK_flyer_TCS3_TCD4.pdf TouchStrip TCS3/TCD4 spec sheet]&lt;br /&gt;
* [http://www.qrivy.net/~michael/blua/ A branch of the BioAPI reference implementation]&lt;br /&gt;
* [http://www.pdfserver.net/fingerprint A Gui using the Bioapi driver on thinkpads. Windows like GDM login]&lt;br /&gt;
* [http://www.n-view.net/Appliance/fingerprint/ Fingerprint GUI Project. Allows to use the fingerprint scanner for Login (GDM) and authentication in (sudo, su). Seems to work with T410 and Ubuntu 10.04]&lt;br /&gt;
&lt;br /&gt;
==Models featuring this Technology==&lt;br /&gt;
'''UPEK Touchstrip (model?) - USB 0483:2016'''&lt;br /&gt;
*ThinkPad {{R52}}, {{R60}}&lt;br /&gt;
*ThinkPad {{T42}}, {{T42p}}, {{T43}}, {{T43p}}, {{T60}}, {{T60p}}, {{T61}}, {{T61p}}&lt;br /&gt;
*ThinkPad {{X41}}, {{X41 Tablet}}, {{X60}}, {{X60s}}, {{X60 Tablet}}, {{X300}}&lt;br /&gt;
*ThinkPad {{Z61t}}, {{Z61p}}, {{Z61m}}&lt;br /&gt;
&lt;br /&gt;
'''UPEK Touchchip TCS4C - USB 147e:1000'''&lt;br /&gt;
*ThinkPad {{SL300}}, {{SL400}}, {{SL500}}&lt;br /&gt;
&lt;br /&gt;
'''UPEK Touchstrip TCRD4C - USB 147e:2016'''&lt;br /&gt;
*ThinkPad {{R61}}, {{R61i}}&lt;br /&gt;
*ThinkPad {{Edge 14&amp;quot;}}, {{Edge 15&amp;quot;}}&lt;br /&gt;
*ThinkPad {{L412}}, {{L512}}&lt;br /&gt;
*ThinkPad {{T400s}}, {{T410}}, {{T410i}}, {{T410s}}, {{T410si}}, {{T420}}, {{T510}}, {{T510i}}&lt;br /&gt;
*ThinkPad {{W510}}, {{W701}}, {{W701ds}}&lt;br /&gt;
*ThinkPad {{X201}}, {{X201i}}, {{X201s}}, {{X201 Tablet}}, {{X220}}&lt;br /&gt;
&lt;br /&gt;
'''Authentec AES1610 - USB 08ff:1600'''&lt;br /&gt;
*Lenovo V100, V200&lt;br /&gt;
&lt;br /&gt;
'''Authentec AES2501 - USB 08ff:2580'''&lt;br /&gt;
*Lenovo N100, N200&lt;br /&gt;
&lt;br /&gt;
'''Authentec AES2810 - USB 08ff:2810'''&lt;br /&gt;
*ThinkPad {{R400}}, {{R500}}&lt;br /&gt;
*ThinkPad {{T400}}, {{T500}}&lt;br /&gt;
*ThinkPad {{W500}}, {{W700}}, {{W700ds}}&lt;br /&gt;
*ThinkPad {{X200}}, {{X200s}}, {{X200 Tablet}}, {{X301}}&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52413</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=52413"/>
		<updated>2011-07-27T08:53:10Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* 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;
&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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Gentoo_compile_flags&amp;diff=52398</id>
		<title>Gentoo compile flags</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Gentoo_compile_flags&amp;diff=52398"/>
		<updated>2011-07-24T09:18:41Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* Which flags to use */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:middle;padding-right:20px;width:10px;&amp;quot; | [[image:Gentoo_logo.png|Gentoo]]&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;
=== Gentoo compile flags ===&lt;br /&gt;
This page gives an introduction to {{Gentoo}} compile flags.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| style=&amp;quot;vertical-align:top;margin-left:20px;margin-right:20px&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
__NOTOC__&lt;br /&gt;
=== About compile flags in Gentoo ===&lt;br /&gt;
One strength of Gentoo is the ability to use global flags for code optimizing. This is done through the file /etc/make.conf ([http://gentoo-wiki.com/MAN_make.conf_5 man page]). Since the Pentium Mobile (Centrino) used in some Thinkpads supports the mmx and sse extensions of the insturuction set, using compile flags can speedup programs quite a bit. To use optimized code, you have to adjust the USE ([http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&amp;amp;chap=2 Gentoo Handbook]) variable, which contains the libraries and extensions you want to use and the CFLAGS variable, which contains compiler flags, that portage passes along to gcc.&lt;br /&gt;
&lt;br /&gt;
If you want to set specific flags for only one package, you can also use the file /etc/portage/package.use instead of the USE variable in make.conf.&lt;br /&gt;
&lt;br /&gt;
=== Which flags to use ===&lt;br /&gt;
Gentoo has a [http://en.gentoo-wiki.com/wiki/Safe_Cflags separate wiki page] for deciding which CFLAGS are right for you. Use your model's page here at ThinkWiki to figure out your processor family, then look it up on that page for the proper CFLAGS. That page may assume that you're using GCC version 4.2, but this is the case on all reasonably modern systems.&lt;br /&gt;
&lt;br /&gt;
Additionally, it may help to include ''some'' of the following USE flags:&lt;br /&gt;
&lt;br /&gt;
 USE=&amp;quot;mmx sse sse2 ssse3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Run the command &amp;quot;cat /proc/cpuinfo&amp;quot; and look through the &amp;quot;flags&amp;quot; section to see which your CPU supports; only include those in your global USE flag.&lt;br /&gt;
&lt;br /&gt;
=== Example files ===&lt;br /&gt;
These are the make.conf and package.use files used for a T40P:&lt;br /&gt;
*make.conf&lt;br /&gt;
 USE=&amp;quot;X mmx mmx2 sse sse2 qt kde -gpm -gtk -gtk2 -gnome -arts -alsa -cups -java -esd -v4l -v4l1 -samba -ipv6 -directfb -lirc -svga&amp;quot;&lt;br /&gt;
 CFLAGS=&amp;quot;-O2 -march=pentium4 -pipe -fomit-frame-pointer&amp;quot;&lt;br /&gt;
 CHOST=&amp;quot;i686-pc-linux-gnu&amp;quot;&lt;br /&gt;
 CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
 MAKEOPTS=&amp;quot;-j2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*package.use&lt;br /&gt;
 sys-libs/glibc userlocales&lt;br /&gt;
 app-laptop/tpb xosd&lt;br /&gt;
 media-video/mplayer dvd xanim divx4linux network xvid live&lt;br /&gt;
 media-libs/xine-lib dvd&lt;br /&gt;
&lt;br /&gt;
This is the make.conf file used for a 64-bit T61 (with Intel X3100 graphics):&lt;br /&gt;
*make.conf&lt;br /&gt;
 CFLAGS=&amp;quot;-march=nocona -O2 -pipe&amp;quot;&lt;br /&gt;
 CXXFLAGS=&amp;quot;${CFLAGS}&amp;quot;&lt;br /&gt;
 MAKEOPTS=&amp;quot;-j5&amp;quot;&lt;br /&gt;
 CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
 VIDEO_CARDS=&amp;quot;vesa vga i810&amp;quot;&lt;br /&gt;
 ALSA_CARDS=&amp;quot;hda-intel&amp;quot; &lt;br /&gt;
 INPUT_DEVICES=&amp;quot;keyboard mouse evdev synaptics&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Other portage features ===&lt;br /&gt;
There are lots of other great features in portage (the Gentoo package managing system). If you want to use Gentoo, you should read the docs on [http://gentoo.org gentoo.org] and the man pages of portage and make.conf.&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52382</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=52382"/>
		<updated>2011-07-22T10:02:50Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* 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 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;
=== 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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52381</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=52381"/>
		<updated>2011-07-22T10:02:11Z</updated>

		<summary type="html">&lt;p&gt;Flow: &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;
=== 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 Grapic: {{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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52380</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=52380"/>
		<updated>2011-07-22T09:57:21Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* KMS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, [[User_talk:Flow|contact me]]}}&lt;br /&gt;
&lt;br /&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;
=== 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 Grapic: {{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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52379</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=52379"/>
		<updated>2011-07-22T09:56:28Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* xorg */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, [[User_talk:Flow|contact me]]}}&lt;br /&gt;
&lt;br /&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;
=== 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 Grapic: {{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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52351</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=52351"/>
		<updated>2011-07-21T14:54:18Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* Extra keys */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, [[User_talk:Flow|contact me]]}}&lt;br /&gt;
&lt;br /&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;
=== 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 Grapic: {{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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
=== 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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52350</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=52350"/>
		<updated>2011-07-21T14:49:49Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* Have no effect */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, [[User_talk:Flow|contact me]]}}&lt;br /&gt;
&lt;br /&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;
=== 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 Grapic: {{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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
=== 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;
&lt;br /&gt;
=== Working ===&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;
=== Have no effect ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. 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>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52349</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=52349"/>
		<updated>2011-07-21T14:28:52Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* Working */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, [[User_talk:Flow|contact me]]}}&lt;br /&gt;
&lt;br /&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;
=== 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 Grapic: {{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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
=== 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;
&lt;br /&gt;
=== Working ===&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;
=== Have no effect ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220&amp;diff=52348</id>
		<title>Installing Ubuntu 11.04 (Natty Narwhal) on a ThinkPad X220</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Installing_Ubuntu_11.04_(Natty_Narwhal)_on_a_ThinkPad_X220&amp;diff=52348"/>
		<updated>2011-07-21T14:27:28Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* Comparison with a Gentoo user's experience */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:Jdthood|I]] installed Ubuntu 11.04 (Natty Narwhal) on a ThinkPad {{X220}}, model 42902GW.&lt;br /&gt;
&lt;br /&gt;
== Netboot ==&lt;br /&gt;
As a source of network installation files I made use of another GNU/Linux computer on my home LAN&lt;br /&gt;
which is connected to the Internet through a familiar ADSL-modem/gateway/router/caching nameserver/DHCP server (call it &amp;quot;the gateway&amp;quot;) at address 172.19.3.1.&lt;br /&gt;
The gateway's DHCP server issues leases in the range 172.19.3.2 to 172.19.3.100.&lt;br /&gt;
&lt;br /&gt;
First I set up the &amp;quot;source&amp;quot; machine, in my case one which already also had Ubuntu 11.04 installed.&lt;br /&gt;
It has address 172.19.3.7 (assigned to it by the gateway's DHCP server).&lt;br /&gt;
For the X220 to boot from it the machine needs to run a DHCP server and a TFTP server.&lt;br /&gt;
The DHCP server serves only this special purpose since, as I mentioned, the gateway is the network's main DHCP server.&lt;br /&gt;
The source's DHCP server must be so configured that it doesn't conflict with the existing DHCP server.&lt;br /&gt;
&lt;br /&gt;
Install the &amp;lt;tt&amp;gt;isc-dhcp-server&amp;lt;/tt&amp;gt; package and edit &amp;lt;tt&amp;gt;/etc/dhcp/dhcpd.conf&amp;lt;/tt&amp;gt; using the following as a model.&lt;br /&gt;
I am not sure that every line is needed, but this worked for me.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ddns-update-style none;&lt;br /&gt;
option domain-name-servers 172.19.3.1;  # This is the address of my gateway&lt;br /&gt;
option routers 172.19.3.1;              # This is the address of my gateway&lt;br /&gt;
option subnet-mask 255.255.0.0;         # This is the netmask of my home network&lt;br /&gt;
default-lease-time 600;&lt;br /&gt;
max-lease-time 7200;&lt;br /&gt;
allow booting;&lt;br /&gt;
allow bootp;&lt;br /&gt;
&lt;br /&gt;
subnet 172.19.3.0 netmask 255.255.255.0 {&lt;br /&gt;
  range 172.19.3.220 172.19.3.229;      # This is a range separate from the one used by the gateway and includes the address below&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
group {&lt;br /&gt;
  next-server 172.19.3.7;               # This is the address of the &amp;quot;source&amp;quot;&lt;br /&gt;
  host trawsfynydd {                    # 'trawsfynydd' is the name I chose for my X220&lt;br /&gt;
    hardware ethernet f0:de:f1:6b:22:bf; # This is the Ethernet address of the X220&lt;br /&gt;
    fixed-address 172.19.3.220;         # This is an address in the range as defined above&lt;br /&gt;
    filename &amp;quot;/pxelinux.0&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now install the &amp;lt;tt&amp;gt;tftpd-hpa&amp;lt;/tt&amp;gt; package, download the network installation tarball and untar it into the location whence &amp;lt;tt&amp;gt;tftpd&amp;lt;/tt&amp;gt; serves files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /tmp&lt;br /&gt;
$ wget http://archive.ubuntu.com/ubuntu/dists/natty/main/installer-amd64/current/images/netboot/netboot.tar.gz&lt;br /&gt;
$ cd /var/lib/tftpboot&lt;br /&gt;
$ sudo tar zxf /tmp/netboot.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Second set up the X220 for PXE (Pre-boot eXecution Environment).&lt;br /&gt;
* Switch on the X220 and press F1.  ThinkPad Setup starts.&lt;br /&gt;
* Set Config | Network | Ethernet LAN Option ROM to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
* Select Startup | Boot; select &amp;quot;PCI LAN IBA GE Slot...&amp;quot; and use the [+] key to move it to the top of the boot priority order&lt;br /&gt;
* Press F10 to save and exit.&lt;br /&gt;
&lt;br /&gt;
Voilà, the X220 boots the Ubuntu installer.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
I won't describe the Ubuntu installer.&lt;br /&gt;
I'll just mention some little problems I had.&lt;br /&gt;
&lt;br /&gt;
''First'', when it came time to resize the existing (ntfs) partition the partitioner asked what size I would like for &amp;quot;this partition&amp;quot;.  Did it mean the to-be-resized ntfs partition or the new ext4 partition?  &lt;br /&gt;
&lt;br /&gt;
Turns out it meant: the to-be-resized ntfs partition, so the suggested &amp;quot;max&amp;quot; selection was the opposite of what I wanted.&lt;br /&gt;
&lt;br /&gt;
''Second'', when I selected (only) the &amp;quot;Ubuntu desktop&amp;quot; task the installation reported failure without explaining what had gone wrong.&lt;br /&gt;
&lt;br /&gt;
I de-selected all tasks and the installation succeeded.&lt;br /&gt;
&lt;br /&gt;
''Third'', after reboot the screen came up black.&lt;br /&gt;
&lt;br /&gt;
I pressed CTRL-ALT-F1 to get the system console so I could log in.&lt;br /&gt;
&lt;br /&gt;
After logging in I ran &amp;lt;tt&amp;gt;tasksel&amp;lt;/tt&amp;gt; and installed &amp;quot;Ubuntu desktop&amp;quot; and this time no failure was reported.&lt;br /&gt;
&lt;br /&gt;
== Information ==&lt;br /&gt;
=== dmidecode ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# dmidecode -s system-manufacturer&lt;br /&gt;
LENOVO&lt;br /&gt;
# dmidecode -s system-product-name&lt;br /&gt;
42902WG&lt;br /&gt;
# dmidecode -s system-version&lt;br /&gt;
ThinkPad X220&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== /proc/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(R) Core(TM) i5-2540M CPU @ 2.60GHz&lt;br /&gt;
stepping	: 7&lt;br /&gt;
cpu MHz		: 800.000&lt;br /&gt;
cache size	: 3072 KB&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 rep_good 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	: 5182.27&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 Chipset Family MEI Controller #1 (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 Chipset Family USB Enhanced Host Controller #2 (rev 04)&lt;br /&gt;
00:1b.0 Audio device: Intel Corporation 6 Series Chipset Family High Definition Audio Controller (rev 04)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 1 (rev b4)&lt;br /&gt;
00:1c.1 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 2 (rev b4)&lt;br /&gt;
00:1c.3 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 4 (rev b4)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 5 (rev b4)&lt;br /&gt;
00:1d.0 USB Controller: Intel Corporation 6 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation 6 Series Chipset Family LPC Controller (rev 04)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series Chipset Family 6 port SATA AHCI Controller (rev 04)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 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 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
Bus 001 Device 006: ID 04f2:b217 Chicony Electronics Co., Ltd &lt;br /&gt;
Bus 001 Device 005: ID 0a5c:217f Broadcom Corp. Bluetooth Controller&lt;br /&gt;
Bus 001 Device 004: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor&lt;br /&gt;
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub&lt;br /&gt;
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Accessories ==&lt;br /&gt;
Accessories I purchased for this laptop:&lt;br /&gt;
* [[ThinkPad UltraBase Series 3]] with [[Ultrabay Slim]] and DVD-burner&lt;br /&gt;
* 1.95Ah battery FRU 42T4901 ASM 42T4902&lt;br /&gt;
* 8,4 Ah battery FRU 42T4942 ASM 42T4872&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
* Having installed bare Ubuntu I had to run &amp;lt;tt&amp;gt;tasksel&amp;lt;/tt&amp;gt; and select at least &amp;quot;Ubuntu Desktop&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* In order to allow NetworkManager to manage eth0 I had to comment out the &amp;quot;eth0&amp;quot; stanza in &amp;lt;tt&amp;gt;/etc/network/interfaces&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* I used System Settings | Ubuntu Software Center to install &amp;lt;tt&amp;gt;ccsm&amp;lt;/tt&amp;gt; (&amp;quot;Advanced Desktop Effects Settings&amp;quot;) so I could enable Wobbly Windows and so I can initiate window resize with Alt+Button3 which is easier than the default Alt-Button2 (i.e., Alt-scrollwheelbutton).&lt;br /&gt;
&lt;br /&gt;
* Add PPAs to apt sources list for additional indicators&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configuration fixing known problems ===&lt;br /&gt;
==== Fix for [https://bugs.freedesktop.org/show_bug.cgi?id=11227 zoom key shortcoming] ====&lt;br /&gt;
By default the Zoom hotkey (Fn-Space) does nothing in the GUI.  The &amp;lt;tt&amp;gt;thinkpad-acpi&amp;lt;/tt&amp;gt; module and the kernel map its ACPI event correctly to input event KEY_ZOOM (372), but this number is out of the range of key event codes (maximum 255) that X can handle.&lt;br /&gt;
&lt;br /&gt;
A workaround is to add a &amp;lt;tt&amp;gt;keymap.rules&amp;lt;/tt&amp;gt; file to &amp;lt;tt&amp;gt;/etc/udev/rules.d/&amp;lt;/tt&amp;gt; to cause the ACPI event to be remapped to some other input event.&lt;br /&gt;
The following file maps Fn-Space to &amp;quot;search&amp;quot; which becomes X event XF86Search.&lt;br /&gt;
The key can thereby be assigned a function in System Settings | Keyboard Shortcuts.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ACTION==&amp;quot;remove&amp;quot;, GOTO=&amp;quot;keyboard_end&amp;quot;&lt;br /&gt;
SUBSYSTEM!=&amp;quot;input&amp;quot;, GOTO=&amp;quot;keyboard_end&amp;quot;&lt;br /&gt;
KERNEL!=&amp;quot;event*&amp;quot;, GOTO=&amp;quot;keyboard_end&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ENV{DMI_VENDOR}==&amp;quot;LENOVO*&amp;quot;, KERNELS==&amp;quot;input*&amp;quot;, ATTRS{name}==&amp;quot;ThinkPad Extra Buttons&amp;quot;, RUN+=&amp;quot;keymap $name 0x13 search&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;keyboard_end&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Fix for [[Installing Ubuntu 9.10 (Karmic Koala) on a ThinkPad X61#Partially solved problem: No beep|no-beep bug]] ====&lt;br /&gt;
* To fix [https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/486154 the known no-system-beep problem] create &amp;lt;tt&amp;gt;.xprofile&amp;lt;/tt&amp;gt; containing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pactl upload-sample /usr/share/sounds/gnome/default/alerts/glass.ogg bell.ogg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and run &amp;lt;tt&amp;gt;gconf-editor&amp;lt;/tt&amp;gt; and at &amp;lt;tt&amp;gt;desktop | gnome | peripherals | keyboard&amp;lt;/tt&amp;gt; change the value of &amp;lt;tt&amp;gt;bell_mode&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;off&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;on&amp;lt;/tt&amp;gt;.&lt;br /&gt;
Also comment out the &amp;lt;tt&amp;gt;blacklist pcspkr&amp;lt;/tt&amp;gt; line in &amp;lt;tt&amp;gt;/etc/modprobe.d/blacklist.conf&amp;lt;/tt&amp;gt; so that non-X terminal bells can also be heard.&lt;br /&gt;
&lt;br /&gt;
==== Fix for &amp;quot;[drm:i915_hangcheck_ring_idle] *ERROR* Hangcheck timer elapsed... blt ring idle...&amp;quot; problem ====&lt;br /&gt;
* To fix [https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/761065 this known problem] upgrade Linux to the version in the &amp;lt;tt&amp;gt;linux-image-2.6.38-11-generic&amp;lt;/tt&amp;gt; package.linux-image-2.6.38-11-generic&lt;br /&gt;
&lt;br /&gt;
== Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Multiple monitors ===&lt;br /&gt;
Configuring an extended desktop over two monitors leads often to malfunction.  Side-by-side works, one above the other does not.&lt;br /&gt;
&lt;br /&gt;
I recommend to new users of natty that they avoid changing configuration defaults as much as possible.&lt;br /&gt;
&lt;br /&gt;
=== Suspend causes kernel panic ===&lt;br /&gt;
&amp;quot;Suspend-to-RAM and brightness control of the display work with kernel &amp;gt;= 3.0-rc6&amp;quot; according to [[Installing Gentoo on a ThinkPad X220|this fellow]].&lt;br /&gt;
&lt;br /&gt;
=== [[Tp smapi|tp-smapi]] won't load ===&lt;br /&gt;
The &amp;lt;tt&amp;gt;tp-smapi&amp;lt;/tt&amp;gt; module doesn't load on the X220.&lt;br /&gt;
Correspondingly, &amp;lt;tt&amp;gt;thinkpad-acpi&amp;lt;/tt&amp;gt; reports the EC firmware number as &amp;quot;unknown&amp;quot;.&lt;br /&gt;
Furthermore the &amp;lt;tt&amp;gt;hdaps&amp;lt;/tt&amp;gt; driver won't load&amp;amp;mdash;neither the stock version nor the tp-smapi variant.&lt;br /&gt;
&lt;br /&gt;
A fix seems to be in the works.&lt;br /&gt;
&lt;br /&gt;
=== TPM can't be used ===&lt;br /&gt;
To try it out, install &amp;lt;tt&amp;gt;tpm-tools&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;tpm_version&amp;lt;/tt&amp;gt; fails with &amp;quot;Communication failure&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Comparison with [[Installing Ubuntu 10.10 (Maverick Meerkat) on a ThinkPad X220|a Ubuntu 10.10 user's experience]] ==&lt;br /&gt;
* (improvements)&lt;br /&gt;
** I didn't have to do anything special to have the &amp;lt;tt&amp;gt;thinkpad-acpi&amp;lt;/tt&amp;gt; module loaded or use special keys&lt;br /&gt;
** Both microphones are seen&lt;br /&gt;
** I have no difficulties with the fans&lt;br /&gt;
** I have no difficulties with SD cards&lt;br /&gt;
** The &amp;quot;Hangcheck timer elapsed&amp;quot; problem has been fixed in a new kernel version, as described above&lt;br /&gt;
* (disimprovements)&lt;br /&gt;
** Suspend doesn't always work&lt;br /&gt;
&lt;br /&gt;
== Things to look into ==&lt;br /&gt;
* Thoroughly test docking and undocking&lt;br /&gt;
* Thoroughly test suspending and resuming&lt;br /&gt;
&lt;br /&gt;
== Key table ==&lt;br /&gt;
&lt;br /&gt;
This table was prepared with local key remapping, discussed elsewhere on this page, disabled.&lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
* [https://wiki.ubuntu.com/Hotkeys Hotkey architecture in Ubuntu]&lt;br /&gt;
* [https://wiki.ubuntu.com/Hotkeys/Troubleshooting Hotkey troubleshooting instructions]&lt;br /&gt;
* &amp;lt;tt&amp;gt;/usr/include/linux/input.h&amp;lt;/tt&amp;gt; -- list of Linux key codes&lt;br /&gt;
* [[Default meanings of special keys]]&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
! Key combination !! Extra function symbol !! Scan code&amp;lt;br&amp;gt;(&amp;lt;tt&amp;gt;showkey&amp;amp;nbsp;-s&amp;lt;/tt&amp;gt;)&amp;lt;br&amp;gt;&amp;lt;i&amp;gt;(hex)&amp;lt;/i&amp;gt; !! Linux key code&amp;lt;br&amp;gt;(&amp;lt;tt&amp;gt;showkey&amp;amp;nbsp;-k&amp;lt;/tt&amp;gt;) !! Input event&amp;lt;br&amp;gt;(&amp;lt;tt&amp;gt;input-events&amp;lt;/tt&amp;gt;) !! ... on input device(*) !! ACPI event&amp;lt;br&amp;gt;(&amp;lt;tt&amp;gt;acpi_listen&amp;lt;/tt&amp;gt;) !! X event&amp;lt;br&amp;gt;(&amp;lt;tt&amp;gt;xev&amp;lt;/tt&amp;gt;) !! Keyboard Shortcuts name&lt;br /&gt;
|-&lt;br /&gt;
| {{key|&amp;amp;#x1F4E2;&amp;amp;#x20E5;}} (loudspeaker icon with stroke) || || down: e0 20&amp;lt;br&amp;gt;up: e0 a0 || 113 || KEY_MIN_INTERESTING (0x71) || 3 || (none) || 121 || XF86AudioMute&lt;br /&gt;
|-&lt;br /&gt;
| {{key|-&amp;amp;#x1F4E2;}} (minus sign, loudspeaker icon) || || down: e0 2e&amp;lt;br&amp;gt;up: e0 ae || 114 || KEY_VOLUMEDOWN (0x72) || 3 || (none) ||122 || XF86AudioLowerVolume&lt;br /&gt;
|-&lt;br /&gt;
| {{key|&amp;amp;#x1F4E2;+}} (loudspeaker icon, plus sign)  || || down: e0 30&amp;lt;br&amp;gt;up: e0 b0 || 115 || KEY_VOLUMEUP (0x73) || 3 || (none) || 123 || XF86AudioRaiseVolume&lt;br /&gt;
|-&lt;br /&gt;
| {{key|&amp;amp;#x1F3A4;&amp;amp;#x20E5;}} (microphone icon with stroke)  || || (none) || 240 (rop) || KEY_UNKNOWN (0xf0) || 6 || ibm/hotkey HKEY 00000080 0000101b || 248 || &amp;quot;∅&amp;quot; (sic)&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|ThinkVantage|#495988}}                   || || down: e0 1f e0 9f || 148 (rop) || KEY_PROG1 (0x94) || 6 || ibm/hotkey HKEY 00000080 00001018 || 156 || XF86Launch1&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}                             || || up: e0 63 e0 e3 || 143 || KEY_WAKEUP (0x8f) || 3 || (none) || 151 || XF86WakeUp&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|F1|#494949}}       || ||       (none)    || 466 (rop) || KEY_FN_F1 (0x1d2) || 6 || ibm/hotkey HKEY 00000080 00001001 || (none) || (none)&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|F2|#494949}}       || &amp;amp;#x1F512; (padlock symbol) || down: e0 12 e0 92 || 152 (rop) || KEY_SCREENLOCK (0x98) || 6 || ibm/hotkey HKEY 00000080 00001002 || 160 || XF86ScreenSaver&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|F3|#494949}}       || &amp;amp;#x1F50B; (battery symbol) || down: e0 71 e0 f1 || 236 (rop) || KEY_BATTERY (0xec) || 6 || ibm/hotkey HKEY 00000080 00001003 || 244 || XF86Battery&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|F4|#494949}}       || ☾ || down: e0 5f e0 df&amp;lt;br&amp;gt;(but sometimes nothing) || 142 (rop) || KEY_SLEEP (0x8e) || 6 || ibm/hotkey HKEY 00000080 00001004 || 150 || XF86Sleep&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|F5|#494949}}       || &amp;amp;#x2E28;&amp;amp;#x1F4BB;&amp;amp;#x2E29; (radiating computer symbol) || down: e0 73 e0 f3 || 238 (rop) || KEY_WLAN (0xee) || 6  || ibm/hotkey HKEY 00000080 00001005 || 246 || XF86WLAN&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|F6|#494949}}       || (camera, headset) || down: e0 3b e0 bb || 212 (rop) || KEY_CAMERA (0xd4) || 6 || ibm/hotkey HKEY 00000080 00001006 || 220 || XF86WebCam&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|F7|#494949}}       || &amp;amp;#x1F4BB;&amp;amp;#x239A; (computer symbol, screen symbol) || down: e0 56 e0 d6 || 227 (rop) || KEY_SWITCHVIDEOMODE (0xe3) || 6 || ibm/hotkey HKEY 00000080 00001007 || 235 || XF86Display&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|F8|#494949}}       || (trackpoint symbol, vertical bar, trackpad symbol) || down: e0 74 e0 f4 || 191 (rop) || KEY_F21 (0xbf) || 6 || ibm/hotkey HKEY 00000080 00001008 || 199 || XF86TouchpadToggle&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|F9|#494949}}       || || down: 6f ef || 194 (rop) || KEY_F24 (0xc2) || 6 || ibm/hotkey HKEY 00000080 00001009 || 202 || &amp;quot;Ê&amp;quot; (sic)&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|F10|#494949}}      || ||      (none) ||                        ||  (none)    ||   || (none) || (none) || (none)&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|F11|#494949}}      || || (none) || 476 (rop) || KEY_FN_F11 (0x1dc) || 6 || ibm/hotkey HKEY 00000080 0000100b || (none) || (none)&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|F12|#494949}}      || &amp;amp;#x1F4BB;&amp;amp;nbsp;&amp;amp;#x25B6;&amp;amp;#x274D; (computer symbol, right arrowhead, diskpack symbol) || down: e0 25 e0 a5&amp;lt;br&amp;gt;(but sometimes nothing) || 205 (rop) || KEY_SUSPEND (0xcd) || 6 || ibm/hotkey HKEY 00000080 0000100c || 213 || XF86Suspend&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|Home|#494949}}     || ☀▴ || down: e0 54 e0 d4 e0 54 e0 d4 || 225 (double) (rop) || KEY_BRIGHTNESSUP (0xe1) || 4, 6 || ibm/hotkey HKEY 00000080 00001010 and video LCD0 00000086 00000000 || 233 || XF86MonBrightnessUp&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|End|#494949}}      || ☀▾ || down: e0 4c e0 cc e0 4c e0 cc || 224 (double) (rop) || KEY_BRIGHTNESSDOWN (0xe0) || 4, 6 || ibm/hotkey HKEY 00000080 00001011 and  video LCD0 00000087 00000000 || 232 || XF86MonBrightnessDown&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|PgUp|#494949}}     || (illuminating overhead lamp symbol) || (none) || (none) || (none) || (none) || (none) || (none) || (none)&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|Space|#494949}}    || [&amp;amp;#x1F50D;+] (screen with magnifying glass symbol and plus sign, i.e., &amp;quot;zoom&amp;quot; symbol) || (none) || 372 (rop) || KEY_ZOOM (0x174) || 6 || ibm/hotkey HKEY 00000080 00001014 || (none) || (none)&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|→|#494949}}        || &amp;amp;#x23ED; (barred right arrowhead, i.e., &amp;quot;next&amp;quot; symbol) || down: e0 19&amp;lt;br&amp;gt;up: e0 99 || 163 || KEY_NEXTSONG (0xa3) || 3 || (none) || 171 || XF86AudioNext&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|↓|#494949}}        || &amp;amp;#x23EF; (right arrowhead, double bar, i.e., &amp;quot;play/pause&amp;quot; symbol) || down: e0 22&amp;lt;br&amp;gt;up: e0 a2 || 164 || KEY_PLAYPAUSE (0xa4) || 3 || (none) || 172 || XF86AudioPlay&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|←|#494949}}        || &amp;amp;#x23EE; (barred left arrowhead, i.e., &amp;quot;prev&amp;quot; symbol) || down: e0 10&amp;lt;br&amp;gt;up: e0 90 || 165 || KEY_PREVIOUSSONG (0xa5) || 3 || (none) || 173 || XF86AudioPrev&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|Fn|#494949}}-{{ibmkey|↑|#494949}}        || ∎ (&amp;quot;stop play&amp;quot; symbol) || down: e0 24&amp;lt;br&amp;gt;up: e0 a4 || 166 || KEY_STOPCD (0xa6) || 3 || (none) || 174 || XF86AudioStop&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|◂ ⎗|#494949}} (left arrowhead, page icon) || || down: e0 6a&amp;lt;br&amp;gt;up: e0 ea || 158 || KEY_BACK (0x9e) || 3 || (none) || 166 || XF86Back&lt;br /&gt;
|-&lt;br /&gt;
| {{ibmkey|⎘ ▸|#494949}} (page icon, right arrowhead) || || down: e0 69&amp;lt;br&amp;gt;up: e0 e9 || 159 || KEY_FORWARD (0x9f) || 3 || (none) || 167 || XF86Forward&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the Linux key code column, &amp;quot;rop&amp;quot; means &amp;quot;release on press&amp;quot;, i.e., the release event is generated at the same time as the press event.&lt;br /&gt;
&lt;br /&gt;
The button on the UltraBase doesn't seem to generate any events visible to userspace.&lt;br /&gt;
&lt;br /&gt;
Input device numbers and types as reported by &amp;lt;tt&amp;gt;lsinput&amp;lt;/tt&amp;gt;:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|+ (*) /dev/input/event&amp;lt;i&amp;gt;n&amp;lt;/i&amp;gt;&lt;br /&gt;
! n !! name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &amp;quot;Lid Switch&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &amp;quot;Sleep Button&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 2 || &amp;quot;Power Button&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || &amp;quot;AT Translated Set @ keyboard&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;quot;Video Bus&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 5 || &amp;quot;Integrated Camera&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 6 || &amp;quot;ThinkPad Extra Buttons&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 7 || &amp;quot;SynPS/2 Synaptics TouchPad&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 8 || &amp;quot;TPPS/2 IBM TrackPoint&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Hotkey mask when the above table was compiled:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cat /sys/devices/platform/thinkpad_acpi/hotkey_mask&lt;br /&gt;
0x078dffff&lt;br /&gt;
$ cat /sys/devices/platform/thinkpad_acpi/hotkey_all_mask&lt;br /&gt;
0x07ffffff&lt;br /&gt;
$ cat /sys/devices/platform/thinkpad_acpi/hotkey_recommended_mask&lt;br /&gt;
0x078dffff&lt;br /&gt;
$ cat /sys/devices/platform/thinkpad_acpi/hotkey_report_mode&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52347</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=52347"/>
		<updated>2011-07-21T11:28:21Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* Finishing touches */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, [[User_talk:Flow|contact me]]}}&lt;br /&gt;
&lt;br /&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;
=== 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 Grapic: {{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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
=== 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;
&lt;br /&gt;
=== Working ===&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;
*  ThinkVintage Button, 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;
=== Have no effect ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52121</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=52121"/>
		<updated>2011-07-13T15:07:09Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* DPI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, [[User_talk:Flow|contact me]]}}&lt;br /&gt;
&lt;br /&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;
=== 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 Grapic: {{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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone.&lt;br /&gt;
&lt;br /&gt;
Set locale.gen.&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;
=== 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;
&lt;br /&gt;
=== Working ===&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;
*  TinkVintage Button, 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;
=== Have no effect ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52105</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=52105"/>
		<updated>2011-07-12T20:44:18Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* DPI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, [[User_talk:Flow|contact me]]}}&lt;br /&gt;
&lt;br /&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;
=== 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 Grapic: {{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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone.&lt;br /&gt;
&lt;br /&gt;
Set locale.gen.&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;
It seems that the display is reporting false dimensions, which results in a wrong computation of the DPI and therefore ugly fonts. Specifying the DPI/Dimensions manually via&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;
doesn't help either (at least in my case).&lt;br /&gt;
Only&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
sets the right DPI.&lt;br /&gt;
You can verify the current DPI setting with&lt;br /&gt;
{{cmduser|&amp;lt;nowiki&amp;gt;xdpyinfo |grep dot&amp;lt;/nowiki&amp;gt;}}&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;
&lt;br /&gt;
=== Working ===&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;
*  TinkVintage Button, 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;
=== Have no effect ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52104</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=52104"/>
		<updated>2011-07-12T20:42:54Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* DPI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, [[User_talk:Flow|contact me]]}}&lt;br /&gt;
&lt;br /&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;
=== 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 Grapic: {{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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone.&lt;br /&gt;
&lt;br /&gt;
Set locale.gen.&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;
It seems that the display is reporting false dimensions, which results in a wrong computation of the DPI and therefore ugly fonts. Settings the DPI/Dimensions manually via&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;
doesn't help in my case either.&lt;br /&gt;
Only&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
sets the right DPI in my case.&lt;br /&gt;
You can verify the current DPI setting with&lt;br /&gt;
{{cmduser|&amp;lt;nowiki&amp;gt;xdpyinfo |grep dot&amp;lt;/nowiki&amp;gt;}}&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;
&lt;br /&gt;
=== Working ===&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;
*  TinkVintage Button, 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;
=== Have no effect ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52103</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=52103"/>
		<updated>2011-07-12T20:42:12Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* DPI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, [[User_talk:Flow|contact me]]}}&lt;br /&gt;
&lt;br /&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;
=== 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 Grapic: {{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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone.&lt;br /&gt;
&lt;br /&gt;
Set locale.gen.&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;
It seems that the display is reporting false dimensions, which results in a wrong computation of the DPI and therefore ugly fonts. Settings the DPI/Dimensions manually via&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;
doesn't help in my case either.&lt;br /&gt;
Only&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
sets the right DPI in my case.&lt;br /&gt;
You can verify the current DPI setting with&lt;br /&gt;
{{cmduser|xdpyinfo |grep dot}}&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;
&lt;br /&gt;
=== Working ===&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;
*  TinkVintage Button, 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;
=== Have no effect ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52102</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=52102"/>
		<updated>2011-07-12T20:41:12Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* xorg */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, [[User_talk:Flow|contact me]]}}&lt;br /&gt;
&lt;br /&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;
=== 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 Grapic: {{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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone.&lt;br /&gt;
&lt;br /&gt;
Set locale.gen.&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;
It seems that the display is reporting false dimensions, which results in a wrong computation of the DPI and therefore ugly fonts. Settings the DPI/Dimensions manually via&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;
doesn't help in my case either.&lt;br /&gt;
Only&lt;br /&gt;
{{cmduser|xrandr --dpi 125}}&lt;br /&gt;
sets the right DPI in my case.&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;
&lt;br /&gt;
=== Working ===&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;
*  TinkVintage Button, 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;
=== Have no effect ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=User:Flow&amp;diff=52036</id>
		<title>User:Flow</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=User:Flow&amp;diff=52036"/>
		<updated>2011-07-10T12:12:02Z</updated>

		<summary type="html">&lt;p&gt;Flow: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Installing Gentoo on a ThinkPad X220]]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=User:Flow&amp;diff=52029</id>
		<title>User:Flow</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=User:Flow&amp;diff=52029"/>
		<updated>2011-07-10T11:58:55Z</updated>

		<summary type="html">&lt;p&gt;Flow: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Install Gentoo on a ThinkPad X220]]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=User_talk:Flow&amp;diff=52028</id>
		<title>User talk:Flow</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=User_talk:Flow&amp;diff=52028"/>
		<updated>2011-07-10T11:56:55Z</updated>

		<summary type="html">&lt;p&gt;Flow: â†Created page with 'My talk page :)'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My talk page :)&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52027</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=52027"/>
		<updated>2011-07-10T11:55:30Z</updated>

		<summary type="html">&lt;p&gt;Flow: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, [[User_talk:Flow|contact me]]}}&lt;br /&gt;
&lt;br /&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;
=== 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 Grapic: {{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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone.&lt;br /&gt;
&lt;br /&gt;
Set locale.gen.&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;
&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;
&lt;br /&gt;
=== Working ===&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;
*  TinkVintage Button, 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;
=== Have no effect ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52026</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=52026"/>
		<updated>2011-07-10T09:17:36Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* WLAN Intel Advanced 6205 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, contact me}}&lt;br /&gt;
&lt;br /&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;
=== 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 Grapic: {{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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone.&lt;br /&gt;
&lt;br /&gt;
Set locale.gen.&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;
&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;
&lt;br /&gt;
=== Working ===&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;
*  TinkVintage Button, 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;
=== Have no effect ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52021</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=52021"/>
		<updated>2011-07-07T21:26:07Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* Kernel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, contact me}}&lt;br /&gt;
&lt;br /&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;
=== 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 Grapic: {{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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone.&lt;br /&gt;
&lt;br /&gt;
Set locale.gen.&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. 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;
&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;
&lt;br /&gt;
=== Working ===&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;
*  TinkVintage Button, 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;
=== Have no effect ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52020</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=52020"/>
		<updated>2011-07-07T21:23:44Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* General specs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, contact me}}&lt;br /&gt;
&lt;br /&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;
=== 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 Grapic: {{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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
=== 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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone.&lt;br /&gt;
&lt;br /&gt;
Set locale.gen.&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. 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;
&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;
&lt;br /&gt;
=== Working ===&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;
*  TinkVintage Button, 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;
=== Have no effect ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52019</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=52019"/>
		<updated>2011-07-07T21:21:43Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* Have no effect */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, contact me}}&lt;br /&gt;
&lt;br /&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)&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 Grapic: {{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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
=== 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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone.&lt;br /&gt;
&lt;br /&gt;
Set locale.gen.&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. 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;
&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;
&lt;br /&gt;
=== Working ===&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;
*  TinkVintage Button, 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;
=== Have no effect ===&lt;br /&gt;
*  {{Key|MicMute}} emits keycode 248. There is currently some lack of support for this feature. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52018</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=52018"/>
		<updated>2011-07-07T21:21:02Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* Gentoo stage3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, contact me}}&lt;br /&gt;
&lt;br /&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)&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 Grapic: {{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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
=== 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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone.&lt;br /&gt;
&lt;br /&gt;
Set locale.gen.&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. 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;
&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;
&lt;br /&gt;
=== Working ===&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;
*  TinkVintage Button, 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;
=== Have no effect ===&lt;br /&gt;
*  {{MicMute}} emits keycode 248. There is currently some lack of support for this feature. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52017</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=52017"/>
		<updated>2011-07-07T21:18:04Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* Grub with EFI support installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, contact me}}&lt;br /&gt;
&lt;br /&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)&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 Grapic: {{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 handbook, boot from gentoo-minimal-image. &lt;br /&gt;
Unpack stage3 and portage. &lt;br /&gt;
Edit fstab and 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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
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|grub-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}}&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;
=== 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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone.&lt;br /&gt;
&lt;br /&gt;
Set locale.gen.&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. 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;
&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;
&lt;br /&gt;
=== Working ===&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;
*  TinkVintage Button, 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;
=== Have no effect ===&lt;br /&gt;
*  {{MicMute}} emits keycode 248. There is currently some lack of support for this feature. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=52016</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=52016"/>
		<updated>2011-07-07T21:15:37Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* Grub with EFI support installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, contact me}}&lt;br /&gt;
&lt;br /&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)&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 Grapic: {{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 handbook, boot from gentoo-minimal-image. &lt;br /&gt;
Unpack stage3 and portage. &lt;br /&gt;
Edit fstab and 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;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. Or 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;
{{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|grub-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}}&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;
=== 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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone.&lt;br /&gt;
&lt;br /&gt;
Set locale.gen.&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. 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;
&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;
&lt;br /&gt;
=== Working ===&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;
*  TinkVintage Button, 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;
=== Have no effect ===&lt;br /&gt;
*  {{MicMute}} emits keycode 248. There is currently some lack of support for this feature. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=51947</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=51947"/>
		<updated>2011-07-06T19:49:12Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* working */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, contact me}}&lt;br /&gt;
&lt;br /&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)&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(R) Core(TM) i5-2520M CPU @ 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KB&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;
&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 Grapic: {{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'''. There a ways to boot the .iso image with grub. I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. But got stuck there. After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. '''Lenovo has to do better here'''. 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. 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 handbook, boot from gentoo-minimal-image. Unpack stage3 and portage. Edit fstab and set a root password. 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. Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set. If it finds one it tries to start /EFI/boot/bootx64.efi (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. TODO add tar.gz with fixed ebuild for adding to overlay&lt;br /&gt;
&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|grub-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}}&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)]. Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. The config is hosted as github gist, so you can easily ask for merges with your version. This is work in progress :)&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone&lt;br /&gt;
&lt;br /&gt;
Set locale.gen&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. 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. 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;
&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;
=== Network Manager ===&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. 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]). It would be nice to scan some fingers for fun :-). 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;
=== working ===&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;
*  TinkVintage Button, 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;
=== Have no effect ===&lt;br /&gt;
*  {{MicMute}} emits keycode 248. There is currently some lack of support for this feature. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=51946</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=51946"/>
		<updated>2011-07-06T19:48:35Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* TODO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, contact me}}&lt;br /&gt;
&lt;br /&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)&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(R) Core(TM) i5-2520M CPU @ 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KB&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;
&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 Grapic: {{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'''. There a ways to boot the .iso image with grub. I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. But got stuck there. After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. '''Lenovo has to do better here'''. 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. 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 handbook, boot from gentoo-minimal-image. Unpack stage3 and portage. Edit fstab and set a root password. 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. Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set. If it finds one it tries to start /EFI/boot/bootx64.efi (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. TODO add tar.gz with fixed ebuild for adding to overlay&lt;br /&gt;
&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|grub-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}}&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)]. Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. The config is hosted as github gist, so you can easily ask for merges with your version. This is work in progress :)&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone&lt;br /&gt;
&lt;br /&gt;
Set locale.gen&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. 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. 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;
&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;
=== Network Manager ===&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. 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]). It would be nice to scan some fingers for fun :-). 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;
=== working ===&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&lt;br /&gt;
*  TinkVintage Button, 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;
=== Have no effect ===&lt;br /&gt;
*  {{MicMute}} emits keycode 248. There is currently some lack of support for this feature. See these [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/408903 two] [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/788540 bugs]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=51945</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=51945"/>
		<updated>2011-07-06T19:43:59Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* Extra Keys */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, contact me}}&lt;br /&gt;
&lt;br /&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)&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(R) Core(TM) i5-2520M CPU @ 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KB&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;
&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 Grapic: {{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'''. There a ways to boot the .iso image with grub. I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. But got stuck there. After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. '''Lenovo has to do better here'''. 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. 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 handbook, boot from gentoo-minimal-image. Unpack stage3 and portage. Edit fstab and set a root password. 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. Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set. If it finds one it tries to start /EFI/boot/bootx64.efi (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. TODO add tar.gz with fixed ebuild for adding to overlay&lt;br /&gt;
&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|grub-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}}&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)]. Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. The config is hosted as github gist, so you can easily ask for merges with your version. This is work in progress :)&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone&lt;br /&gt;
&lt;br /&gt;
Set locale.gen&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. 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. 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;
&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;
=== Network Manager ===&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. 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]). It would be nice to scan some fingers for fun :-). 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;
=== working ===&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&lt;br /&gt;
*  TinkVintage Button, 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;
=== TODO ===&lt;br /&gt;
*  {{MicMute}} emits keycode 240&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=51944</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=51944"/>
		<updated>2011-07-06T19:30:56Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* TODO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, contact me}}&lt;br /&gt;
&lt;br /&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)&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(R) Core(TM) i5-2520M CPU @ 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KB&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;
&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 Grapic: {{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'''. There a ways to boot the .iso image with grub. I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. But got stuck there. After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. '''Lenovo has to do better here'''. 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. 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 handbook, boot from gentoo-minimal-image. Unpack stage3 and portage. Edit fstab and set a root password. 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. Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set. If it finds one it tries to start /EFI/boot/bootx64.efi (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. TODO add tar.gz with fixed ebuild for adding to overlay&lt;br /&gt;
&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|grub-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}}&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)]. Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. The config is hosted as github gist, so you can easily ask for merges with your version. This is work in progress :)&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone&lt;br /&gt;
&lt;br /&gt;
Set locale.gen&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. 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. 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;
&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;
=== Network Manager ===&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. 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]). It would be nice to scan some fingers for fun :-). 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;
=== working ===&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&lt;br /&gt;
*  TinkVintage Button, emits ''XF86Launch1''&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
*  {{MicMute}} emits keycode 240&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=51943</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=51943"/>
		<updated>2011-07-06T19:29:52Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* working */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, contact me}}&lt;br /&gt;
&lt;br /&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)&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(R) Core(TM) i5-2520M CPU @ 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KB&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;
&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 Grapic: {{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'''. There a ways to boot the .iso image with grub. I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. But got stuck there. After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. '''Lenovo has to do better here'''. 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. 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 handbook, boot from gentoo-minimal-image. Unpack stage3 and portage. Edit fstab and set a root password. 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. Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set. If it finds one it tries to start /EFI/boot/bootx64.efi (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. TODO add tar.gz with fixed ebuild for adding to overlay&lt;br /&gt;
&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|grub-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}}&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)]. Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. The config is hosted as github gist, so you can easily ask for merges with your version. This is work in progress :)&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone&lt;br /&gt;
&lt;br /&gt;
Set locale.gen&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. 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. 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;
&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;
=== Network Manager ===&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. 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]). It would be nice to scan some fingers for fun :-). 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;
=== working ===&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&lt;br /&gt;
*  TinkVintage Button, emits ''XF86Launch1''&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
*  {{key|Fn}}{{key|F&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=51942</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=51942"/>
		<updated>2011-07-06T19:29:36Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* Further installation steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, contact me}}&lt;br /&gt;
&lt;br /&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)&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(R) Core(TM) i5-2520M CPU @ 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KB&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;
&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 Grapic: {{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'''. There a ways to boot the .iso image with grub. I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. But got stuck there. After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. '''Lenovo has to do better here'''. 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. 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 handbook, boot from gentoo-minimal-image. Unpack stage3 and portage. Edit fstab and set a root password. 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. Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set. If it finds one it tries to start /EFI/boot/bootx64.efi (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. TODO add tar.gz with fixed ebuild for adding to overlay&lt;br /&gt;
&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|grub-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}}&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)]. Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. The config is hosted as github gist, so you can easily ask for merges with your version. This is work in progress :)&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone&lt;br /&gt;
&lt;br /&gt;
Set locale.gen&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. 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. 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;
&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;
=== Network Manager ===&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. 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]). It would be nice to scan some fingers for fun :-). 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;
=== working ===&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&lt;br /&gt;
*  TinkVintage Button, emits ''XF86Launch1''&lt;br /&gt;
=== TODO ===&lt;br /&gt;
*  {{key|Fn}}{{key|F8}} - disable/enable touchpad&lt;br /&gt;
*  {{key|Fn}}{{key|F&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=51941</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=51941"/>
		<updated>2011-07-06T11:19:51Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* Fingerprint reader */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, contact me}}&lt;br /&gt;
&lt;br /&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)&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(R) Core(TM) i5-2520M CPU @ 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KB&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;
&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 Grapic: {{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'''. There a ways to boot the .iso image with grub. I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. But got stuck there. After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. '''Lenovo has to do better here'''. 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. 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 handbook, boot from gentoo-minimal-image. Unpack stage3 and portage. Edit fstab and set a root password. 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. Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set. If it finds one it tries to start /EFI/boot/bootx64.efi (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. TODO add tar.gz with fixed ebuild for adding to overlay&lt;br /&gt;
&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|grub-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}}&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)]. Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. The config is hosted as github gist, so you can easily ask for merges with your version. This is work in progress :)&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone&lt;br /&gt;
&lt;br /&gt;
Set locale.gen&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. 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. 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;
&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;
=== Network Manager ===&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. 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]). It would be nice to scan some fingers for fun :-). 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;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=51940</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=51940"/>
		<updated>2011-07-06T11:19:31Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* Further installation steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, contact me}}&lt;br /&gt;
&lt;br /&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)&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(R) Core(TM) i5-2520M CPU @ 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KB&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;
&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 Grapic: {{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'''. There a ways to boot the .iso image with grub. I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. But got stuck there. After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. '''Lenovo has to do better here'''. 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. 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 handbook, boot from gentoo-minimal-image. Unpack stage3 and portage. Edit fstab and set a root password. 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. Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set. If it finds one it tries to start /EFI/boot/bootx64.efi (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. TODO add tar.gz with fixed ebuild for adding to overlay&lt;br /&gt;
&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|grub-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}}&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)]. Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. The config is hosted as github gist, so you can easily ask for merges with your version. This is work in progress :)&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone&lt;br /&gt;
&lt;br /&gt;
Set locale.gen&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. 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. 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;
&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;
=== Network Manager ===&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. 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]). It would be nice to scan some fingers for fun :-). 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;
{{cmdroot|emerge fprint_demo}}&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=51928</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=51928"/>
		<updated>2011-07-05T13:02:01Z</updated>

		<summary type="html">&lt;p&gt;Flow: /* Kernel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, contact me}}&lt;br /&gt;
&lt;br /&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)&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(R) Core(TM) i5-2520M CPU @ 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KB&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;
&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 Grapic: {{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'''. There a ways to boot the .iso image with grub. I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. But got stuck there. After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. '''Lenovo has to do better here'''. 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. 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 handbook, boot from gentoo-minimal-image. Unpack stage3 and portage. Edit fstab and set a root password. 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. Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set. If it finds one it tries to start /EFI/boot/bootx64.efi (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. TODO add tar.gz with fixed ebuild for adding to overlay&lt;br /&gt;
&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|grub-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}}&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)]. Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. The config is hosted as github gist, so you can easily ask for merges with your version. This is work in progress :)&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;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone&lt;br /&gt;
&lt;br /&gt;
Set locale.gen&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. 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. 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;
&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;
=== Network Manager ===&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. Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Installing_Gentoo_on_a_ThinkPad_X220&amp;diff=51924</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=51924"/>
		<updated>2011-07-05T08:33:21Z</updated>

		<summary type="html">&lt;p&gt;Flow: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WARN|Work in progress. If you have feedback, suggestions, anything, contact me}}&lt;br /&gt;
&lt;br /&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)&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(R) Core(TM) i5-2520M CPU @ 2.50GHz&lt;br /&gt;
stepping        : 7&lt;br /&gt;
cpu MHz         : 2501.000&lt;br /&gt;
cache size      : 3072 KB&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;
&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 Grapic: {{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'''. There a ways to boot the .iso image with grub. I tried grub2 with help from syslinux memdisk and reached some kind of bios update menu. But got stuck there. After wasting some time I did it by installing Win7 and running the Windows BIOS update tool. '''Lenovo has to do better here'''. 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. 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 handbook, boot from gentoo-minimal-image. Unpack stage3 and portage. Edit fstab and set a root password. 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. Because UEFI and GPT a relatively new and I am not so familiar with it and the documentation isn't so good yet. Basically EFI on the X220 looks for a FAT32 formatted GPT partition with the boot flag set. If it finds one it tries to start /EFI/boot/bootx64.efi (Note that this is actually case-insensitive because of FAT32).&lt;br /&gt;
&lt;br /&gt;
Grub-1.99 from scarabeus overlay is needed. Fix the STRIP_MASK error, remove last &amp;quot;a&amp;quot;. Enable GRUB_PLATFORMS=efi-64 in make.conf. TODO add tar.gz with fixed ebuild for adding to overlay&lt;br /&gt;
&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|grub-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}}&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&lt;br /&gt;
&lt;br /&gt;
My [https://gist.github.com/1056225 current Kernel .config (3.0-rc5)]. Please feel free to comment if you have spotted an unnecessary enabled hardware option or something that should be enabled on the X220. The config is hosted as github gist, so you can easily ask for merges with your version. This is work in progress :)&lt;br /&gt;
&lt;br /&gt;
==== Fixing i915 suspend issues ====&lt;br /&gt;
{{WARN|This does not solve the issues for me. It's only here for information. You can skip this step}}&lt;br /&gt;
Kernels &amp;gt; 2.6.37 have an bug which prevents the X220 from resuming after suspend. You have to change a tiny little flag as described [https://groups.google.com/d/msg/linux.kernel/nsCi4wWilr4/0W2L6WJP4XIJ here].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--- a/drivers/gpu/drm/i915/i915_drv.c&lt;br /&gt;
+++ b/drivers/gpu/drm/i915/i915_drv.c&lt;br /&gt;
@@ -183,7 +183,7 @@ static const struct intel_device_info intel_sandybridge_d_info = {&lt;br /&gt;
 static const struct intel_device_info intel_sandybridge_m_info = {&lt;br /&gt;
 	.gen = 6, .is_mobile = 1,&lt;br /&gt;
 	.need_gfx_hws = 1, .has_hotplug = 1,&lt;br /&gt;
-	.has_fbc = 1,&lt;br /&gt;
+	.has_fbc = 0,&lt;br /&gt;
 	.has_bsd_ring = 1,&lt;br /&gt;
 	.has_blt_ring = 1,&lt;br /&gt;
 };&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;-j 4&amp;quot;&lt;br /&gt;
GRUP_PLATFORMS=&amp;quot;grub_platforms_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;
Set timezone&lt;br /&gt;
&lt;br /&gt;
Set locale.gen&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. 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. 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;
&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;
=== Network Manager ===&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. Read it [http://en.gentoo-wiki.com/wiki/Encrypt_home_directory_with_ecryptfs here]&lt;/div&gt;</summary>
		<author><name>Flow</name></author>
		
	</entry>
</feed>