Gentoo on a laptop: Difference between revisions

From Elvanör's Technical Wiki
Jump to navigation Jump to search
No edit summary
Line 4: Line 4:


* It's highly recommended to install the NetworkManager (it will be pulled as a dependency by emerging kde-misc/networkmanagement) as it allows to easily connect to networks through a GUI. You can change networks easily.
* It's highly recommended to install the NetworkManager (it will be pulled as a dependency by emerging kde-misc/networkmanagement) as it allows to easily connect to networks through a GUI. You can change networks easily.
 
* NetworkManager needs to launch wpa_supplicant in -u mode. If something strange is happening (for instance no networks show up), activate syslog-ng and look in the logs.
* Another network manager is wicd, untried yet.
* Another network manager is wicd, untried yet.



Revision as of 08:07, 16 June 2017

This page contains additional information for installing Gentoo on a laptop computer.

Networking

  • It's highly recommended to install the NetworkManager (it will be pulled as a dependency by emerging kde-misc/networkmanagement) as it allows to easily connect to networks through a GUI. You can change networks easily.
  • NetworkManager needs to launch wpa_supplicant in -u mode. If something strange is happening (for instance no networks show up), activate syslog-ng and look in the logs.
  • Another network manager is wicd, untried yet.

Touchpad

  • To support the touchpad the kernel should be configured with PS/2 mouse support and / or the correct driver for your touchpad model, and INPUT_DEVICES in /etc/make.conf should contain "synaptics".
  • The xorg.conf file should have the following section:
Section "InputDevice"
    Driver         "synaptics"
    Identifier "TouchPad"
    Option         "SendCoreEvents"
    Option         "Protocol" "auto-dev"
    Option         "SHMConfig" "on"
EndSection

Battery

  • To install a base KDE applet to monitor your battery, emerge klaptopdaemon. This will add a new control panel in Control Center, and will start the applet (KLaptop).
  • You don't need to start the acpi daemon (acpid) to have the battery monitor working.
  • If you have a recent kernel (like 2.6.28), you need to build the deprecated /proc/acpi files and directories, else klaptopdaemon won't work. This will probably be fixed in future versions of KDE (as userspace programs will move to the new ACPI APIs). You don't need the deprecated APM drivers.

ACPI

  • If you cannot see the ACPI event, it means there is a problem with your kernel configuration / BIOS / DSDT. For example on my Asus M51Sn the ACPI video module was needed in order to get the events from the brightness keys. Check if you have all the needed ACPI modules.

Default actions

  • By default, pressing the power button initiates a shutdown. This is generally stupid (eg, very easy to press the power button inadvertently). You can remove this behavior by editing /etc/acpi/actions/powerbtn.sh and just returning at the beginning.

Debugging ACPI

  • To debug ACPI (if some keys are not working for example):
    • Try to cat the keyboard device. Real ACPI events won't generate an output; keypresses will.
    • Check if your DSDT has a known problem (a DSDT can be decompiled to human form by running cat /proc/acpi/dsdt > dsdt; iasl -d dsdt).

Hotkeys

  • Warning: deprecated architecture, see below.

Previous (Ubuntu) architecture

  • A nice overall explanation.
  • Some keypresses generate ACPI events caught by the ACPI daemon, not standard X events. You can see if some ACPI events were generated by starting a logging daemon and doing a tail /var/log/messages.
  • Normally the ACPI daemon can launch scripts to handle the event action. Currently it seems there are plans to bypass the use of acpid (which runs in the userspace), and use the kernel (in conjunction with HAL) to generate direct X input events that can be used directly by your desktop manager. This is for example detailed in this blog.

ACPI scripts

  • The Ubuntu acpi-support package was previously used to provide scripts ran for some ACPI events. In Gentoo it is available in the Sunrise overlay.
  • In Ubuntu most of the ACPI scripts just generate a key event (via acpi_fakekey command). This indeed shows that the new way of generating directly events within the kernel is better than this roundtrip to userspace land.

USB autosuspend

  • Sometimes USB autosuspend is active even for devices like mice. You can issue the following command at runtime to disable USB autosuspend:
echo -1 >/sys/module/usbcore/parameters/autosuspend
  • Or you can permanently disable it with the following kernel boot parameter:
usbcore.autosuspend=-1
  • The correct way would be to edit an udev rules file and specifically exclude the target mouse from autosuspend. With laptop-mode 1.66 or higher, you can simply edit /etc/laptop-mode/conf.d/runtime-pm.conf and disable autosuspend globally (CONTROL_RUNTIME_AUTOSUSPEND=0).

Hotkeys (volume up, etc)

  • acpi_fakekey no longer correctly works on newer kernels, so the acpi-support package should not be installed. The correct way is now to use a proper kernel driver that will correctly generate the key presses events, depending on your laptop model. For ASUS laptops, kernel-2.6.29 already handles this.