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 <vimproved@inventati.org>
Signed-off-by: Yixun Lan <dlan@gentoo.org>
This commit is contained in:
Violet Purcell
2023-10-08 14:23:08 -04:00
committed by Yixun Lan
parent 8dc620d689
commit 85ef6cd085
5 changed files with 79 additions and 0 deletions

View File

@@ -0,0 +1 @@
DIST throttled-0.10.0.gh.tar.gz 22191 BLAKE2B c301ee070ff462acd613c90525209eb5237c57e7171bf25133535f9c9a50d226b919065d8f6999f95b45f7f0d4c30e63abb5e04ec768d76b3c82dd19f092a693 SHA512 b89c467295bfc592d7b3ce0c4a41fedf436acf8067f8ef63d8596b92343ed8e04d371d065a9e35fdddba40772f12255c30960c2c46f0cbd5093bfc5e72fb4e18

View File

@@ -0,0 +1,5 @@
#!/sbin/openrc-run
command="/usr/bin/throttled"
pidfile="/run/throttled.pid"
description="Stop Intel throttling"
command_background="yes"

View File

@@ -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

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person" proxied="yes">
<email>vimproved@inventati.org</email>
<name>Violet Purcell</name>
</maintainer>
<maintainer type="person" proxied="proxy">
<email>dlan@gentoo.org</email>
<name>Yixun Lan</name>
</maintainer>
<maintainer type="project" proxied="proxy">
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
<upstream>
<remote-id type="github">erpalma/throttled</remote-id>
</upstream>
</pkgmetadata>

View File

@@ -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
}