summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sping@gentoo.org>2011-06-14 15:31:20 +0000
committerSebastian Pipping <sping@gentoo.org>2011-06-14 15:31:20 +0000
commitb94de0fb944e15f3d00b9e1a4addbece792a6129 (patch)
tree7376fe696082bc0491f4e7a3bcb1aab43741a50d /app-laptop
parentVersion bump. Respect CC (diff)
downloadhistorical-b94de0fb944e15f3d00b9e1a4addbece792a6129.tar.gz
historical-b94de0fb944e15f3d00b9e1a4addbece792a6129.tar.bz2
historical-b94de0fb944e15f3d00b9e1a4addbece792a6129.zip
Add init script (bug #346785)
Package-Manager: portage-2.1.10.2/cvs/Linux x86_64
Diffstat (limited to 'app-laptop')
-rw-r--r--app-laptop/tp_smapi/ChangeLog8
-rw-r--r--app-laptop/tp_smapi/Manifest15
-rw-r--r--app-laptop/tp_smapi/files/tp_smapi-0.40-confd20
-rwxr-xr-xapp-laptop/tp_smapi/files/tp_smapi-0.40-initd78
-rw-r--r--app-laptop/tp_smapi/tp_smapi-0.40-r2.ebuild65
5 files changed, 174 insertions, 12 deletions
diff --git a/app-laptop/tp_smapi/ChangeLog b/app-laptop/tp_smapi/ChangeLog
index 58f5872d66a9..96b7147f7649 100644
--- a/app-laptop/tp_smapi/ChangeLog
+++ b/app-laptop/tp_smapi/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-laptop/tp_smapi
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-laptop/tp_smapi/ChangeLog,v 1.38 2011/05/20 11:20:42 tomka Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/tp_smapi/ChangeLog,v 1.39 2011/06/14 15:31:20 sping Exp $
+
+*tp_smapi-0.40-r2 (14 Jun 2011)
+
+ 14 Jun 2011; Sebastian Pipping <sping@gentoo.org> +tp_smapi-0.40-r2.ebuild,
+ +files/tp_smapi-0.40-confd, +files/tp_smapi-0.40-initd:
+ Add init script, main work by Henning Schild (bug #346785)
20 May 2011; Thomas Kahle <tomka@gentoo.org> tp_smapi-0.40-r1.ebuild:
x86 stable per bug 365559
diff --git a/app-laptop/tp_smapi/Manifest b/app-laptop/tp_smapi/Manifest
index f252ea5eea4e..fca067c1d0e2 100644
--- a/app-laptop/tp_smapi/Manifest
+++ b/app-laptop/tp_smapi/Manifest
@@ -1,9 +1,8 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA256
-
AUX fix_header_check.patch 701 RMD160 c1a79ee4d8501831b3f7522848f979993be5eb8d SHA1 17941fc5583c4740618627d4c1c925e6217dcedd SHA256 5cfc979ac6f9f3f1fb94625b3bf3a31fc6132d3ad8670d38cff2b2116400015c
AUX thinkpad_ec_semaphore.patch 353 RMD160 18d03b2db5816f0e560a70f56d85637f9df7fb08 SHA1 7016136350372382a8883fa0ca8eaee851fe31f1 SHA256 c6a398dae67f84069dcb5482c96d8f97391c2f6699c1267b0a180cbb17822e29
AUX tp_smapi-0.40-2.6.37.patch 1181 RMD160 602ba1598ee7175abfda516fe61ab96b80e2691e SHA1 ed3fbf2e06def4572e8dd2b9ee16e6aac8f500ed SHA256 b36523686dd1710ee8dae2b9ba6598572afe0d564c2278a7105a0fa27fe3d4d5
+AUX tp_smapi-0.40-confd 785 RMD160 55d174b025625dd51e128baaaad2271fbddc3cab SHA1 a2a6d5198230da99dfbd3f451406ec9989b3ae49 SHA256 3996b08957adea6f14e5a0e394212026dc73e6802a8dcd5aa9a3b413530c3fdb
+AUX tp_smapi-0.40-initd 1712 RMD160 28af942ca42cbc425203a6d813d97da2b7c8825d SHA1 2931a8a94a49397cf34c59edf691c3319c0e2b0f SHA256 fa787cd06631d182bfad6f3a5ceb082e6ae8545a095a0dc6a0b8234916fbe381
DIST tp_smapi-0.20.tgz 34365 RMD160 7798ff7da37717333475189c63488ba3d040171a SHA1 bfa0092aefbe989c2f21705bd5fef26833d755c5 SHA256 fd3e538e4f9abcd19177330293beeeb56f7f22c8d1ee3819f53276a911044634
DIST tp_smapi-0.21.tgz 27500 RMD160 ac6858d93e3db4e98e2a2e9df1a0ed0c848f4e30 SHA1 7915953d6bd64f6c6e76df5cde725fee83049f49 SHA256 b02d494e4a25f55a77bebe1c6d6b22c3357c9fba08cfc24362feaac55ea766b9
DIST tp_smapi-0.27.tgz 36124 RMD160 15ae9215c91d5ec3aac6110aa47da71bd66cb0d3 SHA1 dd0ce1b335ad98b08c49bfcc1dc881b35dc4f346 SHA256 a0687e565c3598ca3f343c36ed2df63802965961dbae5ab92202eaee9c8e0369
@@ -24,13 +23,7 @@ EBUILD tp_smapi-0.33.ebuild 1167 RMD160 eac737b19ef975cc4d04ad95fde8722ba464efeb
EBUILD tp_smapi-0.37.ebuild 1375 RMD160 d20a8e5f0f97cc71c351468ca7da8f2bd8146736 SHA1 442f08132388a61d1397eca9c8116f4373194abb SHA256 3de6b136c3100493a92c64d4634ec052a583b24448cc16607b431b2ede284baa
EBUILD tp_smapi-0.39.ebuild 1324 RMD160 fff44dd40738853eff0a21110324074604b3d569 SHA1 2c004e29d77639976c0ad7f31828d791ad7f2218 SHA256 964c3e9eb382f8ce487c161948dd72165bc0a5ed6960e0c5ada057f7b98766ac
EBUILD tp_smapi-0.40-r1.ebuild 1501 RMD160 6eadfe6e1205e1f30c90a251662a2b373e45cf91 SHA1 c98e259307d567708d156682b6c67cf0672b2e9d SHA256 6efbd77801a486c6633e9aa0a6e9c264514ad4fffac80b2c1dcc7519ab50de56
+EBUILD tp_smapi-0.40-r2.ebuild 1606 RMD160 7e91a33ccfb5aa5514f9ff14fff81137711327c4 SHA1 832534cc1f30220bb2e8c35b8945657d5f9ebd98 SHA256 bb1c22c246ccb5bdc34be5a67255b0c2755353e2edffa66f14247b1ffd0b46cf
EBUILD tp_smapi-0.40.ebuild 1374 RMD160 352e516ffa2e6e9bb3fa1e296e61d959e1c665e6 SHA1 61842583c863f84e19f540b100e6c0ad254054e5 SHA256 646d34df5aed0b49a4566c074f6ef41edfafca0b5c52a8d69928c96dee8b9652
-MISC ChangeLog 4793 RMD160 6dd3e2c030353a0825bddf8a05df82b8694a8287 SHA1 be3cc29fb45bbccc310200b87d5eaeca665b201f SHA256 e0f40126b37889170c857e209219814804c37e00660614ae888c8582ff852272
+MISC ChangeLog 5024 RMD160 063bd757e1815dfed2b21f018dc9741d187f8f66 SHA1 d31bed992cb9c129b4920122298694e70090c91a SHA256 bce3d7c4fc4d10b3b16fcf0b94906c67c2c5416e5e88e9363beb954e660f89a8
MISC metadata.xml 242 RMD160 ae266e9b31780c5bf3de48ff64cb377c484be043 SHA1 1e42ee4142d75d4d5a98ebe944b225178ec57680 SHA256 c4b5ad1432ce813ea0f307e9ff1c1bad05cc4aed39c0344be243259400a45372
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.17 (GNU/Linux)
-
-iF4EAREIAAYFAk3WTCoACgkQodBTJSDyo64hGQD/ZNjdeNFBEefxVpMZKuT5eKuq
-ZNGjQs47+T+G0Wu/BCoA/iGHRxQe9pyGLbQnQMniGohhysToDDTicvbS9ad6/7gn
-=ql0q
------END PGP SIGNATURE-----
diff --git a/app-laptop/tp_smapi/files/tp_smapi-0.40-confd b/app-laptop/tp_smapi/files/tp_smapi-0.40-confd
new file mode 100644
index 000000000000..7c80f35e390b
--- /dev/null
+++ b/app-laptop/tp_smapi/files/tp_smapi-0.40-confd
@@ -0,0 +1,20 @@
+# /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
new file mode 100755
index 000000000000..417e7021bec9
--- /dev/null
+++ b/app-laptop/tp_smapi/files/tp_smapi-0.40-initd
@@ -0,0 +1,78 @@
+#!/sbin/runscript
+# 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
+
+opts="low high info"
+
+SMAPI_SYSFS="/sys/devices/platform/smapi"
+BATS="BAT0 BAT1"
+
+depend() {
+ after modules
+}
+
+start() {
+ ebegin "Making sure that module 'tp_smapi' is loaded"
+ modprobe tp_smapi
+ eend $? || return $?
+
+ ebegin "Checking for ${SMAPI_SYSFS}"
+ test -d ${SMAPI_SYSFS}
+ eend $? || return $?
+
+ ebegin "Starting ${SVCNAME}"
+ set_all ${SMAPI_THRESH_START} ${SMAPI_THRESH_STOP}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ eend $?
+}
+
+require_started() {
+ service_started && return 0
+
+ ewarn "WARNING: ${SVCNAME} is not running"
+ return 1
+}
+
+high() {
+ require_started || return $?
+
+ ebegin "Switching ${SVCNAME} to high thesholds"
+ set_all ${SMAPI_HIGH_THRESH_START} ${SMAPI_HIGH_THRESH_STOP}
+ eend $?
+}
+
+low() {
+ require_started || return $?
+
+ ebegin "Switching ${SVCNAME} to low thesholds"
+ set_all ${SMAPI_LOW_THRESH_START} ${SMAPI_LOW_THRESH_STOP}
+ eend $?
+}
+
+set_all() {
+ local tstart=$1
+ local tstop=$2
+ 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() {
+ require_started || return $?
+
+ for bat in ${BATS}; do
+ local tstart=$( cat ${SMAPI_SYSFS}/${bat}/start_charge_thresh)
+ local tstop=$( cat ${SMAPI_SYSFS}/${bat}/stop_charge_thresh)
+ local presence=$( [[ $(cat ${SMAPI_SYSFS}/${bat}/installed) = 1 ]] && echo ' [installed]')
+ einfo "${bat}: ${tstart} ${tstop}${presence}"
+ done
+}
diff --git a/app-laptop/tp_smapi/tp_smapi-0.40-r2.ebuild b/app-laptop/tp_smapi/tp_smapi-0.40-r2.ebuild
new file mode 100644
index 000000000000..6466899e99a2
--- /dev/null
+++ b/app-laptop/tp_smapi/tp_smapi-0.40-r2.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/tp_smapi/tp_smapi-0.40-r2.ebuild,v 1.1 2011/06/14 15:31:20 sping Exp $
+
+EAPI="3"
+
+inherit eutils linux-mod
+
+DESCRIPTION="IBM ThinkPad SMAPI BIOS driver"
+HOMEPAGE="http://tpctl.sourceforge.net/"
+SRC_URI="mirror://sourceforge/tpctl/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="hdaps"
+
+RESTRICT="userpriv"
+
+# We need dmideode if the kernel does not support DMI_DEV_TYPE_OEM_STRING
+# in dmi.h
+DEPEND="sys-apps/dmidecode"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ if kernel_is lt 2 6 19; then
+ eerror
+ eerror "${P} requires Linux kernel 2.6.19 or above."
+ eerror
+ die "Unsupported kernel version"
+ fi
+
+ MODULE_NAMES="thinkpad_ec(extra:) tp_smapi(extra:)"
+ BUILD_PARAMS="KSRC=${KV_DIR} KBUILD=${KV_OUT_DIR}"
+ BUILD_TARGETS="default"
+
+ if use hdaps; then
+
+ CONFIG_CHECK="~INPUT_UINPUT"
+ WARNING_INPUT_UINPUT="Your kernel needs uinput for the hdaps module to perform better"
+ linux-info_pkg_setup
+
+ MODULE_NAMES="${MODULE_NAMES} hdaps(extra:)"
+ BUILD_PARAMS="${BUILD_PARAMS} HDAPS=1"
+
+ CONFIG_CHECK="!SENSORS_HDAPS"
+ ERROR_SENSORS_HDAPS="${P} with USE=hdaps conflicts with in-kernel HDAPS (CONFIG_SENSORS_HDAPS)"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-2.6.37.patch"
+ epatch "${FILESDIR}"/fix_header_check.patch
+}
+
+src_install() {
+ linux-mod_src_install
+ dodoc CHANGES README || die
+ newinitd "${FILESDIR}"/${P}-initd smapi || die
+ newconfd "${FILESDIR}"/${P}-confd smapi || die
+}