summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgy Yakovlev <gyakovlev@gentoo.org>2019-05-23 13:32:50 -0700
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2019-05-23 13:33:02 -0700
commit8c3bdbb8fccf3b3a93a58fffe9f5657f47a1f5ec (patch)
treebafc817b15633ff49c174cad311c06620a54e292 /sys-power
parentnet-misc/ntpsec: fix minor error when USE=-doc (diff)
downloadgentoo-8c3bdbb8fccf3b3a93a58fffe9f5657f47a1f5ec.tar.gz
gentoo-8c3bdbb8fccf3b3a93a58fffe9f5657f47a1f5ec.tar.bz2
gentoo-8c3bdbb8fccf3b3a93a58fffe9f5657f47a1f5ec.zip
sys-power/intel-undervolt: new package
Intel CPU undervolting and throttling configuration tool Package-Manager: Portage-2.3.66, Repoman-2.3.12 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'sys-power')
-rw-r--r--sys-power/intel-undervolt/Manifest1
-rw-r--r--sys-power/intel-undervolt/files/confd1
-rw-r--r--sys-power/intel-undervolt/files/initd23
-rw-r--r--sys-power/intel-undervolt/intel-undervolt-1.6.ebuild62
-rw-r--r--sys-power/intel-undervolt/metadata.xml14
5 files changed, 101 insertions, 0 deletions
diff --git a/sys-power/intel-undervolt/Manifest b/sys-power/intel-undervolt/Manifest
new file mode 100644
index 000000000000..6b09153cf630
--- /dev/null
+++ b/sys-power/intel-undervolt/Manifest
@@ -0,0 +1 @@
+DIST intel-undervolt-1.6.tar.gz 22465 BLAKE2B 947f3e3f94316a9988fc0311faa23b07e8e0a99afb737232e6e581f45cca89124a49e47bbc85eb0e836b7fc7f966869910fe4d42581e47d98d8c036390c3dec2 SHA512 1c1de1083654085d6711aad28d2815f2aa05d08b7fddbee425b59ab8109dc1e635c2a9bdda8ba0221420e9e00fcd61013bd4a4633d05ede87808c49898772db3
diff --git a/sys-power/intel-undervolt/files/confd b/sys-power/intel-undervolt/files/confd
new file mode 100644
index 000000000000..0911f6a58995
--- /dev/null
+++ b/sys-power/intel-undervolt/files/confd
@@ -0,0 +1 @@
+# /etc/conf.d/intel-undervolt: config file for /etc/init.d/intel-undervolt
diff --git a/sys-power/intel-undervolt/files/initd b/sys-power/intel-undervolt/files/initd
new file mode 100644
index 000000000000..0a43656ea79f
--- /dev/null
+++ b/sys-power/intel-undervolt/files/initd
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ after thermald
+}
+
+command="/usr/bin/intel-undervolt"
+command_args="daemon"
+command_background="true"
+pidfile="/run/${RC_SVCNAME}.pid"
+required_files="/etc/intel-undervolt.conf"
+
+start_pre() {
+ if service_started thermald; then
+ eerror "thermald conflits with ${RC_SVCNAME}, exiting"
+ fi
+
+ ebegin "${RC_SVCNAME} -> apply initial voltage"
+ "${command}" apply
+ eend $?
+}
diff --git a/sys-power/intel-undervolt/intel-undervolt-1.6.ebuild b/sys-power/intel-undervolt/intel-undervolt-1.6.ebuild
new file mode 100644
index 000000000000..74c44d3fe535
--- /dev/null
+++ b/sys-power/intel-undervolt/intel-undervolt-1.6.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit linux-info systemd toolchain-funcs
+
+DESCRIPTION="Intel CPU undervolting and throttling configuration tool"
+HOMEPAGE="https://github.com/kitsunyan/intel-undervolt"
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/kitsunyan/${PN}.git"
+else
+ SRC_URI="https://github.com/kitsunyan/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="-* ~amd64"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+BDEPEND=""
+
+CONFIG_CHECK="~INTEL_RAPL ~X86_MSR"
+
+src_prepare() {
+ # respect CC, CFLAGS and avoid calling pkg-config
+ sed -i \
+ -e 's/^CC=/CC?=/' \
+ -e 's/^CFLAGS=/CFLAGS?=/' \
+ -e '/^UNITDIR=/d' \
+ Makefile || die
+
+ default
+}
+
+src_compile() {
+
+ tc-export CC
+
+ myemakeargs=(
+ BINDIR="${EPREFIX}"/usr/bin
+ SYSCONFDIR="${EPREFIX}"/etc
+ UNITDIR="$(systemd_get_systemunitdir)"
+ )
+ emake "${myemakeargs[@]}"
+}
+
+src_install() {
+ myemakeargs+=(
+ DESTDIR="${D}"
+ )
+ emake "${myemakeargs[@]}" install
+
+ newinitd "${FILESDIR}"/initd "${PN}"
+ newconfd "${FILESDIR}"/confd "${PN}"
+
+ einstalldocs
+}
diff --git a/sys-power/intel-undervolt/metadata.xml b/sys-power/intel-undervolt/metadata.xml
new file mode 100644
index 000000000000..52dabf8e7809
--- /dev/null
+++ b/sys-power/intel-undervolt/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>gyakovlev@gentoo.org</email>
+ <name>Georgy Yakovlev</name>
+ </maintainer>
+ <longdescription lang="en">
+ Tool for undervolting and throttling limits alteration for Intel CPUs
+ </longdescription>
+ <upstream>
+ <remote-id type="github">kitsunyan/intel-undervolt</remote-id>
+ </upstream>
+</pkgmetadata>