aboutsummaryrefslogtreecommitdiffstats
path: root/gentoo
diff options
context:
space:
mode:
Diffstat (limited to 'gentoo')
-rw-r--r--gentoo/Manifest4
-rw-r--r--gentoo/cputemp2maxfreq-0.2.ebuild39
-rw-r--r--gentoo/files/cputemp2maxfreq.conf8
-rwxr-xr-xgentoo/files/cputemp2maxfreq.init17
4 files changed, 68 insertions, 0 deletions
diff --git a/gentoo/Manifest b/gentoo/Manifest
new file mode 100644
index 0000000..5391c35
--- /dev/null
+++ b/gentoo/Manifest
@@ -0,0 +1,4 @@
+AUX cputemp2maxfreq.conf 257 BLAKE2B 755cbb51b68ae772cf413a9be1b928a350ef962b07dcfd4fd06c938238c35ae6bf8f8e0010103a6383bd1bb1ba23d2c06efcf3dc7490f4fa045f3943b1fc3837 SHA512 ada678f8ab5e6aabeb246cb49c2ab1da26cee2204b353aff4db537621176d57367474864d491da846c83973769affd135fafc45f5fc11df49e418ace6268b5ab
+AUX cputemp2maxfreq.init 488 BLAKE2B 1182dca7ab323c31757a8b67fb672fbce62369a50b4d20ea93abe8c138c58b517ba44af59f33831b1ae55d34f2b5939970002522b37ba7f37e8f665c04340fa6 SHA512 36714ee8faaa479729b2d9902e6a1310c7a47686e70f351c97ae68eb0557246801d0715f2cb885f70ebd8888b7639eaa8c0e14f889430b419a158b59c7176de1
+DIST cputemp2maxfreq-0.2.tar.gz 8860 BLAKE2B df852d62988b7c6a46e227eb8e0ec5c885b62f49d4edd39d7cb7bae09935ba672a254c7178d0b70c0ea91cf5163c9f248214c2e1edd4c77e2ed7894d2a81a021 SHA512 a895197c247e45b85bfa7ae635995dcb46a1e4b0bae0c5fda3a96500c571eb7e1cf75c265b9c863e733bd3e31a424427d5069e49e136865e1835177710122234
+EBUILD cputemp2maxfreq-0.2.ebuild 894 BLAKE2B 1c52b9b0cb4ec46d10fb031d36d1892abfe369024c64bc3ed85e3b85aac0d7e646b0b8aa2a2d20c587075ba6c87a27ac7f65ba5f1763cfd56e6dd2d84926e776 SHA512 924a0c86fcd12658cf8ff6f8fe97c9ff7920207fa3e632d124dc1251c87707e12e9deff48223e5b76ccef78d9b6e4ce58b94d7a1b2dcd13fcbbfcde9a82b0262
diff --git a/gentoo/cputemp2maxfreq-0.2.ebuild b/gentoo/cputemp2maxfreq-0.2.ebuild
new file mode 100644
index 0000000..e4abea2
--- /dev/null
+++ b/gentoo/cputemp2maxfreq-0.2.ebuild
@@ -0,0 +1,39 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Daemon to scale scale_max_freq when CPU temperature rises"
+HOMEPAGE="https://code.pa4wdh.nl.eu.org/tools/cputemp2maxfreq"
+GIT_COMMIT="f851f21131a1aab2d9a9449e47876132c2d948c4"
+SRC_URI="https://code.pa4wdh.nl.eu.org/tools/cputemp2maxfreq/snapshot/cputemp2maxfreq-$GIT_COMMIT.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64"
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+BDEPEND=""
+
+src_unpack()
+{
+ unpack "${P}.tar.gz"
+ mv "cputemp2maxfreq-$GIT_COMMIT" "${P}"
+}
+
+src_prepare()
+{
+ eapply_user
+
+ ./generate_version_h.sh "${PV}" "${GIT_COMMIT:0:7}" "master" > version.h
+ mkdir .git
+ touch -d "1 minute ago" .git/index
+}
+
+src_install()
+{
+ dosbin ${PN}
+ newinitd "${FILESDIR}/cputemp2maxfreq.init" cputemp2maxfreq
+ newconfd "${FILESDIR}/cputemp2maxfreq.conf" cputemp2maxfreq
+}
diff --git a/gentoo/files/cputemp2maxfreq.conf b/gentoo/files/cputemp2maxfreq.conf
new file mode 100644
index 0000000..48088ec
--- /dev/null
+++ b/gentoo/files/cputemp2maxfreq.conf
@@ -0,0 +1,8 @@
+# Logging mechanism to use, options are: none, stdout, kmsg,syslog
+LOGGER="syslog"
+
+# Target CPU temperature, frequency will scale down above this temperature
+TEMPERATURE=70
+
+# Other arguments to pass to the daemon, see cputemp2maxfreq for options
+OTHER=""
diff --git a/gentoo/files/cputemp2maxfreq.init b/gentoo/files/cputemp2maxfreq.init
new file mode 100755
index 0000000..83a3798
--- /dev/null
+++ b/gentoo/files/cputemp2maxfreq.init
@@ -0,0 +1,17 @@
+#!/sbin/openrc-run
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+name="cputemp2maxfreq daemon"
+description="Daemon to scale scale_max_freq when CPU temperature rises"
+command=/usr/sbin/cputemp2maxfreq
+command_args="-l $LOGGER -t $TEMPERATURE $ARGS"
+
+start() {
+ ebegin "Starting $NAME"
+ start-stop-daemon --start --background \
+ --make-pidfile --pidfile /var/run/cputemp2maxfreq.pid \
+ --exec ${command} -- ${command_args}
+ eend $?
+}
+