diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 20:56:41 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 20:56:41 +0100 |
commit | d87262dd706fec50cd150aab3e93883b6337466d (patch) | |
tree | 246b44c33ad7a57550430b0a60fa0df86a3c9e68 /app-laptop/tp_smapi/files | |
parent | 71bc00c87bba1ce31de0dac6c3b7fd1aee6917fc (diff) |
gentoo resync : 14.07.2018
Diffstat (limited to 'app-laptop/tp_smapi/files')
-rw-r--r-- | app-laptop/tp_smapi/files/tp_smapi-0.40-confd | 20 | ||||
-rw-r--r-- | app-laptop/tp_smapi/files/tp_smapi-0.40-initd | 92 |
2 files changed, 0 insertions, 112 deletions
diff --git a/app-laptop/tp_smapi/files/tp_smapi-0.40-confd b/app-laptop/tp_smapi/files/tp_smapi-0.40-confd deleted file mode 100644 index 7c80f35e390b..000000000000 --- a/app-laptop/tp_smapi/files/tp_smapi-0.40-confd +++ /dev/null @@ -1,20 +0,0 @@ -# /etc/conf.d/smapi: config file for /etc/init.d/smapi - -# use '/etc/init.d/smapi info' at any time to check the thresholds -# currently used by the driver -# Note that the kernel does some sanity checking on the values and -# will not accept any combination of values you may try to set up. -# (i.e. stop value lower than start) So if the output of info does -# not match what you wanted the driver probably did not like your -# configuration. - -# default thresholds for '/etc/init.d/smapi start' -SMAPI_THRESH_START="30" -SMAPI_THRESH_STOP="85" -# values to be used for '/etc/init.d/smapi low' -SMAPI_LOW_THRESH_START="${SMAPI_THRESH_START}" -SMAPI_LOW_THRESH_STOP="${SMAPI_THRESH_STOP}" - -# values to be used for '/etc/init.d/smapi high' -SMAPI_HIGH_THRESH_START="95" -SMAPI_HIGH_THRESH_STOP="100" diff --git a/app-laptop/tp_smapi/files/tp_smapi-0.40-initd b/app-laptop/tp_smapi/files/tp_smapi-0.40-initd deleted file mode 100644 index 3b8c10d9274a..000000000000 --- a/app-laptop/tp_smapi/files/tp_smapi-0.40-initd +++ /dev/null @@ -1,92 +0,0 @@ -#!/sbin/openrc-run -# Copyright (C) 2011 Henning Schild <henning@wh9.tu-dresden.de> -# Copyright (C) 2011 Sebastian Pipping <sebastian@pipping.org> -# -# Distributed under the terms of the GNU General Public License, v2 or later - -extra_started_commands="low high info" - -SMAPI_SYSFS="/sys/devices/platform/smapi" -BATS="BAT0 BAT1" - -depend() { - after modules -} - -start() { - local state1 - local state2 - - ebegin "Making sure that module 'tp_smapi' is loaded" - modprobe tp_smapi - state1=$? - eend ${state1} - - ebegin "Checking for \"${SMAPI_SYSFS}\"" - test -d "${SMAPI_SYSFS}" - state2=$? - eend ${state2} - - if [ "${state1}" -ne "0" ] || [ "${state2}" -ne "0" ]; then - return 1 - fi - - ebegin "Starting ${SVCNAME}" - set_all ${SMAPI_THRESH_START} ${SMAPI_THRESH_STOP} - eend $? -} - -stop() { - einfo "Nothing required to be done to stop ${SVCNAME}" -} - -require_started() { - if ! service_started; then - "${RC_SERVICE}" start || return $? - fi -} - -high() { - require_started - - einfo "Switching ${SVCNAME} to high thesholds" - set_all ${SMAPI_HIGH_THRESH_START} ${SMAPI_HIGH_THRESH_STOP} -} - -low() { - require_started - - einfo "Switching ${SVCNAME} to low thesholds" - set_all ${SMAPI_LOW_THRESH_START} ${SMAPI_LOW_THRESH_STOP} -} - -set_all() { - local tstart=$1 - local tstop=$2 - local bat - - for bat in ${BATS}; do - ebegin " setting thresholds for ${bat}: $tstart $tstop" - echo ${tstart} > ${SMAPI_SYSFS}/${bat}/start_charge_thresh - echo ${tstop} > ${SMAPI_SYSFS}/${bat}/stop_charge_thresh - eend $? - done -} - -info() { - local presence - local tstart - local tstop - local bat - - require_started - - for bat in ${BATS}; do - tstart=$(cat ${SMAPI_SYSFS}/${bat}/start_charge_thresh) - tstop=$(cat ${SMAPI_SYSFS}/${bat}/stop_charge_thresh) - if [ "$(cat ${SMAPI_SYSFS}/${bat}/installed)" -eq "1" ]; then - presence=" [installed]" - fi - einfo "${bat}: ${tstart} ${tstop}${presence}" - done -} |