Difference between revisions of "Installing Gentoo on an X240"

From ThinkWiki
Jump to: navigation, search
(Hardware buttons (F1, F2 & F3) and sound)
(22 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
The "core-avx" CFLAGS option optimises for the new Haswell instruction set:
 
The "core-avx" CFLAGS option optimises for the new Haswell instruction set:
 
  CHOST="x86_64-pc-linux-gnu"
 
  CHOST="x86_64-pc-linux-gnu"
  CFLAGS="-march=core-avx2 -O2 -pipe"
+
  CFLAGS="-march=core-avx2 -mavx2 -O2 -pipe"
 
  CXXFLAGS="${CFLAGS}"
 
  CXXFLAGS="${CFLAGS}"
 
source: [https://wiki.gentoo.org/wiki/Safe_CFLAGS#Core_i3.2Fi5.2Fi7_with_AVX2_instructions_.28Haswell.29 Safe CFLAGS]
 
source: [https://wiki.gentoo.org/wiki/Safe_CFLAGS#Core_i3.2Fi5.2Fi7_with_AVX2_instructions_.28Haswell.29 Safe CFLAGS]
Line 57: Line 57:
 
  modules="${modules} iwlwifi"  
 
  modules="${modules} iwlwifi"  
 
  module_iwlwifi_args=""
 
  module_iwlwifi_args=""
==Sound==
+
==Hardware buttons (F1, F2 & F3) and sound==
With a built-in sound driver (HDA-Intel), mixer settings don't work out of the box. The following page might have a solution: [http://forums.gentoo.org/viewtopic-t-982898-start-0.html Gentoo forums]
+
On KDE, the hardware buttons used to change the volume do not work out of the box. The only working button is the mute button. The reason is the HDMI output being assigned the first sound card (cat /proc/asound/cards). In order to change that, the guys on the [http://forums.gentoo.org/viewtopic-t-982898-start-0.html Gentoo forums] suggests building the driver as a module and then loading it with a parameter:
 +
Device Drivers  --->
 +
  <*> Sound card support  --->
 +
    <*> Advanced Linux Sound Architecture  --->
 +
      [*] PCI sound devices  --->
 +
        <M> Intel HD Audio  --->
 +
          [*] Build HDMI/DisplayPort HD-audio codec support
 +
/etc/conf.d/modules:
 +
modules="snd_hda_intel"
 +
module_snd_hda_intel_args="index=1"
 +
To make sure the driver gets loaded with the parameter, blacklist it in to /etc/modprobe.d/blacklist.conf:
 +
blacklist snd_hda_intel
 +
 
 +
==SD Card Reader==
 +
This is the Realtek device. It requires the sys-apps/pcsc-tools package to be installed.
 +
Device Drivers  --->
 +
  Multifunction device drivers  --->
 +
    <*> Intel ICH LPC
 +
    <*> Realtek PCI-E card reader
 +
==The Touchpad==
 +
The X240 has a new touchpad (or clickpad), for which only the left mouse button is recognised. The blog [http://mydevelopedworld.wordpress.com/2013/11/30/how-to-configure-new-lenovo-x240-touchpad-on-ubuntu-13-10/ While In Linux] explains how to get it to work. By adding the driver to /etc/portage/make.conf before emerging X11, the driver (x11-drivers/xf86-input-synaptics) should be installed automatically:
 +
INPUT_DEVICES="mouse keyboard evdev synaptics"
 +
Then, add these lines to the configuration file /usr/share/X11/xorg.conf.d/50-synaptics.conf:
 +
# This option enables the bottom right corner to be a right button on
 +
# non-synaptics clickpads.
 +
# This option is only interpreted by clickpads.
 +
Section "InputClass"
 +
        Identifier "Default clickpad buttons"
 +
        MatchDriver "synaptics"
 +
        Option "SoftButtonAreas" "60% 0 0 5% 40% 60% 0 5%"
 +
        Option "AreaTopEdge" "4%"
 +
EndSection
 +
==Brightness Controls (F5 & F6)==
 +
From the [http://www.splitbrain.org/blog/2014-03/08-lenovo_thinkpad_x240_xubuntu Splitbrain blog]:
 +
Turning up and down the screen brightness with FN+F5 and FN+F6 did not work correctly out of the box. It basically did nothing for a few keypresses and then dimmed the display to barely visible. This blog post brought the solution. Adjust the default boot parameters in /etc/default/grub like this:
 +
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux acpi_backlight=vendor i915.allow_pc8=1"
 +
Note: i915.allow_pc8=1 enables powersaving for the GPU
 +
 
 +
Then run sudo update-grub and reboot.
 +
 
 +
Alternatively, edit the "kernel" line in /boot/grub/grub.cfg directly.
  
 
=Resources=
 
=Resources=
The Thinkpad T440p has similar hardware, therefore, it was to look at its configuration: [http://wiki.gentoo.org/wiki/Lenovo_ThinkPad_T440s Gentoo Wiki on the T440p]
+
The Thinkpad T440s has similar hardware, therefore, it was helpful to look at its configuration: [http://wiki.gentoo.org/wiki/Lenovo_ThinkPad_T440s Gentoo Wiki on the T440s]
 
[[Category:X Series]]
 
[[Category:X Series]]
 
[[Category:X240]]
 
[[Category:X240]]

Revision as of 21:04, 22 April 2014

These notes refer to the installation of Gentoo on an X240 system. The notes are NOT step-by-step instructions, but they are supposed to provide the necessary information to simplify the installation (i.e. configuration files, etc).

/etc/portage/make.conf

The "core-avx" CFLAGS option optimises for the new Haswell instruction set:

CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=core-avx2 -mavx2 -O2 -pipe"
CXXFLAGS="${CFLAGS}"

source: Safe CFLAGS

Hardware information

lspci

00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 0b)
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 0b)
00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 0b)
00:14.0 USB controller: Intel Corporation Lynx Point-LP USB xHCI HC (rev 04)
00:16.0 Communication controller: Intel Corporation Lynx Point-LP HECI #0 (rev 04)
00:16.3 Serial controller: Intel Corporation Lynx Point-LP HECI KT (rev 04)
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I218-LM (rev 04)
00:1b.0 Audio device: Intel Corporation Lynx Point-LP HD Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 6 (rev e4)
00:1c.1 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 3 (rev e4)
00:1d.0 USB controller: Intel Corporation Lynx Point-LP USB EHCI #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation Lynx Point-LP LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation Lynx Point-LP SATA Controller 1 [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation Lynx Point-LP SMBus Controller (rev 04)
02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5227 PCI Express Card Reader (rev 01)
03:00.0 Network controller: Intel Corporation Wireless 7260 (rev 83)

This laptop features the Intel Lynx PCH chipset.

lsusb

Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 005: ID 04f2:b39a Chicony Electronics Co., Ltd 
Bus 002 Device 004: ID 8087:07dc Intel Corp. 
Bus 002 Device 003: ID 138a:0017 Validity Sensors, Inc. 
Bus 002 Device 002: ID 048d:1170 Integrated Technology Express, Inc. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8000 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Some of the USB devices are the fingerprint reader and the camera, they were not yet identified.

Configuration

Lan & Wlan

In order for the wireless chipset to work, it needs to be configured as a module (called iwlwifi). Otherwise it can not load the required firmware (package sys-kernel/linux-firmware OR sys-firmware/iwl7260-ucode) correctly.

Device Drivers  --->
 [*] Network device support  --->
   [*] Ethernet driver support  --->
     [*] Intel devices
       <*> Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support
   [*] Wireless LAN  --->
     <M> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi)
     <*> Intel Wireless WiFi MVM Firmware support

Then, load the module on boot without any parameters (note: the firmware has to be installed), and it will work (/etc/conf.d/modules):

modules="${modules} iwlwifi" 
module_iwlwifi_args=""

Hardware buttons (F1, F2 & F3) and sound

On KDE, the hardware buttons used to change the volume do not work out of the box. The only working button is the mute button. The reason is the HDMI output being assigned the first sound card (cat /proc/asound/cards). In order to change that, the guys on the Gentoo forums suggests building the driver as a module and then loading it with a parameter:

Device Drivers  --->
 <*> Sound card support  --->
   <*> Advanced Linux Sound Architecture  --->
     [*] PCI sound devices  --->
       <M> Intel HD Audio  --->
         [*] Build HDMI/DisplayPort HD-audio codec support

/etc/conf.d/modules:

modules="snd_hda_intel" 
module_snd_hda_intel_args="index=1"

To make sure the driver gets loaded with the parameter, blacklist it in to /etc/modprobe.d/blacklist.conf:

blacklist snd_hda_intel

SD Card Reader

This is the Realtek device. It requires the sys-apps/pcsc-tools package to be installed.

Device Drivers  --->
 Multifunction device drivers  --->
   <*> Intel ICH LPC
   <*> Realtek PCI-E card reader

The Touchpad

The X240 has a new touchpad (or clickpad), for which only the left mouse button is recognised. The blog While In Linux explains how to get it to work. By adding the driver to /etc/portage/make.conf before emerging X11, the driver (x11-drivers/xf86-input-synaptics) should be installed automatically:

INPUT_DEVICES="mouse keyboard evdev synaptics"

Then, add these lines to the configuration file /usr/share/X11/xorg.conf.d/50-synaptics.conf:

# This option enables the bottom right corner to be a right button on
# non-synaptics clickpads.
# This option is only interpreted by clickpads.
Section "InputClass"
       Identifier "Default clickpad buttons"
       MatchDriver "synaptics"
       Option "SoftButtonAreas" "60% 0 0 5% 40% 60% 0 5%"
       Option "AreaTopEdge" "4%"
EndSection

Brightness Controls (F5 & F6)

From the Splitbrain blog: Turning up and down the screen brightness with FN+F5 and FN+F6 did not work correctly out of the box. It basically did nothing for a few keypresses and then dimmed the display to barely visible. This blog post brought the solution. Adjust the default boot parameters in /etc/default/grub like this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux acpi_backlight=vendor i915.allow_pc8=1"

Note: i915.allow_pc8=1 enables powersaving for the GPU

Then run sudo update-grub and reboot.

Alternatively, edit the "kernel" line in /boot/grub/grub.cfg directly.

Resources

The Thinkpad T440s has similar hardware, therefore, it was helpful to look at its configuration: Gentoo Wiki on the T440s