diff --git a/.gitignore b/.gitignore index 31e43df..3dcb859 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ /0.5.tar.gz /0.6.tar.gz +/0.7.tar.gz +/0.8.tar.gz /0.9.tar.gz +/1.0.tar.gz diff --git a/sources b/sources index 0e78a5f..8595d36 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (0.9.tar.gz) = 126d11739f2438eb9cf8c496fc7d8cecfb05b578c2ae99264ee53d9fb85dfeab59456483867f21c621d0db6793468f7b0bd77868e999801115e157e1ba383610 +SHA512 (1.0.tar.gz) = ae3a14cf4b89c3ab2376ac7feaa60d5125850b3afccf8aa7414376eed47294886981f38578901e87489741da2c0904906a0fea7c50119662aad68aa6a8c7d4b3 diff --git a/tlp-initfix.patch b/tlp-initfix.patch deleted file mode 100644 index 7a0edec..0000000 --- a/tlp-initfix.patch +++ /dev/null @@ -1,53 +0,0 @@ -commit d26343c11b653b700ca06cea99d3230a9f0b7465 -Author: Thomas Koch -Date: Wed Jan 18 18:45:28 2017 +0100 - - sysvinit: add chkconfig header and Makefile variable TLP_SYSV - - Requested by the Fedora package maintainer for epel6 packaging. - - Reference: - * Issue #248: https://github.com/linrunner/TLP/issues/248 - -diff --git a/Makefile b/Makefile -index 78e2269..3caf543 100644 ---- a/Makefile -+++ b/Makefile -@@ -9,6 +9,7 @@ TLP_ULIB ?= /lib/udev - TLP_NMDSP ?= /etc/NetworkManager/dispatcher.d - TLP_CONF ?= /etc/default/tlp - TLP_SYSD ?= /lib/systemd/system -+TLP_SYSV ?= /etc/init.d - TLP_SHCPL ?= /usr/share/bash-completion/completions - TLP_MAN ?= /usr/share/man - -@@ -21,6 +22,7 @@ _ULIB = $(DESTDIR)$(TLP_ULIB) - _NMDSP = $(DESTDIR)$(TLP_NMDSP) - _CONF = $(DESTDIR)$(TLP_CONF) - _SYSD = $(DESTDIR)$(TLP_SYSD) -+_SYSV = $(DESTDIR)$(TLP_SYSV) - _SHCPL = $(DESTDIR)$(TLP_SHCPL) - _MAN = $(DESTDIR)$(TLP_MAN) - -@@ -76,7 +78,7 @@ endif - install -D -m 644 tlp.rules $(_ULIB)/rules.d/85-tlp.rules - [ -f $(_CONF) ] || install -D -m 644 default $(_CONF) - ifneq ($(TLP_NO_INIT),1) -- install -D -m 755 tlp.init $(DESTDIR)/etc/init.d/tlp -+ install -D -m 755 tlp.init $(_SYSV)/tlp - endif - ifeq ($(TLP_WITH_SYSTEMD),1) - install -D -m 644 tlp.service $(_SYSD)/tlp.service -diff --git a/tlp.init b/tlp.init -index a3e6d35..0174e39 100755 ---- a/tlp.init -+++ b/tlp.init -@@ -4,6 +4,8 @@ - # - # Copyright (c) 2017 Thomas Koch - # This software is licensed under the GPL v2 or later. -+# -+# chkconfig: 2345 98 01 - - ### BEGIN INIT INFO - # Provides: tlp diff --git a/tlp-mitigate-slowshutdown.patch b/tlp-mitigate-slowshutdown.patch deleted file mode 100644 index 6ac490d..0000000 --- a/tlp-mitigate-slowshutdown.patch +++ /dev/null @@ -1,100 +0,0 @@ -commit dabd0e900f6e10c358436c584c51dd1f55c320d2 -Author: Thomas Koch -Date: Sun Mar 12 20:53:32 2017 +0100 - - Issue #242: mitigate slow shutdown - - Rationale: 'systemctl stop tlp' invokes 'nmcli radio on ' in systemd - context. This causes nmcli to hang for ~20 sec after switching the device. - The cause is unknown – when invoking nmcli directly it doesn't hang. - - Workaround: - * Execute radio switching last in 'tlp init [start|stop]' - * Add TimeoutStopSec=3 to tlp.service so systemd will kill the hanging - stop task after 3 secs. - - Caveat: does not cover all cases yet. When two radios (e.g. wifi and - wwan) are to be switched, the second switch never happens. - -diff --git a/tlp.in b/tlp.in -index bc2f852..fd0486c 100644 ---- a/tlp.in -+++ b/tlp.in -@@ -96,23 +96,21 @@ case "$mode" in - # do init business ... - case $mode2 in - start) -- # apply radio states -- set_radio_device_states start -- -- # apply power save settings -- but only if not previously run -- # (by the udev rule) for the same power state -- if compare_and_save_power_state $pwrmode; then -- echo -n "Applying power save settings..." -- apply_common_settings $pwrmode -- [ "$pwrmode" = "1" ] && poweroff_drivebay 0 -- [ "$X_TLP_USB_MODE" = "1" ] && set_usb_suspend 0 auto -- echo "done." -- fi -+ # apply power save settings -+ compare_and_save_power_state $pwrmode -+ echo -n "Applying power save settings..." -+ apply_common_settings $pwrmode -+ poweroff_drivebay $pwrmode 0 -+ [ "$X_TLP_USB_MODE" = "1" ] && set_usb_suspend 0 auto -+ echo "done." - - # apply battery settings - echo -n "Setting battery charge thresholds..." - set_charge_thresholds - echo "done." -+ -+ # apply radio states -+ set_radio_device_states start - ;; - - restart|force-reload) -@@ -131,14 +129,6 @@ case "$mode" in - ;; - - stop) -- set_radio_device_states stop -- -- if [ "$USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN" = "1" ]; then -- echo -n "Disabling usb autosuspend..." -- set_usb_suspend 0 on -- echo "done." -- fi -- - # remove usb startup flag - [ -f $USB_DONE ] && rm $USB_DONE - -@@ -149,6 +139,16 @@ case "$mode" in - echo -n "Applying power save settings..." - apply_common_settings 0 - echo "done." -+ -+ # disable usb autosuspend if configured -+ if [ "$USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN" = "1" ]; then -+ echo -n "Disabling usb autosuspend..." -+ set_usb_suspend 0 on -+ echo "done." -+ fi -+ -+ # apply radio states -+ set_radio_device_states stop - ;; - - *) -diff --git a/tlp.service.in b/tlp.service.in -index 7dc4b2c..67c131c 100644 ---- a/tlp.service.in -+++ b/tlp.service.in -@@ -15,6 +15,7 @@ Type=oneshot - RemainAfterExit=yes - ExecStart=@TLP_SBIN@/tlp init start - ExecStop=@TLP_SBIN@/tlp init stop -+TimeoutStopSec=3 - - [Install] - WantedBy=multi-user.target diff --git a/tlp-stat-fix.patch b/tlp-stat-fix.patch deleted file mode 100644 index 3c49a9e..0000000 --- a/tlp-stat-fix.patch +++ /dev/null @@ -1,83 +0,0 @@ -commit 9498a85d1cedb78a38b54f243c9c4a3daad5bcc6 -Author: Thomas Koch -Date: Tue Feb 28 20:33:44 2017 +0100 - - tlp-stat: intercept non-existing or invalid charge values - - Reference: - * Issue #256: https://github.com/linrunner/TLP/issues/256 - -diff --git a/tlp-stat.in b/tlp-stat.in -index ca08527..8aeb6a6 100644 ---- a/tlp-stat.in -+++ b/tlp-stat.in -@@ -58,6 +58,15 @@ no_runtimepm=0 - - # --- Functions - -+catparm () { # echo contents of sysfile or default if non-existent or unreadable -+ # $1: sysfile, $2: default value -+ local val="$(cat $1 2> /dev/null)" -+ [ -n "$val" ] || val="$2" # sysfile nonexistent or read failed -+ -+ printf "%s" $val -+ return 0 -+} -+ - printparm () { # formatted output of sysfile - general - # $1: format, $2: sysfile, $3: namsg, $4: cutoff - local format="$1" -@@ -257,7 +266,7 @@ check_ata_errors () { # check kernel log for ata errors - # count matching error lines - echo $( dmesg | egrep -c "${RE_ATA_ERROR}" 2> /dev/null ) - else -- # no values in question configured -+ # no values in question configured - echo "0" - fi - -@@ -1115,9 +1124,9 @@ if [ "$show_bat" = "1" ] || [ "$show_all" = "1" ]; then - echo - - # store values for charge / capacity calculation below -- ed=$(cat $batd/design_capacity) -- ef=$(cat $batd/last_full_capacity) -- en=$(cat $batd/remaining_capacity) -+ ed=$(catparm $batd/design_capacity 0) -+ ef=$(catparm $batd/last_full_capacity 0) -+ en=$(catparm $batd/remaining_capacity 0) - - # show charge + capacity - lcnt=0 -@@ -1184,9 +1193,9 @@ if [ "$show_bat" = "1" ] || [ "$show_all" = "1" ]; then - printparm "%-59s = ##%6d## [mW]" $batd/power_now "" 000 - - # store values for charge / capacity calculation below -- ed=$(cat $batd/energy_full_design) -- ef=$(cat $batd/energy_full) -- en=$(cat $batd/energy_now) -+ ed=$(catparm $batd/energy_full_design 0) -+ ef=$(catparm $batd/energy_full 0) -+ en=$(catparm $batd/energy_now 0) - - elif [ -f $batd/charge_full ]; then - printparm "%-59s = ##%6d## [mAh]" $batd/charge_full_design "" 000 -@@ -1195,9 +1204,15 @@ if [ "$show_bat" = "1" ] || [ "$show_all" = "1" ]; then - printparm "%-59s = ##%6d## [mA]" $batd/current_now "" 000 - - # store values for charge / capacity calculation below -- ed=$(cat $batd/charge_full_design) -- ef=$(cat $batd/charge_full) -- en=$(cat $batd/charge_now) -+ ed=$(catparm $batd/charge_full_design 0) -+ ef=$(catparm $batd/charge_full 0) -+ en=$(catparm $batd/charge_now 0) -+ -+ else -+ ed=0 -+ ef=0 -+ en=0 -+ - fi - if [ $tpbat -eq 1 ]; then - print_tp_batstate $batd/status diff --git a/tlp.spec b/tlp.spec index 4141303..f5792b7 100644 --- a/tlp.spec +++ b/tlp.spec @@ -1,19 +1,11 @@ Name: tlp -Version: 0.9 -Release: 4%{?dist} +Version: 1.0 +Release: 1%{?dist} Summary: Advanced power management tool for Linux License: GPLv2+ URL: http://linrunner.de/en/tlp/tlp.html Source0: https://github.com/linrunner/TLP/archive/%{version}.tar.gz -#Cherry-pick upstream fixes: -#https://github.com/linrunner/TLP/commit/9498a85d1cedb78a38b54f243c9c4a3daad5bcc6 -Patch0: %{name}-stat-fix.patch -#https://github.com/linrunner/TLP/commit/dabd0e900f6e10c358436c584c51dd1f55c320d2 -Patch1: %{name}-mitigate-slowshutdown.patch -#https://github.com/linrunner/TLP/commit/d26343c11b653b700ca06cea99d3230a9f0b7465 -Patch2: %{name}-initfix.patch - #The following requires are not detected: Requires: ethtool Requires: hdparm @@ -56,10 +48,10 @@ based on dock events and the Network Manager connection status. %autosetup -n TLP-%{version} %build -make +%make_build %install -make install DESTDIR=%{buildroot} TLP_NO_INIT=0 \ +%make_install TLP_NO_INIT=0 \ TLP_NO_PMUTILS=0 TLP_WITH_SYSTEMD=0 \ TLP_SYSV=%{_initddir} \ TLP_PLIB=%{_libdir}/pm-utils @@ -73,7 +65,7 @@ make install-man DESTDIR=%{buildroot} %{_bindir}/* %{_sbindir}/* %{_mandir}/man*/* -%{_datadir}/tlp-pm +%{_datadir}/tlp %{_libdir}/pm-utils/sleep.d/49tlp /lib/udev/rules.d/85-tlp.rules /lib/udev/tlp-usb-udev @@ -100,6 +92,9 @@ if [ "$1" -ge "1" ] ; then fi %changelog +* Sun Jun 18 2017 Jeremy Newton - 1.0-1 +- Update to 1.0 + * Mon Mar 20 2017 Jeremy Newton - 0.9-4 - Cherry-pick upstream fix for mitigate slow shutdown - Cherry-pick upstream fix for tlp-stat @@ -117,24 +112,24 @@ fi * Mon Jan 16 2017 Jeremy Newton - 0.9-1 - Update to 0.9 -* Mon Nov 17 2014 Jeremy Newton - 0.6-4 +* Mon Nov 17 2014 Jeremy Newton - 0.6-4 - Redundant Dependancy -* Tue Nov 4 2014 Jeremy Newton - 0.6-3 +* Tue Nov 4 2014 Jeremy Newton - 0.6-3 - Wrong udev dir for el6 - Preset shouldn't be on el6 (f18+, EPEL 7+) - Missing dep (pciutils) - Bash completion should be in etc (el6 only) -* Tue Oct 28 2014 Jeremy Newton - 0.6-2 +* Tue Oct 28 2014 Jeremy Newton - 0.6-2 - Add pmutils for suspend and resume -* Mon Oct 27 2014 Jeremy Newton - 0.6-1 +* Mon Oct 27 2014 Jeremy Newton - 0.6-1 - New Upstream Version -* Mon Apr 21 2014 Jeremy Newton - 0.5-2 +* Mon Apr 21 2014 Jeremy Newton - 0.5-2 - Various tweaking - Move bashcompletion file to silence rpmlint warning -* Sun Apr 20 2014 Jeremy Newton - 0.5-1 +* Sun Apr 20 2014 Jeremy Newton - 0.5-1 - Initial fedora package