diff options
-rw-r--r-- | .SRCINFO | 25 | ||||
-rw-r--r-- | PKGBUILD | 34 | ||||
-rw-r--r-- | indicator-cpufreq-selector.patch | 10 | ||||
-rw-r--r-- | performance | 21 | ||||
-rw-r--r-- | powersave | 21 | ||||
-rwxr-xr-x | throttle | 323 | ||||
-rw-r--r-- | throttle-cut.service | 12 | ||||
-rw-r--r-- | throttle-runtime-pm.rules | 46 |
8 files changed, 19 insertions, 473 deletions
@@ -1,7 +1,7 @@ pkgbase = indicator-powersave - pkgdesc = User discretion power managment utility forked from CPU frequency indicator (bzr version) - pkgver = r98.10 - pkgrel = 2 + pkgdesc = User discretion power managment utility forked from CPU frequency indicator + pkgver = r102.10 + pkgrel = 1 url = https://launchpad.net/indicator-cpufreq arch = i686 arch = x86_64 @@ -15,37 +15,22 @@ pkgbase = indicator-powersave depends = pygtk depends = polkit-gnome depends = indicator-application - optdepends = x86_energy_perf_policy - optdepends = hdparm - optdepends = nvidia-utils - optdepends = iw - optdepends = ethtool + depends = throttlectl provides = indicator-cpufreq provides = indicator-cpufreq-bzr conflicts = indicator-cpufreq conflicts = indicator-cpufreq-bzr - backup = etc/throttle.d/powersave - backup = etc/throttle.d/performance source = bzr+lp:indicator-cpufreq source = indicator-cpufreq.rules source = com.ubuntu.indicator.policy.in.patch source = indicator-cpufreq-selector.patch source = indicator.py.patch source = no-cpufreq.patch - source = throttle - source = throttle-cut.service - source = powersave - source = performance sha512sums = SKIP sha512sums = 5427f1dcd51fe7fb43bbce1bc020a32312e2f82ccf643129b9887262730989197e2ce2cd4494922df058e78bdb8fbe220eccd69588ff917a891d5a56b3366a24 sha512sums = 9b57d18ef9edc6b609b24f6a62c93c472bc2b72dd158728af1a1d0833a308a72457b0ad32c2d51b357650fa69c0f7f595fa55901ea490a7a3fda3c7c998de2bd - sha512sums = 7e30098e35a72d66a885290a2be2aaf86b72f0242fd4d7ed62e81f9f6e7da378d70c7f7ef54701374dd1440f64173330457cdaf58a3a9bca35a59a57b29123a7 + sha512sums = 52e053f6f1a972cd5d04224358de64e1569f7cd9cd1b845e933f4e4467936d6457bd68d3373b6e2d482578ed3fca2b33b1c7ee9a843f992ff2bb4b8da3139631 sha512sums = 1b8b56a841e736d5531632a1c4c229508e1c8a5c840cd2d172e2d89e7aa3a00d549bcd941b209692f8e09bff3739f28f971a1028d3acd4c37cc9176b9425e2a1 sha512sums = 2b1229ad56651a8d55590256785119da4eba2a2f8d74e57475a8303dc076d5e9067a6481e3245d05557ea0f983d8fa1f1ac02f705fe695f4a4ef79fa86b00b89 - sha512sums = 48fac136a0ff11bec6c7c5fc840f81dc2f04dea5fe1132b4af735940e1360cc320f6a59cac573a356bf7ab25166bbc2da6fb9faf981644196d277824a2219337 - sha512sums = 0b2de8aa79a837e399684164b29992ae0ab8a2c07412fe837c920e8d3905620ac98d700ee9ee0e8328d398e1d64aea3b01962f0ba573f9a8ff5a41fea5628ace - sha512sums = 3d487961bf86254817fd099b888d6245bbf1e57622166dc8df378d639bfb1c0fc105646038be6093183be102294394b88cde382fe961f7606b68619af4a00595 - sha512sums = d11ed5f4344f07507497e816ccd7612ffc6df70636ca5f4817a9ce6e3b190b3a17fb02c44c4bf648359f640e4c63cc0b0134968ff4d3d989ad05fa4c095b03d3 pkgname = indicator-powersave - @@ -2,38 +2,28 @@ # Contributor: Xiao-Long Chen <chenxiaolongcxl.epac.to> pkgname=indicator-powersave -pkgver=r98.10 -pkgrel=2 -pkgdesc="User discretion power managment utility forked from CPU frequency indicator (bzr version)" +pkgver=r102.10 +pkgrel=1 +pkgdesc="User discretion power managment utility forked from CPU frequency indicator" arch=('i686' 'x86_64') url="https://launchpad.net/indicator-cpufreq" license=('GPL') -depends=('libappindicator-gtk3' 'python2' 'python2-dbus' 'python2-gobject' 'pygtk' 'polkit-gnome' 'indicator-application') -optdepends=('x86_energy_perf_policy' 'hdparm' 'nvidia-utils' 'iw' 'ethtool') +depends=('libappindicator-gtk3' python2{,-{dbus,gobject}} 'pygtk' 'polkit-gnome' 'indicator-application' 'throttlectl') makedepends=('python2-distutils-extra' 'bzr') -provides=('indicator-cpufreq' 'indicator-cpufreq-bzr') -conflicts=('indicator-cpufreq' 'indicator-cpufreq-bzr') -backup=(etc/throttle.d/{powersave,performance}) +provides=(indicator-cpufreq{,-bzr}) +conflicts=(indicator-cpufreq{,-bzr}) source=("bzr+lp:indicator-cpufreq" 'indicator-cpufreq.rules' 'com.ubuntu.indicator.policy.in.patch' 'indicator-cpufreq-selector.patch' 'indicator.py.patch' - 'no-cpufreq.patch' - 'throttle' - 'throttle-cut.service' - 'powersave' - 'performance') + 'no-cpufreq.patch') sha512sums=('SKIP' '5427f1dcd51fe7fb43bbce1bc020a32312e2f82ccf643129b9887262730989197e2ce2cd4494922df058e78bdb8fbe220eccd69588ff917a891d5a56b3366a24' '9b57d18ef9edc6b609b24f6a62c93c472bc2b72dd158728af1a1d0833a308a72457b0ad32c2d51b357650fa69c0f7f595fa55901ea490a7a3fda3c7c998de2bd' - '7e30098e35a72d66a885290a2be2aaf86b72f0242fd4d7ed62e81f9f6e7da378d70c7f7ef54701374dd1440f64173330457cdaf58a3a9bca35a59a57b29123a7' + '52e053f6f1a972cd5d04224358de64e1569f7cd9cd1b845e933f4e4467936d6457bd68d3373b6e2d482578ed3fca2b33b1c7ee9a843f992ff2bb4b8da3139631' '1b8b56a841e736d5531632a1c4c229508e1c8a5c840cd2d172e2d89e7aa3a00d549bcd941b209692f8e09bff3739f28f971a1028d3acd4c37cc9176b9425e2a1' - '2b1229ad56651a8d55590256785119da4eba2a2f8d74e57475a8303dc076d5e9067a6481e3245d05557ea0f983d8fa1f1ac02f705fe695f4a4ef79fa86b00b89' - '48fac136a0ff11bec6c7c5fc840f81dc2f04dea5fe1132b4af735940e1360cc320f6a59cac573a356bf7ab25166bbc2da6fb9faf981644196d277824a2219337' - '0b2de8aa79a837e399684164b29992ae0ab8a2c07412fe837c920e8d3905620ac98d700ee9ee0e8328d398e1d64aea3b01962f0ba573f9a8ff5a41fea5628ace' - '3d487961bf86254817fd099b888d6245bbf1e57622166dc8df378d639bfb1c0fc105646038be6093183be102294394b88cde382fe961f7606b68619af4a00595' - 'd11ed5f4344f07507497e816ccd7612ffc6df70636ca5f4817a9ce6e3b190b3a17fb02c44c4bf648359f640e4c63cc0b0134968ff4d3d989ad05fa4c095b03d3') + '2b1229ad56651a8d55590256785119da4eba2a2f8d74e57475a8303dc076d5e9067a6481e3245d05557ea0f983d8fa1f1ac02f705fe695f4a4ef79fa86b00b89') pkgver() { cd indicator-cpufreq @@ -59,10 +49,4 @@ package() { install -dm750 -o polkitd "${pkgdir}/usr/share/polkit-1/rules.d/" install -m644 "${srcdir}/indicator-cpufreq.rules" \ "${pkgdir}/usr/share/polkit-1/rules.d/" - - install -Dm755 "${srcdir}/throttle" "${pkgdir}/usr/bin/throttle" - install -Dm755 "${srcdir}/powersave" "${pkgdir}/etc/throttle.d/powersave" - install -Dm755 "${srcdir}/performance" "${pkgdir}/etc/throttle.d/performance" - - install -Dm644 "${srcdir}/throttle-cut.service" "${pkgdir}/etc/systemd/system/throttle-cut.service" } diff --git a/indicator-cpufreq-selector.patch b/indicator-cpufreq-selector.patch index 4b7a937eca57..f5c60e07e827 100644 --- a/indicator-cpufreq-selector.patch +++ b/indicator-cpufreq-selector.patch @@ -38,7 +38,7 @@ + connection_keyword='conn') + def SetThrottle(self, throttle, sender=None, conn=None): + self._check_polkit_privilege(sender, conn, 'com.ubuntu.indicatorcpufreqselector.setthrottle') -+ error = subprocess.Popen(["/bin/sh", "throttle", throttle]) ++ error = subprocess.Popen(["/bin/sh", "throttlectl", throttle]) + + @dbus.service.method(dbus_interface='com.ubuntu.IndicatorCpufreqSelector', + in_signature='as', @@ -47,7 +47,7 @@ + connection_keyword='conn') + def SetGovernor(self, governor, sender=None, conn=None): + self._check_polkit_privilege(sender, conn, 'com.ubuntu.indicatorcpufreqselector.setfrequencyscaling') -+ error = subprocess.Popen(["/bin/sh", "throttle", governor]) ++ error = subprocess.Popen(["/bin/sh", "throttlectl", governor]) + + @dbus.service.method(dbus_interface='com.ubuntu.IndicatorCpufreqSelector', + in_signature='as', @@ -56,7 +56,7 @@ + connection_keyword='conn') + def SetPSTurbo(self, psturbo, sender=None, conn=None): + self._check_polkit_privilege(sender, conn, 'com.ubuntu.indicatorcpufreqselector.setpsturbo') -+ error = subprocess.Popen(["/bin/sh", "throttle", psturbo]) ++ error = subprocess.Popen(["/bin/sh", "throttlectl", psturbo]) + + @dbus.service.method(dbus_interface='com.ubuntu.IndicatorCpufreqSelector', + in_signature='as', @@ -65,7 +65,7 @@ + connection_keyword='conn') + def SetHyperthreads(self, hyperthreads, sender=None, conn=None): + self._check_polkit_privilege(sender, conn, 'com.ubuntu.indicatorcpufreqselector.sethyperthreads') -+ error = subprocess.Popen(["/bin/sh", "throttle", hyperthreads]) ++ error = subprocess.Popen(["/bin/sh", "throttlectl", hyperthreads]) + + @dbus.service.method(dbus_interface='com.ubuntu.IndicatorCpufreqSelector', + in_signature='as', @@ -74,7 +74,7 @@ + connection_keyword='conn') + def SetGPUThrottle(self, gputhrottle, sender=None, conn=None): + self._check_polkit_privilege(sender, conn, 'com.ubuntu.indicatorcpufreqselector.setgputhrottle') -+ error = subprocess.Popen(["/bin/sh", "throttle", gputhrottle]) ++ error = subprocess.Popen(["/bin/sh", "throttlectl", gputhrottle]) def _check_polkit_privilege(self, sender, conn, privilege): '''Verify that sender has a given PolicyKit privilege. diff --git a/performance b/performance deleted file mode 100644 index a99aad22f750..000000000000 --- a/performance +++ /dev/null @@ -1,21 +0,0 @@ -HYPERTHREADS="1" -GOVERNOR="performance" -XPSTURBO="0" -ENERGYPERF="0" -BACKLIGHT="1" # Higher? -LAPTOP="0" -DIRTYWBC="500" -NMIDOG="1" -POLICY="max_performance" -APM="255" -AAM="254" -CONTROL="on" -AUTOSUSPEND="-1" -DISKAUTOSUSPEND="-1" -POWERSAVE="0" -CONTROLLER="N" -WLPOWERSAVE="off" -WOLA="g" -WOLB="enabled" -LEDBRIGHT="255" -NVPM="1" diff --git a/powersave b/powersave deleted file mode 100644 index 10a08db2c7d5..000000000000 --- a/powersave +++ /dev/null @@ -1,21 +0,0 @@ -HYPERTHREADS="0" -GOVERNOR="powersave" -XPSTURBO="1" -ENERGYPERF="15" -BACKLIGHT="0" -LAPTOP="5" -DIRTYWBC="1500" -NMIDOG="0" -POLICY="min_power" -APM="1" -AAM="128" -CONTROL="auto" -AUTOSUSPEND="1" -DISKAUTOSUSPEND="60000" -POWERSAVE="1" -CONTROLLER="Y" -WLPOWERSAVE="on" -WOLA="d" -WOLB="disabled" -LEDBRIGHT="0" -NVPM="0" diff --git a/throttle b/throttle deleted file mode 100755 index 9f1656a6b954..000000000000 --- a/throttle +++ /dev/null @@ -1,323 +0,0 @@ -#!/bin/bash -# throttle - user discrection power management utility - -throttle_ht() { - for i in /sys/devices/system/cpu/cpu*/online; do \ - [[ "$(printf "${i}" | tr -cd [:digit:])" -ge "${CORES}" ]] && \ - printf "${HYPERTHREADS}" > "${i}" ; done & - [[ "${HYPERTHREADS}" == "1" ]] && wait -} - -check_ht() { - printf "\nHyperthreads\n/sys/devices/system/cpu/cpu*/online\n" - for i in /sys/devices/system/cpu/cpu*/online; do \ - [[ $(printf "${i}" | tr -cd [:digit:]) -ge "$CORES" ]] && \ - printf " ${i}\n$(cat ${i})\n"; done | sed 's|/sys/devices/system/cpu/||g; s|/.*||g; N;s|\n|\t|' -} - -throttle_gov() { - for i in /sys/bus/cpu/drivers/processor/cpu*/cpufreq/scaling_governor; do \ - [[ "$(printf ${i} | tr -cd [:digit:])" -ge "${CORES}" && \ - "$(cat /sys/devices/system/cpu/cpu$(printf ${i} | tr -cd [:digit:])/online)" == 0 ]] && \ - continue ; printf "${GOVERNOR}" > "${i}" & done & -} - -check_gov() { - printf "\nCPU Governor\n/sys/bus/cpu/drivers/processor/cpu*/cpufreq/scaling_governor\n" - for i in /sys/bus/cpu/drivers/processor/cpu*/cpufreq/scaling_governor; do \ - printf " ${i}\n$(cat ${i})\n"; done | sed 's|/sys/bus/cpu/drivers/processor/||g; s|/.*||g; N;s|\n|\t|' -} - -throttle_turbo() { - [[ -f /sys/devices/system/cpu/intel_pstate/no_turbo ]] && \ - printf "${XPSTURBO}" > /sys/devices/system/cpu/intel_pstate/no_turbo & -} - -check_turbo() { - [[ -f /sys/devices/system/cpu/intel_pstate/no_turbo ]] && \ - echo -e "\nDisable Intel P-State Turbo\n/sys/devices/system/cpu/intel_pstate/\n"\ - "no_turbo\t$(cat /sys/devices/system/cpu/intel_pstate/no_turbo)" -} - -throttle_backlight() { - [[ -f /sys/class/backlight/acpi_video0 ]] && \ - for i in /sys/class/backlight/acpi_video*/brightness; do \ - printf "${BACKLIGHT}" > "${i}" & done & -} - -check_backlight() { - [[ -f /sys/class/backlight/acpi_video0 ]] && \ - printf "\nBacklight\n/sys/class/backlight/\n" && \ - for i in /sys/class/backlight/acpi_video*/brightness; do \ - printf " ${i}\n$(cat ${i})\n"; done | sed 's|/sys/class/backlight/||g; s|/.*||g; N;s|\n|\t|' -} - -throttle_nvpm() { - printf "nvidia-settings not found; only nvidia currently supported" || \ - DISPLAY=":0.0" nvidia-settings -a [gpu:0]/GPUPowerMizerMode="${NVPM}" > /dev/null & -} - -check_nvpm() { - [[ -n "$(command -v nvidia-settings)" ]] && \ - printf "\nNvidia PowerMizer\n " && \ - DISPLAY=":0.0" nvidia-settings -q [gpu:0]/GPUPowerMizerMode | grep "Attribute" | sed 's|.*\[||g;s|\]):||g;s| |\t|g;s|\.$||g' -} - -throttle_help() { - [[ ! "${1}" == "help" ]] && \ - printf "Invalid input: ${@}\n" - echo -e "\nRuntime power management:\n"\ - "${0} {{cut,full}} - system-wide runtime powersaving\n"\ - "${0} {check} - inspect runtime powersaving\n"\ - "\nExtras:\n" \ - "${0} {gov,cpu} {cut,full} - CPU Governor\n"\ - "${0} turbo {on,off} - Intel P-State Turbo\n"\ - "${0} ht {on,off} - Hyperthreads\n"\ - "${0} backlight {0,1,2} - Backlight brightness (laptops only?)\n" \ - "${0} gpu {cut,full} - GPU runtime powersaving (only Nvidia ATM)\n"\ - "\nOptions also take {{powersave,start},{performace,stop},status} and are stackable:\n"\ - "\n${0} powersave gov full turbo on gpu full ht on check" - exit -} - -[[ -z "$@" ]] && throttle_help - -#Find the number of physical cores (for hyperthreading control) -CORES="$(grep "^core id" /proc/cpuinfo | sort -u | wc -l)" - -while (( "$#" )); do - case "$1" in - ht*) - case "${1}" in \ - ht-on) HYPERTHREADS="1" ;; \ - ht-off) HYPERTHREADS="0" ;; esac - [[ -z "${HYPERTHREADS}" ]] && \ - case "${2}" in \ - off|powersave|start) HYPERTHREADS="0"; SHIFT="2" ;; \ - on|performance|stop) HYPERTHREADS="1"; SHIFT="2" ;; \ - check|status) check_ht; SHIFT="2" ;; esac - [[ -n "${HYPERTHREADS}" ]] && throttle_ht - [[ -n "${SHIFT}" ]] && shift "${SHIFT}" || shift - unset HYPERTHREADS SHIFT - ;; - gov*|cpu) - case "${1}" in \ - gov-full) GOVERNOR="performance" ;; \ - gov-cut) GOVERNOR="powersave" ;; esac - [[ -z "${GOVERNOR}" ]] && \ - case "${2}" in \ - cut|powersave|start) GOVERNOR="powersave"; SHIFT="2" ;; \ - full|performance|stop) GOVERNOR="performance"; SHIFT="2" ;; \ - check|status) check_gov; SHIFT="2" ;; esac - [[ -n "${GOVERNOR}" ]] && throttle_gov - [[ -n "${SHIFT}" ]] && shift "${SHIFT}" || shift - unset GOVERNOR SHIFT - ;; - turbo*) - case "${1}" in \ - turbo-on) XPSTURBO="0" ;; \ - turbo-off) XPSTURBO="1" ;; esac - [[ -z "${XPSTURBO}" ]] && \ - case "${2}" in \ - off|powersave|start) XPSTURBO="1"; SHIFT="2" ;; \ - on|performance|stop) XPSTURBO="0"; SHIFT="2" ;; \ - check|status) check_turbo; SHIFT="2" ;; esac - [[ -n "${XPSTURBO}" ]] && throttle_turbo - [[ -n "${SHIFT}" ]] && shift "${SHIFT}" || shift - unset XPSTURBO SHIFT - ;; - backlight) - case "${2}" in \ - off|0|powersave|start) BACKLIGHT="0"; SHIFT="2" ;; \ - on|1|performance|stop) BACKLIGHT="1"; SHIFT="2" ;; \ - 2) BACKLIGHT="2"; SHIFT="2" ;; \ - check|status) check_backlight; SHIFT="2" ;; esac - [[ -n "${BACKLIGHT}" ]] && throttle_backlight - [[ -n "${SHIFT}" ]] && shift "${SHIFT}" || shift - unset BACKLIGHT SHIFT - ;; - gpu*) - case "${1}" in \ - gpu-full) NVPM="1" ;; \ - gpu-cut) NVPM="0" ;; esac - [[ -z "${NVPM}" ]] && \ - case "${2}" in \ - full|performance|stop) NVPM="1"; SHIFT="2" ;; \ - cut|powersave|start) NVPM="0"; SHIFT="2" ;; \ - check|status) check_nvpm; SHIFT="2" ;; esac - [[ -n "${NVPM}" ]] && [[ -z "$(command -v nvidia-settings)" ]] && \ - throttle_nvpm - [[ -n "${SHIFT}" ]] && shift "${SHIFT}" || shift - unset NVPM SHIFT - ;; - full|performance|true|1|start|cut|powersave|false|0|stop) - case "${1}" in - full|performance|false|0|stop) - . /etc/throttle.d/performance - ;; - cut|powersave|true|1|start) - . /etc/throttle.d/powersave - ;; - esac - - # Hyperthreads - throttle_ht - - # CPU Governor - throttle_gov - - # Disable Intel P-State Turbo - throttle_turbo - - # ENERGY_PERF_BIAS - [[ -n "$(command -v x86_energy_perf_policy)" ]] && \ - x86_energy_perf_policy "${ENERGYPERF}" & - - # Backlight - throttle_backlight - - # Virtual Memory (Swap) - [[ "$(sysctl -n vm.laptop_mode)" == "${LAPTOP}" ]] || \ - printf "${LAPTOP}" > /proc/sys/vm/laptop_mode & - [[ "$(sysctl -n vm.dirty_writeback_centisecs)" == "${DIRTYWBC}" ]] || \ - printf "${DIRTYWBC}" > /proc/sys/vm/dirty_writeback_centisecs & - [[ "$(sysctl -n vm.dirty_expire_centisecs)" == "${DIRTYWBC}" ]] || \ - printf "${DIRTYWBC}" > /proc/sys/vm/dirty_expire_centisecs & - - # NMI watchdog - [[ -f /proc/sys/kernel/watchdog ]] && \ - printf "${NMIDOG}" > /proc/sys/kernel/watchdog & - - # SATA link power management - for i in /sys/class/scsi_host/host*/link_power_management_policy; do [[ -f "${i}" ]] && \ - printf "${POLICY}" > "${i}" & done & - - # Hard drives - [[ -n "$(command -v hdparm)" ]] && \ - hdparm -qB "${APM}" -qM "${AAM}" /dev/[hs]d[a-z] 2> /dev/null & - - # Block device autosuspend - for i in /sys/block/*/device/power/autosuspend_delay_ms; do \ - printf -- "${DISKAUTOSUSPEND}" > "${i}" & done & - - # Runtime power management for devices (with exceptions for devices by VID:PID) - for i in /sys/{class/*,bus/*/devices}/*/power/control; do \ - [[ "${CONTROL}" == "auto" ]] && \ - [[ -n "$(printf ${i} | grep msr[${CORES}-$((${CORES} * 2 - 1))])" || \ - -n "$(printf ${i} | grep machinecheck[${CORES}-$((${CORES} * 2 - 1))])" || \ - -n "$(ls $(printf ${i} | sed 's|power.*||g')/*/ | grep 046D\:C52B)" || \ - -n "$(ls $(printf ${i} | sed 's|power.*||g')/*/ | grep 054C\:0268)" || \ - -f "$(printf ${i} | sed 's|/power.*|/idVendor|g')" && \ - "$(cat $(printf ${i} | sed 's|/power.*|/idVendor|g'))" == "0424" && \ - "$(cat $(printf ${i} | sed 's|/power.*|/idProduct|g'))" == "a700" ]] && \ - continue ; printf "${CONTROL}" > "${i}" & done & - - # USB Autosuspend (with exceptions for devices by VID:PID) - for i in /sys/bus/usb/devices/*/power/autosuspend{,_delay_ms}; do \ - [[ "${AUTOSUSPEND}" == "1" ]] && \ - [[ -n "$(ls $(printf ${i} | sed 's|power.*||g')/*/ | grep 046D\:C52B)" || \ - -n "$(ls $(printf ${i} | sed 's|power.*||g')/*/ | grep 054C\:0268)" || \ - -f "$(printf ${i} | sed 's|/power.*|/idVendor|g')" && \ - "$(cat $(printf ${i} | sed 's|/power.*|/idVendor|g'))" == "0424" && \ - "$(cat $(printf ${i} | sed 's|/power.*|/idProduct|g'))" == "a700" ]] && \ - continue ; printf -- "${AUTOSUSPEND}" > "${i}" & done & - - # Powersaving for modules - for i in /sys/module/*/parameters/power_save; do \ - printf "${POWERSAVE}" > "${i}" & done & - for i in /sys/module/*/parameters/power_save_controller; do \ - printf "${CONTROLLER}" > "${i}" & done & - - # Network powersaving - for i in /sys/class/net/wl*; do \ - [[ -n "$(command -v iw)" ]] && \ - iw dev "$(printf ${i} | sed 's/^.*wl/wl/')" set power_save "${WLPOWERSAVE}" 2> /dev/null & done & - for i in /sys/class/net/e*; do \ - [[ -n "$(command -v ethtool)" ]] && \ - ethtool -s "$(printf ${i} | sed 's/^.*e/e/')" wol "${WOLA}" 2> /dev/null & done & - for i in /sys/class/net/*/device/power/wakeup; do \ - printf "${WOLB}" > "${i}" & done & - - # LEDs - for i in /sys/class/leds/*/brightness; do \ - printf "${LEDBRIGHT}" > "${i}" & done & - - # Nvidia PowerMizer - throttle_nvpm - - shift - unset GOVERNOR XPSTURBO HYPERTHREADS ENERGYPERF BACKLIGHT LAPTOP DIRTYWBC NMIDOG \ - POLICY APM AAM CONTROL AUTOSUSPEND POWERSAVE CONTROLLER \ - WLPOWERSAVE WOLA WOLB LEDBRIGHT NVPM - ;; - check|status) - check_ht - - check_gov - - check_turbo - - [[ -n "$(command -v x86_energy_perf_policy)" ]] && \ - printf "\nEnergy Perf Bias\n" && \ - x86_energy_perf_policy -r #SUID - - check_backlight - - echo -e "\nVirtual Memory (Swap)\n/proc/sys/vm/\n"\ - "laptop_mode\t\t\t$(cat /proc/sys/vm/laptop_mode)\n"\ - "dirty_writeback_centisecs\t$(cat /proc/sys/vm/dirty_writeback_centisecs)\n"\ - "dirty_expire_centisecs\t\t$(cat /proc/sys/vm/dirty_expire_centisecs)" - - [[ -f /proc/sys/kernel/watchdog ]] && \ - echo -e "\nNMI watchdog\n"\ - "/proc/sys/kernel/watchdog\t$(cat /proc/sys/kernel/watchdog)" - - printf "\nSATA link power management\n/sys/class/scsi_host/host*/link_power_management_policy\n" - for i in /sys/class/scsi_host/host*/link_power_management_policy; do \ - printf " ${i}\n$(cat ${i})\n"; done | sed 's|/sys/class/scsi_host/||g; s|/.*||g; N;s|\n|\t|' - - [[ -n "$(command -v hdparm)" ]] && \ - printf "\nHard drives\n/dev/[hs]d[a-z]\n" && \ - hdparm -B -M /dev/[hs]d[a-z] 2> /dev/null | sed 'N;s|\n||g; s|/dev/||g; s|\t| |g;' #SUID - - printf "\nBlock device autosuspend\n/sys/block/*/device/power/autosuspend_delay_ms\n" - for i in /sys/block/*/device/power/autosuspend_delay_ms; do \ - printf " ${i}\n$(cat ${i})\n"; done | sed 's|/sys/block/||g; s|/device/.*||g; s|/.*||g; N;s|\n|\t|' - - printf "\nRuntime power management\n/sys/{class/*,bus/*/devices}/*/power/control\n" - for i in /sys/{class/*,bus/*/devices}/*/power/control; do \ - printf " ${i}\n$(cat ${i})\n"; done | sed 's|/sys/class/||g; s|/sys/bus/||g; s|/devices||g; s|/power/control||g; N;s|\n|\t|' - - printf "\nUSB Autosuspend\n/sys/bus/usb/devices/*/power/autosuspend{,_delay_ms}\n" - for i in /sys/bus/usb/devices/*/power/autosuspend{,_delay_ms}; do \ - printf " ${i}\n$(cat ${i})\n"; done | sed 's|/sys/bus/usb/devices/||g; s|/.*||g; N;s|\n|\t|' - - printf "\nPower saving for modules\n/sys/module/*/parameters/power_save{,_controller}\n" - for i in /sys/module/*/parameters/power_save{,_controller}; do \ - printf " ${i}\n$(cat ${i})\n"; done | sed 's|/sys/module/||g; s|/parameters/.*||g; s|/.*||g; N;s|\n|\t|' - - printf "\nNetwork device powersaving\n/sys/class/net/{wl*,e*,*/device/power/wakeup}\n"; - [[ -n "$(command -v iw)" ]] && \ - for i in /sys/class/net/wl*; do \ - printf " ${i}\n$(iw dev $(printf ${i} | sed 's/^.*wl/wl/') get power_save)"; done | sed 's|^\t| |g;s|/sys/class/net/||g; s|/.*||g' - [[ -n "$(command -v ethtool)" ]] && \ - for i in /sys/class/net/e*; do \ - printf " ${i}\n$(ethtool $(printf ${i} | sed 's/^.*e/e/') | grep Wake-on)"; done | sed 's|^\t| |g;s|/sys/class/net/||g; s|/.*||g' - for i in /sys/class/net/*/device/power/wakeup; do \ - printf " ${i}\n$(cat ${i})\n"; done | sed 's|/sys/class/net/||g; s|/device/power/wakeup||g; s|/.*||g; N;s|\n|\t|' - - printf "\nLEDs\n/sys/class/leds/*/brightness\n" - for i in /sys/class/leds/*/brightness; do \ - printf " ${i}\n$(cat ${i})\n"; done | sed 's|/sys/class/leds/||g; s|/brightness||g; s|/.*||g; N;s|\n|\t|' - - check_nvpm - shift - ;; - help|*) - throttle_help - ;; - esac - [[ -z "${1}" ]] || wait # Hey, let's stop! :) *stops* ... YAY! =D -done - -unset CORES diff --git a/throttle-cut.service b/throttle-cut.service deleted file mode 100644 index 57f6ba7e0eee..000000000000 --- a/throttle-cut.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Throttle Cut - -[Service] -Type=idle -RemainAfterExit=yes -ExecStart=/usr/bin/throttle cut -StandardOutput=null -StandardError=journal - -[Install] -WantedBy=multi-user.target diff --git a/throttle-runtime-pm.rules b/throttle-runtime-pm.rules deleted file mode 100644 index f4cac9a6c17e..000000000000 --- a/throttle-runtime-pm.rules +++ /dev/null @@ -1,46 +0,0 @@ -## Throttle - Runtime management udev rules. -## Whitelisted Actions -ACTION!="add", GOTO="runtime_pm_rules_end" - -## Blacklisted Devices (USB Keyboard/Mouse, etc.) -# Logitec Unifying Reciever (occasionally disabled ?) -ATTR{idVendor}=="046d", ATTR{idProduct}=="c52b", GOTO="runtime_pm_rules_end" -# Standard Microsystems Corp. 2 Port Hub (doesn't charge with runtime pm ?) -ATTR{idVendor}=="0424", ATTR{idProduct}=="a700", GOTO="runtime_pm_rules_end" -# Charge Sixaxis/Dualshock 3 (disconnect or charge too slowly with runtime pm ?) -ATTR{idVendor}=="054c", ATTR{idProduct}=="0268", GOTO="runtime_pm_rules_end" - -# Asynchronous power transitions -SUBSYSTEMS=="*" ATTR{power/async}=="disabled", ATTR{power/async}="enabled" - -# Backlight -SUBSYSTEM=="backlight", TEST=="brightness", ATTR{brightness}="0" - -# Hard disk power saving -SUBSYSTEM=="scsi_host", KERNEL=="host*", ATTR{link_power_management_policy}="min_power" -KERNEL=="[hs]d[a-z]", ATTR{queue/rotational}=="1", RUN+="/usr/bin/hdparm -B 1 -M 128 /dev/%k" - -# Various subsystems runtime power management -SUBSYSTEMS=="*", ATTR{power/control}=="on", ATTR{power/control}="auto" - -# USB autosuspend devices after 1 sec (may disable some old devices!) -SUBSYSTEM=="usb", TEST=="power/autosuspend", ATTR{power/autosuspend}="1" -SUBSYSTEM=="usb", TEST=="power/autosuspend_delay_ms", ATTR{power/autosuspend_delay_ms}="1" - -# Various subsystems power saving -SUBSYSTEMS=="*", TEST=="parameters/power_save", ATTR{parameters/power_save}="1" -SUBSYSTEMS=="*", ATTR{parameters/power_save_controller}=="N", ATTR{parameters/power_save_controller}="Y" - -# Universally enable D3 Cold -DRIVER=="*", ATTR{d3cold_allowed}=="0", ATTR{d3cold_allowed}="1" - -# Network Powersaving -SUBSYSTEM=="net", KERNEL=="wl*", RUN+="/usr/bin/iw dev %k set power_save on" -SUBSYSTEM=="net", KERNEL=="e*", RUN+="/usr/sbin/ethtool -s %k wol d" -SUBSYSTEM=="net", TEST=="device/power/wakeup", ATTR{device/power/wakeup}="disabled" - -# Reduce LED Brightness -SUBSYSTEM=="leds", TEST=="brightness", ATTR{brightness}="0" - -# Exit -LABEL="runtime_pm_rules_end" |