From 85ef6cd085ca1f1fe78ae73cdebae3640ca78f53 Mon Sep 17 00:00:00 2001 From: Violet Purcell Date: Sun, 8 Oct 2023 14:23:08 -0400 Subject: [PATCH] sys-power/throttled: new package, add 0.10.0 add kernel config check, but only make it as a warning rename openrc script file to throttled.initd Closes: https://github.com/gentoo/gentoo/pull/33252/ Signed-off-by: Violet Purcell Signed-off-by: Yixun Lan --- sys-power/throttled/Manifest | 1 + sys-power/throttled/files/throttled.initd | 5 +++ sys-power/throttled/files/throttled.service | 11 ++++++ sys-power/throttled/metadata.xml | 19 +++++++++ sys-power/throttled/throttled-0.10.0.ebuild | 43 +++++++++++++++++++++ 5 files changed, 79 insertions(+) create mode 100644 sys-power/throttled/Manifest create mode 100644 sys-power/throttled/files/throttled.initd create mode 100644 sys-power/throttled/files/throttled.service create mode 100644 sys-power/throttled/metadata.xml create mode 100644 sys-power/throttled/throttled-0.10.0.ebuild diff --git a/sys-power/throttled/Manifest b/sys-power/throttled/Manifest new file mode 100644 index 0000000000000..67d1fc89509a5 --- /dev/null +++ b/sys-power/throttled/Manifest @@ -0,0 +1 @@ +DIST throttled-0.10.0.gh.tar.gz 22191 BLAKE2B c301ee070ff462acd613c90525209eb5237c57e7171bf25133535f9c9a50d226b919065d8f6999f95b45f7f0d4c30e63abb5e04ec768d76b3c82dd19f092a693 SHA512 b89c467295bfc592d7b3ce0c4a41fedf436acf8067f8ef63d8596b92343ed8e04d371d065a9e35fdddba40772f12255c30960c2c46f0cbd5093bfc5e72fb4e18 diff --git a/sys-power/throttled/files/throttled.initd b/sys-power/throttled/files/throttled.initd new file mode 100644 index 0000000000000..efe8b6a7e1513 --- /dev/null +++ b/sys-power/throttled/files/throttled.initd @@ -0,0 +1,5 @@ +#!/sbin/openrc-run +command="/usr/bin/throttled" +pidfile="/run/throttled.pid" +description="Stop Intel throttling" +command_background="yes" diff --git a/sys-power/throttled/files/throttled.service b/sys-power/throttled/files/throttled.service new file mode 100644 index 0000000000000..5b7decc435b0e --- /dev/null +++ b/sys-power/throttled/files/throttled.service @@ -0,0 +1,11 @@ +[Unit] +Description=Stop Intel throttling + +[Service] +Type=simple +ExecStart=/usr/bin/throttled +# Setting PYTHONUNBUFFERED is necessary to see the output of this service in the journal +Environment=PYTHONUNBUFFERED=1 + +[Install] +WantedBy=multi-user.target diff --git a/sys-power/throttled/metadata.xml b/sys-power/throttled/metadata.xml new file mode 100644 index 0000000000000..b7efde349add7 --- /dev/null +++ b/sys-power/throttled/metadata.xml @@ -0,0 +1,19 @@ + + + + + vimproved@inventati.org + Violet Purcell + + + dlan@gentoo.org + Yixun Lan + + + proxy-maint@gentoo.org + Proxy Maintainers + + + erpalma/throttled + + diff --git a/sys-power/throttled/throttled-0.10.0.ebuild b/sys-power/throttled/throttled-0.10.0.ebuild new file mode 100644 index 0000000000000..9b1a5e143ffa1 --- /dev/null +++ b/sys-power/throttled/throttled-0.10.0.ebuild @@ -0,0 +1,43 @@ +# Copyright 2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) +inherit linux-info python-single-r1 systemd + +DESCRIPTION="Daemon to work around throttling issues on some Intel laptops" +HOMEPAGE="https://github.com/erpalma/throttled" +SRC_URI="https://github.com/erpalma/throttled/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" +RESTRICT="test" + +CONFIG_CHECK="~X86_MSR ~DEVMEM" + +RDEPEND=" + ${PYTHON_DEPS} + $(python_gen_cond_dep ' + dev-python/dbus-python[${PYTHON_USEDEP}] + dev-python/pygobject[${PYTHON_USEDEP}] + ') + sys-apps/pciutils +" + +pkg_setup() { + linux-info_pkg_setup + python-single-r1_pkg_setup +} + +src_install() { + default + python_newscript throttled.py throttled + python_domodule mmio.py + newinitd "${FILESDIR}/throttled.initd" throttled + systemd_dounit "${FILESDIR}/throttled.service" + insinto /etc + doins etc/throttled.conf +}