Remove old patches

epel9
Mystro256 8 years ago
parent 69c74bbd88
commit 1235305f27

@ -1,199 +0,0 @@
--- a/Makefile
+++ b/Makefile
@@ -5,11 +5,10 @@
# definitions and absolute paths in scripts too!
# Evaluate parameters
-TLP_LIBDIR ?= /usr/lib
TLP_SBIN ?= /usr/sbin
TLP_BIN ?= /usr/bin
-TLP_TLIB = $(TLP_LIBDIR)/tlp-pm
-TLP_PLIB = $(TLP_LIBDIR)/pm-utils
+TLP_TLIB ?= /usr/share/tlp-pm
+TLP_PLIB ?= /usr/lib/pm-utils
TLP_ULIB ?= /lib/udev
TLP_ACPI ?= /etc/acpi
TLP_NMDSP ?= /etc/NetworkManager/dispatcher.d
--- a/tlp
+++ b/tlp
@@ -5,22 +5,21 @@
# This software is licensed under the GPL v2 or later.
# --- Constants
-readonly LIBDIRS="/usr/lib/tlp-pm /usr/lib64/tlp-pm"
+readonly LIBDIR="/usr/share/tlp-pm"
readonly LIBS="tlp-functions tlp-rf-func"
# --- Locate and source libraries
-for libdir in $LIBDIRS; do [ -d $libdir ] && break; done
-if [ ! -d $libdir ]; then
- echo "Error: missing library directory ($LIBDIRS)." 1>&2
+if [ ! -d $LIBDIR ]; then
+ echo "Error: missing library directory ($LIBDIR)." 1>&2
exit 1
fi
for lib in $LIBS; do
- if [ ! -f $libdir/$lib ]; then
- echo "Error: missing function library \'$libdir/$lib\'." 1>&2
+ if [ ! -f $LIBDIR/$lib ]; then
+ echo "Error: missing function library \'$LIBDIR/$lib\'." 1>&2
exit 1
fi
- . $libdir/$lib
+ . $LIBDIR/$lib
done
# --- Subroutines
--- a/tlp-functions
+++ b/tlp-functions
@@ -33,7 +33,7 @@ readonly SYSTEMD=systemd
readonly SYSTEMCTL=systemctl
readonly INITCTL=initctl
-readonly TPACPIBAT=$libdir/tpacpi-bat # libdir is initialized by main program
+readonly TPACPIBAT=$LIBDIR/tpacpi-bat # LIBDIR is initialized by main program
readonly TPACPIDIR=/sys/devices/platform/thinkpad_acpi
readonly SMAPIDIR=/sys/devices/platform/smapi
--- a/tlp-rdw-nm
+++ b/tlp-rdw-nm
@@ -6,19 +6,18 @@
# This software is licensed under the GPL v2 or later.
# --- Constants
-readonly LIBDIRS="/usr/lib/tlp-pm /usr/lib64/tlp-pm"
+readonly LIBDIR="/usr/share/tlp-pm"
readonly LIBS="tlp-functions tlp-rf-func"
readonly RDW_NM_LOCK="rdw_nm"
readonly RDW_NM_LOCKTIME=2
# --- Locate and source libraries
-for libdir in $LIBDIRS; do [ -d $libdir ] && break; done
-[ -d $libdir ] || exit 0
+[ -d $LIBDIR ] || exit 0
for lib in $LIBS; do
- [ -f $libdir/$lib ] || exit 0
- . $libdir/$lib
+ [ -f $LIBDIR/$lib ] || exit 0
+ . $LIBDIR/$lib
done
# --- MAIN
--- a/tlp-rdw-udev
+++ b/tlp-rdw-udev
@@ -5,19 +5,18 @@
# This software is licensed under the GPL v2 or later.
# --- Constants
-readonly LIBDIRS="/usr/lib/tlp-pm /usr/lib64/tlp-pm"
+readonly LIBDIR="/usr/share/tlp-pm"
readonly LIBS="tlp-functions tlp-rf-func"
readonly RDW_DOCK_LOCK="rdw_dock_lock"
readonly RDW_DOCK_LOCKTIME=2
# --- Locate and source libraries
-for libdir in $LIBDIRS; do [ -d $libdir ] && break; done
-[ -d $libdir ] || exit 0
+[ -d $LIBDIR ] || exit 0
for lib in $LIBS; do
- [ -f $libdir/$lib ] || exit 0
- . $libdir/$lib
+ [ -f $LIBDIR/$lib ] || exit 0
+ . $LIBDIR/$lib
done
# --- MAIN
--- a/tlp-rf
+++ b/tlp-rf
@@ -5,16 +5,15 @@
# This software is licensed under the GPL v2 or later.
# --- Constants
-readonly LIBDIRS="/usr/lib/tlp-pm /usr/lib64/tlp-pm"
+readonly LIBDIRS="/usr/share/tlp-pm"
readonly LIBS="tlp-functions tlp-rf-func"
# --- Locate and source libraries
-for libdir in $LIBDIRS; do [ -d $libdir ] && break; done
-[ -d $libdir ] || exit 0
+[ -d $LIBDIR ] || exit 0
for lib in $LIBS; do
- [ -f $libdir/$lib ] || exit 0
- . $libdir/$lib
+ [ -f $LIBDIR/$lib ] || exit 0
+ . $LIBDIR/$lib
done
# --- MAIN
--- a/tlp-run-on
+++ b/tlp-run-on
@@ -5,22 +5,21 @@
# This software is licensed under the GPL v2 or later.
# --- Constants
-readonly LIBDIRS="/usr/lib/tlp-pm /usr/lib64/tlp-pm"
+readonly LIBDIR="/usr/share/tlp-pm"
readonly LIBS="tlp-functions"
# --- Locate and source libraries
-for libdir in $LIBDIRS; do [ -d $libdir ] && break; done
-if [ ! -d $libdir ]; then
- echo "Error: missing library directory ($LIBDIRS)." 1>&2
+if [ ! -d $LIBDIR ]; then
+ echo "Error: missing library directory ($LIBDIR)." 1>&2
exit 1
fi
for lib in $LIBS; do
- if [ ! -f $libdir/$lib ]; then
- echo "Error: missing function library \'$libdir/$lib\'." 1>&2
+ if [ ! -f $LIBDIR/$lib ]; then
+ echo "Error: missing function library \'$LIBDIR/$lib\'." 1>&2
exit 1
fi
- . $libdir/$lib
+ . $LIBDIR/$lib
done
# --- MAIN
--- a/tlp-stat
+++ b/tlp-stat
@@ -6,7 +6,7 @@
# --- Constants
-readonly LIBDIRS="/usr/lib/tlp-pm /usr/lib64/tlp-pm"
+readonly LIBDIR="/usr/share/tlp-pm"
readonly LIBS="tlp-functions tlp-rf-func"
readonly TLPUSB=tlp-usblist
@@ -330,18 +330,17 @@ read_args () { # read command line argum
# --- Locate and source libraries
-for libdir in $LIBDIRS; do [ -d $libdir ] && break; done
-if [ ! -d $libdir ]; then
- echo "Error: missing library directory ($LIBDIRS)." 1>&2
+if [ ! -d $LIBDIR ]; then
+ echo "Error: missing library directory ($LIBDIR)." 1>&2
exit 1
fi
for lib in $LIBS; do
- if [ ! -f $libdir/$lib ]; then
- echo "Error: missing function library \'$libdir/$lib\'." 1>&2
+ if [ ! -f $LIBDIR/$lib ]; then
+ echo "Error: missing function library \'$LIBDIR/$lib\'." 1>&2
exit 1
fi
- . $libdir/$lib
+ . $LIBDIR/$lib
done
# --- MAIN

@ -1,100 +0,0 @@
commit dabd0e900f6e10c358436c584c51dd1f55c320d2
Author: Thomas Koch <linrunner@gmx.net>
Date: Sun Mar 12 20:53:32 2017 +0100
Issue #242: mitigate slow shutdown
Rationale: 'systemctl stop tlp' invokes 'nmcli radio on <device>' 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

@ -1,83 +0,0 @@
commit 9498a85d1cedb78a38b54f243c9c4a3daad5bcc6
Author: Thomas Koch <linrunner@gmx.net>
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
Loading…
Cancel
Save