From 8c3bdbb8fccf3b3a93a58fffe9f5657f47a1f5ec Mon Sep 17 00:00:00 2001 From: Georgy Yakovlev Date: Thu, 23 May 2019 13:32:50 -0700 Subject: 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 --- sys-power/intel-undervolt/Manifest | 1 + sys-power/intel-undervolt/files/confd | 1 + sys-power/intel-undervolt/files/initd | 23 ++++++++ .../intel-undervolt/intel-undervolt-1.6.ebuild | 62 ++++++++++++++++++++++ sys-power/intel-undervolt/metadata.xml | 14 +++++ 5 files changed, 101 insertions(+) create mode 100644 sys-power/intel-undervolt/Manifest create mode 100644 sys-power/intel-undervolt/files/confd create mode 100644 sys-power/intel-undervolt/files/initd create mode 100644 sys-power/intel-undervolt/intel-undervolt-1.6.ebuild create mode 100644 sys-power/intel-undervolt/metadata.xml (limited to 'sys-power') 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 @@ + + + + + gyakovlev@gentoo.org + Georgy Yakovlev + + + Tool for undervolting and throttling limits alteration for Intel CPUs + + + kitsunyan/intel-undervolt + + -- cgit v1.2.3-65-gdbad