From 56bd759df1d0c750a065b8c845e93d5dfa6b549d Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Sat, 8 Aug 2015 13:49:04 -0700 Subject: proj/gentoo: Initial commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson X-Thanks: Alec Warner - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring - wrote much python to improve cvs2svn X-Thanks: Rich Freeman - validation scripts X-Thanks: Patrick Lauer - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed --- app-laptop/tp_smapi/Manifest | 1 + app-laptop/tp_smapi/files/tp_smapi-0.40-confd | 20 ++++++ app-laptop/tp_smapi/files/tp_smapi-0.40-initd | 92 +++++++++++++++++++++++++++ app-laptop/tp_smapi/metadata.xml | 13 ++++ app-laptop/tp_smapi/tp_smapi-0.41.ebuild | 64 +++++++++++++++++++ 5 files changed, 190 insertions(+) create mode 100644 app-laptop/tp_smapi/Manifest create mode 100644 app-laptop/tp_smapi/files/tp_smapi-0.40-confd create mode 100755 app-laptop/tp_smapi/files/tp_smapi-0.40-initd create mode 100644 app-laptop/tp_smapi/metadata.xml create mode 100644 app-laptop/tp_smapi/tp_smapi-0.41.ebuild (limited to 'app-laptop/tp_smapi') diff --git a/app-laptop/tp_smapi/Manifest b/app-laptop/tp_smapi/Manifest new file mode 100644 index 000000000000..425ca7eb52d3 --- /dev/null +++ b/app-laptop/tp_smapi/Manifest @@ -0,0 +1 @@ +DIST tp_smapi-0.41.tar.gz 38852 SHA256 6aef02b92d10360ac9be0db29ae390636be55017990063a092a285c70b54e666 SHA512 924a11cdf64bc151d069d4f61ca476cf006773291f363b21a80ce091f560a78c4828d2e522e646a5b133c58149a37cb5c2432a165e92e6980eb510b9488c728e WHIRLPOOL 10c74811148934a49b2d2b65cd65d366c58de03682c02d6b82694b4831634a25f2da9986b0493e28b372abf7ada692ee8ea85b2881b823b0cb7b35b73f348d6e 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..e0b3bd5e0d8e --- /dev/null +++ b/app-laptop/tp_smapi/files/tp_smapi-0.40-initd @@ -0,0 +1,92 @@ +#!/sbin/runscript +# Copyright (C) 2011 Henning Schild +# Copyright (C) 2011 Sebastian Pipping +# +# 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 +} diff --git a/app-laptop/tp_smapi/metadata.xml b/app-laptop/tp_smapi/metadata.xml new file mode 100644 index 000000000000..ec6d801992d5 --- /dev/null +++ b/app-laptop/tp_smapi/metadata.xml @@ -0,0 +1,13 @@ + + + + + maintainer-needed@gentoo.org + + + Install a compatible HDAPS module + + + evgeni/tp_smapi + + diff --git a/app-laptop/tp_smapi/tp_smapi-0.41.ebuild b/app-laptop/tp_smapi/tp_smapi-0.41.ebuild new file mode 100644 index 000000000000..10c12688beed --- /dev/null +++ b/app-laptop/tp_smapi/tp_smapi-0.41.ebuild @@ -0,0 +1,64 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=4 + +inherit linux-mod + +DESCRIPTION="IBM ThinkPad SMAPI BIOS driver" +HOMEPAGE="https://github.com/evgeni/tp_smapi/ http://tpctl.sourceforge.net/" +SRC_URI="mirror://github/evgeni/${PN}/${P}.tar.gz" + +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_pretend() { + 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 +} + +pkg_setup() { + # run again as pkg_pretend is not var safe + pkg_pretend +} + +src_install() { + linux-mod_src_install + dodoc CHANGES README + newinitd "${FILESDIR}"/${PN}-0.40-initd smapi + newconfd "${FILESDIR}"/${PN}-0.40-confd smapi +} -- cgit v1.2.3-65-gdbad