Skip to content

dywisor/tlp-portage

Repository files navigation

tlp-portage

Overlay for installing TLP on Gentoo/Funtoo/... systems.

Setup Instructions

The following commands ($ <command...>) should be run as root. It is assumed that your package manager is sys-apps/portage.

  1. Add the tlp-portage repository

    1. Option A: manage repo using eselect-repository

      1. Install eselect-repository and git:

        $ emerge -a --no-replace app-eselect/eselect-repository dev-vcs/git
        

      See also eselect/repository - Gentoo Wiki.

      1. If it doesn't already exist, create the repos.conf directory as configured by the REPOS_CONF variable in /etc/eselect/repository.conf:

        $ mkdir -p /etc/portage/repos.conf
        
      2. Add the tlp-portage overlay with eselect-repository:

        $ eselect repository add tlp git https://github.com/dywisor/tlp-portage
        
      3. Download the repo:

        $ emerge --sync tlp
        
    2. OR Option B: manage repo with layman

      1. Install layman

        1. Enable the git USE flag for layman:

          $ mkdir /etc/portage/package.use
          $ echo "app-portage/layman git" >> /etc/portage/package.use/layman
          
        2. Install layman:

          $ emerge -a --noreplace ">=app-portage/layman-2"
          

        See also Layman - Gentoo Wiki.

      2. layman versions prior to 2.1.0: make sure that /etc/portage/make.conf has the following line:

        source /var/lib/layman/make.conf
        

        If you've just installed layman, simply run:

        $ echo "source /var/lib/layman/make.conf" >> /etc/portage/make.conf
        
      3. Add the tlp-portage overlay with layman:

        $ wget "https://raw.github.com/dywisor/tlp-portage/maint/layman.xml" -O /etc/layman/overlays/tlp.xml
        $ layman -f -a tlp
        
  2. stable arch only (amd64, x86): unmask TLP:

    $ mkdir /etc/portage/package.accept_keywords
    $ echo "app-laptop/tlp" > /etc/portage/package.accept_keywords/tlp
    

    unmask sys-power/linux-x86-power-tools or sys-apps/linux-misc-apps:

    $ echo "sys-power/linux-x86-power-tools" >> /etc/portage/package.accept_keywords/tlp
    
  3. (optional) install/build kernel modules

    This is required for ThinkPad advanced battery functions.

    • Thinkpads up to the Sandy Bridge generation (T420, X220 et al.):

      $ emerge -a app-laptop/tp_smapi
      
    • Thinkpads beginning with the Sandy Bridge Generation (T420, X220 et al.):

      $ emerge -a sys-power/acpi_call
      
  4. (optional) choose USE flags, for example:

    $ echo "app-laptop/tlp tlp-suggests" > /etc/portage/package.use/tlp
    

    See USE flags below for a full listing.

  5. Install TLP:

    $ emerge -a app-laptop/tlp
    
  6. Edit TLP's configuration file /etc/tlp.conf

    In contrast to other distributions, you have to enable TLP explicitly by setting TLP_ENABLE=1.

    See the upstream documentation for details.

    Note

    Beginning with TLP 1.3, the configuration file format and handling has changed, users upgrading from TLP 1.2 should review their configuration.

  7. Enable the TLP service

    OpenRC:

    $ rc-update add tlp default
    

    systemd:

    $ systemctl enable tlp.service
    

    systemd-rfkill should be masked as it conflicts with RESTORE_DEVICE_STATE_ON_STARTUP/DEVICES_TO_{EN,DIS}ABLE_ON_STARTUP:

    $ systemctl mask systemd-rfkill.socket systemd-rfkill.service
    

    Users of systemd prior to v227 need to mask systemd-rfkill@ instead:

    $ systemctl mask [email protected]
    

    power-profiles-daemon must be masked as it conflicts with TLP as a whole:

    $ systemctl mask power-profiles-daemon.service
    
  8. Reboot your system to apply the new settings (alternatively, you could reload the udev rules and start TLP)

  9. You might want to run tlp-stat to see if everything is OK so far

USE flags

USE flags accepted by app-laptop/tlp
flag recommended default description
tlp-suggests yes yes install all optional dependencies
rdw - no install TLP's radio device wizard
bluetooth - no install optional bluetooth dependencies (bluez)
tpacpi-bundled yes yes

use the bundled version of tpacpi-bat

Deselecting this flag disqualifies you from getting support upstream

Random notes / FAQ

Kernel config considerations

The following kernel options should be set to y:

  • CONFIG_PM
  • CONFIG_PM_RUNTIME (Linux < 3.19 only)
  • CONFIG_DMIID
  • CONFIG_POWER_SUPPLY
  • CONFIG_ACPI_AC
  • CONFIG_SENSORS_CORETEMP
  • CONFIG_X86_MSR