diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /app-laptop/tp_smapi |
reinit the tree, so we can have metadata
Diffstat (limited to 'app-laptop/tp_smapi')
-rw-r--r-- | app-laptop/tp_smapi/Manifest | 7 | ||||
-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 | ||||
-rw-r--r-- | app-laptop/tp_smapi/metadata.xml | 19 | ||||
-rw-r--r-- | app-laptop/tp_smapi/tp_smapi-0.42-r1.ebuild | 74 |
5 files changed, 212 insertions, 0 deletions
diff --git a/app-laptop/tp_smapi/Manifest b/app-laptop/tp_smapi/Manifest new file mode 100644 index 000000000000..dbeeaa6120dd --- /dev/null +++ b/app-laptop/tp_smapi/Manifest @@ -0,0 +1,7 @@ +AUX tp_smapi-0.40-confd 785 SHA256 3996b08957adea6f14e5a0e394212026dc73e6802a8dcd5aa9a3b413530c3fdb SHA512 a08f0b15ea37f79e1a8b41b3a3a59421dcf26e482d2eaa269e7c3f728c142e68e8c130c8a53f4c14829436a20e1354318464de780d9fbe10777d7929d7944dca WHIRLPOOL 817e851732b828c7e208eabb1371695c787934fa57f1b30ddf9660a4d8b368575eb17775551a9f63144d20d68b23626e96eeab98c9de0b73105d33dbd351f593 +AUX tp_smapi-0.40-initd 1851 SHA256 3feb039b6aa7d4c8589e3d31919c0e465b1ae897cd0d43a7e6eabb89c1ac5dc3 SHA512 ebf8ac628e00979f21e266fb6d187f02bfeeafc9482a0c5bed4fd4f092c7a27158747ccf629c802969ad2a8f13124276ef889927b3f1f01a7ce44fdcde103698 WHIRLPOOL 4be17b42f053af68e95c4fe938f9bee29ab82f980e747e6b6d78deb56296f1a58462f66a6011806b78afca508946dcecacd9d9c37ce7b02e465ea9ad9bd3aec7 +DIST tp_smapi-0.42.tgz 39867 SHA256 7b8d9f488c3859805f1f292bf4d518cc5b32ebb69b0ebe96367d0852dd792d27 SHA512 1004b7ef961a9908c2144b26ea60b6dddabd83d60c11421a03e3b810f5b635415ef52656d6980915512d68f809f7bc3d662328f25d111537bd7e175d252cf83b WHIRLPOOL 7d03aaf2bb4de3aabbc38fba62f126e6f2976ea1964d85da2fffbbcd63bb4c3884a152851cae116438b859c13d59fd4e41be126683f660f9b8322d7fc40ddc28 +EBUILD tp_smapi-0.42-r1.ebuild 1947 SHA256 59ba0f223b524e495531920c14f25f59d810d9f7e0fd7955ed5f3730bbf2f273 SHA512 d09fe01652350951baaaf67af7ce32036515a1535cb9f774d2e0e2f92b0f79163babc3c19c554a37a15b5ddde3bf5a4904e95dfaa74274783911d2c5335fbbef WHIRLPOOL 7f5c20b43ddde11e4c21f23efa668cfd8ae33748baec8e994e6cca5704b99a251bd3ed82e2335db233f1114428ebf884705fbe92c33500bc8c7e0d437acb53a5 +MISC ChangeLog 5140 SHA256 de26e7c672edc9ff7a963b4c725b4be6922212a6f86d4b14fcea3afc960567e5 SHA512 a303fac2b38fe12a22d20d0e5fbeaee8f60b701935a50c649ed7c9ca4a15d277c31f1ed0ebe9d37a040d1baf18ad55960297a4c422fa075c6e85d206bcb03ab9 WHIRLPOOL dad90eb58e2cff369d49867dd3f1a51564a5457960ece752730ec60bf5abaa5faf61dc10f3ee9e56e8dd97b38b05d611530d4ce5be5fbd4a7f781a36d8edd492 +MISC ChangeLog-2015 6791 SHA256 20bf113d3b2f121be58c4b075e8b2316587e2e812c7885c005fcc696de264250 SHA512 38956dab021c8ba903bd11ac9cb4a2edf94363f296b60e134b06cdf4a1edccc9c09d20a23dcde948be5b128bb0f8cebf9f34b5ea6eaa0c587f40d40cea947aa4 WHIRLPOOL ff26b6d6a2deb69cc378ff16fcc8b32592de6ba6589c927b3ffe7a46e48bf97e40f7b5eff0ece35838dac3da6e9617be63b57fae905b4f6156d975383d146b54 +MISC metadata.xml 473 SHA256 4ad788e24f6504854e58ba6efa562fd2235fee205213ddd57424e357e649d73d SHA512 21ce54c4cd204ddea9f1170f8e1b66e636bb2b541856ff541371bd572403519a09cf2367f5642a596684d66145bc9ab92396b102ef51086f2d22f96fc6c0b7af WHIRLPOOL 854979d7994ec70cdb0fe7aa186ba57201f3d0a9e9648f432d67c42515d900cebfe8f970e48bdad74a0f64c308f61e59cdbfae0c8d3ec56fb62c4a6b1de00446 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 100644 index 000000000000..3b8c10d9274a --- /dev/null +++ b/app-laptop/tp_smapi/files/tp_smapi-0.40-initd @@ -0,0 +1,92 @@ +#!/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 +} diff --git a/app-laptop/tp_smapi/metadata.xml b/app-laptop/tp_smapi/metadata.xml new file mode 100644 index 000000000000..2f944f633c24 --- /dev/null +++ b/app-laptop/tp_smapi/metadata.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + + <maintainer type="person"> + <email>mjo@gentoo.org</email> + <name>Michael Orlitzky</name> + </maintainer> + + <use> + <flag name="hdaps">Install a compatible HDAPS module</flag> + </use> + + <upstream> + <remote-id type="github">evgeni/tp_smapi</remote-id> + <remote-id type="sourceforge">tpctl</remote-id> + </upstream> + +</pkgmetadata> diff --git a/app-laptop/tp_smapi/tp_smapi-0.42-r1.ebuild b/app-laptop/tp_smapi/tp_smapi-0.42-r1.ebuild new file mode 100644 index 000000000000..a7aa31518d52 --- /dev/null +++ b/app-laptop/tp_smapi/tp_smapi-0.42-r1.ebuild @@ -0,0 +1,74 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit flag-o-matic linux-mod + +DESCRIPTION="IBM ThinkPad SMAPI BIOS driver" +HOMEPAGE="https://github.com/evgeni/${PN}" +SRC_URI="${HOMEPAGE}/releases/download/tp-smapi/${PV}/${P}.tgz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 x86" + +IUSE="hdaps" + +# We need dmideode if the kernel does not support +# DMI_DEV_TYPE_OEM_STRING in dmi.h. +DEPEND="sys-apps/dmidecode" +RDEPEND="${DEPEND}" + +# This code is factored out of both pkg_pretend() and pkg_setup() +# because the PMS states that ebuilds may not call phase functions +# directly (see the "List of functions" section). This was bug #596616 +# and #596622. +tp_smapi_pkg_pretend() { + linux-mod_pkg_setup + + 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" + # Why call this twice? + 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_pretend() { + tp_smapi_pkg_pretend +} + +pkg_setup() { + # run again as pkg_pretend is not var safe + tp_smapi_pkg_pretend +} + +src_compile() { + # Kernel Makefiles may pull in -mpreferred-stack-boundary=3 + # which requires that SSE disabled or compilation will fail. + # So we need to ensure that appended user CLAGS do not re-enable SSE + # https://bugs.gentoo.org/show_bug.cgi?id=492964 + replace-flags '-msse*' '' + replace-flags '-mssse3' '' + + linux-mod_src_compile +} + +src_install() { + linux-mod_src_install + einstalldocs + newinitd "${FILESDIR}/${PN}-0.40-initd" smapi + newconfd "${FILESDIR}/${PN}-0.40-confd" smapi +} |