Skip to content
This repository has been archived by the owner on Sep 30, 2018. It is now read-only.

Commit

Permalink
[tlp] Bring into community so we can alter the default settings to su…
Browse files Browse the repository at this point in the history
…it our users
  • Loading branch information
jonathonf committed Dec 11, 2017
1 parent d08d170 commit d18b2df
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions tlp/PKGBUILD
@@ -0,0 +1,85 @@
# $Id$
# Maintainer: Jonathon Fernyhough <jonathon_at_manjaro_dot_org>
# Contributor: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Marc Schulte <bomba@nerdstube.de>

pkgbase=tlp
pkgname=('tlp' 'tlp-rdw')
pkgver=1.0
pkgrel=1.1
arch=('any')
url='http://linrunner.de/en/tlp/tlp.html'
license=('GPL2' 'GPL3')
source=("tlp-${pkgver}.tar.gz::https://github.com/linrunner/TLP/archive/${pkgver}.tar.gz")
sha256sums=('642717b27db3a70c2cdef2673fe3229bf314488aa0797515e63d933b93bc78ec')

prepare() {
cd ${pkgbase^^}-${pkgver}

###
# These changes represent feedback gathered over time from Manjaro users and
# should prevent "hidden" issues with USB devices and performance issues
# with SSDs.
#
# They also enable some power saving on AC power as there's no real need to
# run things constantly at full power just because you're not on battery.
#
# Anyone looking for further power savings can easily alter these settings
# after installation.

# Be less aggressive with SATA ALPM to prevent poor SSD performance and
# potential data corruption.
sed -i '126s/=min_power/=medium_power/' default

# Use hardware defaults for open-source AMD drivers.
# This allows demand-based power scaling and vastly reduces heat generation.
sed -i '149s/=high/=default/' default

# Enable audio power saving on AC power.
sed -i '170s/=0/=1/' default

# Enable runtime power management for PCI(e) on AC power.
sed -i '186s/=on/=auto/' default

# Disable aggressive USB device autosuspend.
# This prevents "hidden" issues with USB hardware that is incompatible.
sed -i '200s/enable/enable aggressive/; 201s/=1/=0/' default

###
}

package_tlp() {
pkgdesc='Linux Advanced Power Management'
depends=('hdparm' 'iw' 'pciutils' 'rfkill' 'usbutils' 'util-linux')
optdepends=('acpi_call: ThinkPad battery functions, Sandy Bridge and newer'
'bash-completion: Bash completion'
'ethtool: Disable Wake On Lan'
'lsb-release: Display LSB release version in tlp-stat'
'smartmontools: Display S.M.A.R.T. data in tlp-stat'
'tp_smapi: ThinkPad battery functions'
'x86_energy_perf_policy: Set energy versus performance policy on x86 processors')
conflicts=('laptop-mode-tools' 'pm-utils')
backup=('etc/default/tlp')

cd TLP-${pkgver}

export TLP_SBIN='/usr/bin'
export TLP_ULIB='/usr/lib/udev'
export TLP_SYSD='/usr/lib/systemd/system'
export TLP_NO_INIT='1'
export TLP_NO_PMUTILS='1'
export TLP_WITH_SYSTEMD='1'

make DESTDIR="${pkgdir}" install-tlp install-man
}

package_tlp-rdw() {
pkgdesc='Linux Advanced Power Management - Radio Device Wizard'
depends=('networkmanager' 'tlp')

cd TLP-${pkgver}

make DESTDIR="${pkgdir}" install-rdw
}

# vim: ts=2 sw=2 et:

0 comments on commit d18b2df

Please sign in to comment.