summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Junghans <ottxor@gentoo.org>2013-11-04 04:05:31 +0000
committerChristoph Junghans <ottxor@gentoo.org>2013-11-04 04:05:31 +0000
commit0e690837a3471410b795739d2ab408174ce9d857 (patch)
treef7621126c5c084721e2b4e4dfe13086a71100d46 /app-laptop
parentBeta channel bump. (diff)
downloadgentoo-2-0e690837a3471410b795739d2ab408174ce9d857.tar.gz
gentoo-2-0e690837a3471410b795739d2ab408174ce9d857.tar.bz2
gentoo-2-0e690837a3471410b795739d2ab408174ce9d857.zip
fixes for new call syntax (bug #485526#c2)
(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key C2000586)
Diffstat (limited to 'app-laptop')
-rw-r--r--app-laptop/tpacpi-bat/ChangeLog6
-rw-r--r--app-laptop/tpacpi-bat/files/tpacpi-bat.initd.178
-rw-r--r--app-laptop/tpacpi-bat/tpacpi-bat-9999.ebuild8
3 files changed, 88 insertions, 4 deletions
diff --git a/app-laptop/tpacpi-bat/ChangeLog b/app-laptop/tpacpi-bat/ChangeLog
index b63aa7b75838..618609960531 100644
--- a/app-laptop/tpacpi-bat/ChangeLog
+++ b/app-laptop/tpacpi-bat/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for app-laptop/tpacpi-bat
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-laptop/tpacpi-bat/ChangeLog,v 1.3 2013/09/21 00:49:05 ottxor Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/tpacpi-bat/ChangeLog,v 1.4 2013/11/04 04:05:31 ottxor Exp $
+
+ 04 Nov 2013; Christoph Junghans <ottxor@gentoo.org> +files/tpacpi-bat.initd.1,
+ tpacpi-bat-9999.ebuild:
+ fixes for new call syntax (bug #485526#c2)
*tpacpi-bat-1.0-r1 (21 Sep 2013)
diff --git a/app-laptop/tpacpi-bat/files/tpacpi-bat.initd.1 b/app-laptop/tpacpi-bat/files/tpacpi-bat.initd.1
new file mode 100644
index 000000000000..0150457ee6e0
--- /dev/null
+++ b/app-laptop/tpacpi-bat/files/tpacpi-bat.initd.1
@@ -0,0 +1,78 @@
+#!/sbin/runscript
+# Copyright (C) 2012-2013 Christoph Junghans <ottxor@gentoo.org>
+#
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+extra_started_commands="low high info"
+
+BATS="1"
+
+depend() {
+ after modules
+}
+
+start() {
+ local state1
+
+ ebegin "Making sure that module 'acpi_call' is loaded"
+ modprobe acpi_call
+ state1=$?
+ eend ${state1}
+
+ [ "${state1}" -ne "0" ] && return 1
+
+ ebegin "Starting ${SVCNAME}"
+ set_all ${TPACPI_BAT_THRESH_START} ${TPACPI_BAT_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 ${TPACPI_BAT_HIGH_THRESH_START} ${TPACPI_BAT_HIGH_THRESH_STOP}
+}
+
+low() {
+ require_started
+
+ einfo "Switching ${SVCNAME} to low thesholds"
+ set_all ${TPACPI_BAT_LOW_THRESH_START} ${TPACPI_BAT_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"
+ /usr/bin/tpacpi-bat -s startChargeThreshold ${bat} ${tstart}
+ /usr/bin/tpacpi-bat -s stopChargeThreshold ${bat} ${tstop}
+ eend $?
+ done
+}
+
+info() {
+ local tstart
+ local tstop
+ local bat
+
+ require_started
+
+ for bat in ${BATS}; do
+ tstart=$(/usr/bin/tpacpi-bat -g startChargeThreshold ${bat})
+ tstop=$(/usr/bin/tpacpi-bat -g stopChargeThreshold ${bat})
+ einfo "Battery ${bat}: ${tstart} ${tstop}"
+ done
+}
diff --git a/app-laptop/tpacpi-bat/tpacpi-bat-9999.ebuild b/app-laptop/tpacpi-bat/tpacpi-bat-9999.ebuild
index c35cea1fbd0b..8ab9b33471ac 100644
--- a/app-laptop/tpacpi-bat/tpacpi-bat-9999.ebuild
+++ b/app-laptop/tpacpi-bat/tpacpi-bat-9999.ebuild
@@ -1,10 +1,10 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-laptop/tpacpi-bat/tpacpi-bat-9999.ebuild,v 1.3 2013/01/11 22:39:50 ottxor Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/tpacpi-bat/tpacpi-bat-9999.ebuild,v 1.4 2013/11/04 04:05:31 ottxor Exp $
EAPI=5
-inherit eutils
+inherit eutils systemd
if [ "${PV}" = "9999" ]; then
inherit git-2
@@ -29,6 +29,8 @@ RDEPEND="sys-power/acpi_call
src_install() {
dodoc README battery_asl
dobin tpacpi-bat
- newinitd "${FILESDIR}"/${PN}.initd.0 ${PN}
+ newinitd "${FILESDIR}"/${PN}.initd.1 ${PN}
newconfd "${FILESDIR}"/${PN}.confd.0 ${PN}
+ systemd_newunit tpacpi.service ${PN}.service
+
}