commit: 407f9a1036054c174827db8121e5ed0451706683 Author: Gerion Entrup <gerion.entrup <AT> flump <DOT> de> AuthorDate: Mon Oct 15 12:08:05 2018 +0000 Commit: gerion <gerion.entrup <AT> flump <DOT> de> CommitDate: Mon Oct 15 12:08:05 2018 +0000 URL: https://gitweb.gentoo.org/repo/user/gerislay.git/commit/?id=407f9a10
add sys-power/lenovo-throttling-fix Should work for openrc and systemd. Systemd is untested. sys-power/lenovo-throttling-fix/Manifest | 3 ++ .../lenovo-throttling-fix/files/fix-systemd.patch | 13 ++++++ .../files/lenovo-throttling-fix | 9 +++++ .../lenovo-throttling-fix-9999.ebuild | 46 ++++++++++++++++++++++ 4 files changed, 71 insertions(+) diff --git a/sys-power/lenovo-throttling-fix/Manifest b/sys-power/lenovo-throttling-fix/Manifest new file mode 100644 index 0000000..5f988bc --- /dev/null +++ b/sys-power/lenovo-throttling-fix/Manifest @@ -0,0 +1,3 @@ +AUX fix-systemd.patch 403 BLAKE2B e1d0e1a36a4f7f1027cdfdf0a1d68a442380a6ed9b509f5bd0199caea6faafde0ca83f67228c7191742a39f88ecb4433097eb57468aaff011914703938374398 SHA512 19952d6db350da0bcdca3c832a61f64217dfdaec4192644fa27384ac5e0ec89ef7b9611ca2312e5e1cd889b8be812aa885603ae6ecabe6e86973d29df86799f4 +AUX lenovo-throttling-fix 321 BLAKE2B 3c84c817b6ec15f3b55a9f6e80ba5f4d64bbd5ce4a377d79d7df76da867d94a0fa608fabd929901525cfa49d3d4cb7431e695041ea7549e0c77839079aaee87c SHA512 16a88c7acda83151212fa15c37ea26ef68b084cca6cc4cb734de145e155f69581738716a19eb43dd5ce50e94b92e1bfee0eac743774714825d2dd86fe88af723 +EBUILD lenovo-throttling-fix-9999.ebuild 857 BLAKE2B 852eeda08fbdb58e1d7ea2ae75fea1c46902f72943a49d51c0f1d24c6f2f665e284d7234f1fed537d6a1aaa3d32efdac5f871b6c22cd852fb820462b91df9026 SHA512 6d73b4c78ae768b27498e7c5d59eb07de950ef1ab8375c188a228f60066d9c449e2dc82bf50fba60a2ee86c420c3456d7e3823e4924a38c609faf8a79b098e47 diff --git a/sys-power/lenovo-throttling-fix/files/fix-systemd.patch b/sys-power/lenovo-throttling-fix/files/fix-systemd.patch new file mode 100644 index 0000000..40e162c --- /dev/null +++ b/sys-power/lenovo-throttling-fix/files/fix-systemd.patch @@ -0,0 +1,13 @@ +diff --git a/systemd/lenovo_fix.service b/systemd/lenovo_fix.service +index d88205c..34bd01a 100644 +--- a/systemd/lenovo_fix.service ++++ b/systemd/lenovo_fix.service +@@ -3,7 +3,7 @@ Description=Stop Intel throttling + + [Service] + Type=simple +-ExecStart=/opt/lenovo_fix/venv/bin/python3 /opt/lenovo_fix/lenovo_fix.py ++ExecStart=/opt/lenovo_fix/lenovo_fix.py + StandardOutput=syslog + StandardError=syslog + diff --git a/sys-power/lenovo-throttling-fix/files/lenovo-throttling-fix b/sys-power/lenovo-throttling-fix/files/lenovo-throttling-fix new file mode 100755 index 0000000..4ca0247 --- /dev/null +++ b/sys-power/lenovo-throttling-fix/files/lenovo-throttling-fix @@ -0,0 +1,9 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +name="lenovo-throttling-fix daemon" +description="Workaround for Intel throttling issues in Linux." +pidfile="/run/${RC_SVCNAME}.pid" +command=/opt/lenovo_fix/lenovo_fix.py +command_background=true diff --git a/sys-power/lenovo-throttling-fix/lenovo-throttling-fix-9999.ebuild b/sys-power/lenovo-throttling-fix/lenovo-throttling-fix-9999.ebuild new file mode 100644 index 0000000..01d24ca --- /dev/null +++ b/sys-power/lenovo-throttling-fix/lenovo-throttling-fix-9999.ebuild @@ -0,0 +1,46 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +PYTHON_COMPAT=( python3_{4,5,6,7} ) + +inherit git-r3 distutils-r1 systemd + +DESCRIPTION="Workaround for Intel throttling issues in Linux." +HOMEPAGE="https://github.com/erpalma/lenovo-throttling-fix.git" +EGIT_REPO_URI="https://github.com/erpalma/lenovo-throttling-fix.git" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="" +IUSE="" + +DEPEND=">=dev-python/dbus-python-1.2.8 + dev-python/pygobject:3" +RDEPEND="${DEPEND}" +BDEPEND="" + +PATCHES="${FILESDIR}/fix-systemd.patch" + +src_configure() { + return +} + +src_compile() { + return +} + +src_install() +{ + doinitd ${FILESDIR}/lenovo-throttling-fix + systemd_dounit systemd/lenovo_fix.service + + exeinto /opt/lenovo_fix + doexe lenovo_fix.py + + insinto /opt/lenovo_fix + doins mmio.py + + insinto /etc + doins etc/lenovo_fix.conf +}