aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan P. Stanić <mps@arvanta.net>2021-01-04 23:06:36 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2021-01-05 10:16:49 +0000
commitb11c32d644131f223cb6f8a7e2d8a5b1712707ba (patch)
tree95f8a7161c766d5572323dbf77196e688c996bd1
parent98aaab01b05f6b9fe2dc32293bcb858f0320fde1 (diff)
downloadaports-b11c32d644131f223cb6f8a7e2d8a5b1712707ba.tar.gz
aports-b11c32d644131f223cb6f8a7e2d8a5b1712707ba.tar.bz2
aports-b11c32d644131f223cb6f8a7e2d8a5b1712707ba.tar.xz
community/linux-tools: upgrade to 5.10.4
add cpupower-openrc by copying cpupower.initd and cpupower.confd from separate community/cpupower aports fixe: #12272
-rw-r--r--community/linux-tools/APKBUILD17
-rw-r--r--community/linux-tools/cpupower.confd36
-rw-r--r--community/linux-tools/cpupower.initd42
3 files changed, 91 insertions, 4 deletions
diff --git a/community/linux-tools/APKBUILD b/community/linux-tools/APKBUILD
index ce49f30fef..5879e98c1b 100644
--- a/community/linux-tools/APKBUILD
+++ b/community/linux-tools/APKBUILD
@@ -2,7 +2,7 @@
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=linux-tools
-pkgver=5.10.1
+pkgver=5.10.4
_kernver=${pkgver%.*}
pkgrel=0
pkgdesc="Linux kernel tools meta package"
@@ -13,11 +13,13 @@ depends="perf cpupower $pkgname-gpio $pkgname-iio"
depends_dev="pciutils-dev readline-dev gettext-dev"
makedepends="$depends_dev elfutils-dev bash linux-headers flex bison diffutils
zlib-dev findutils python3"
-subpackages="perf perf-bash-completion:bashcomp:noarch cpupower
+subpackages="perf perf-bash-completion:bashcomp:noarch cpupower cpupower-openrc
$pkgname-gpio $pkgname-iio $pkgname-doc $pkgname-dev"
source="https://kernel.org/pub/linux/kernel/v5.x/linux-$_kernver.tar.xz
https://kernel.org/pub/linux/kernel/v5.x/patch-$pkgver.xz
cpupower-libs.patch
+ cpupower.initd
+ cpupower.confd
"
builddir="$srcdir"/linux-$_kernver
@@ -62,6 +64,11 @@ cpupower() {
mv "$pkgdir"/usr/sbin/cpu* "$subpkgdir"/usr/sbin/
mv "$pkgdir"/usr/lib/libcpu*.so.* "$subpkgdir"/usr/lib/
mv "$pkgdir"/etc/cpu* "$subpkgdir"/etc/
+ install -Dm755 "$srcdir"/$subpkgname.initd \
+ "$pkgdir"/etc/init.d/$subpkgname
+ install -Dm644 "$srcdir"/$subpkgname.confd \
+ "$pkgdir"/etc/conf.d/$subpkgname
+
}
perf() {
@@ -99,5 +106,7 @@ bashcomp() {
}
sha512sums="95bc137d0cf9148da6a9d1f1a878698dc27b40f68e22c597544010a6c591ce1b256f083489d3ff45ff77753289b535135590194d88ef9f007d0ddab3d74de70e linux-5.10.tar.xz
-4fa17c2525cf67f71bcdd232cd98f1a00cf9596987e73909ef9638b9e74886c4d752375ba1b9b8020f544b2d6fac23630fc090111a4e79b880dbb81629bd1503 patch-5.10.1.xz
-a46e3a84b00a39a356618831d0ddfb7f0d10f0a3799d1307ba2cc832e73c01f8d637a4e801a6dd25025f6f13155c6ad8b836422ff72d365e51063ac0bf907f52 cpupower-libs.patch"
+893733c9b9290f7a91bfb31ca9baa762a6460665b59efad6ee194b67807ae3990cf44464a32ea4a7e9620b58d7810ff15a30a7d92f0bf1b14cff3b5730fce49c patch-5.10.4.xz
+a46e3a84b00a39a356618831d0ddfb7f0d10f0a3799d1307ba2cc832e73c01f8d637a4e801a6dd25025f6f13155c6ad8b836422ff72d365e51063ac0bf907f52 cpupower-libs.patch
+97ecfeaaaa8efca7af585316b843bf7be885e88095bbdfbf52bc9a96b14dc862435482781e205ea022ab208978aaa4aabb317354fab890ed514a5088ae5045c8 cpupower.initd
+63cd12a4d8782198c71662e9205e346e064b65bae5e3e175b5bc43bdf7ec6ddf675b60349750afe3c37c8a925f9ae9a93530671821342581bd282a69e0773b8c cpupower.confd"
diff --git a/community/linux-tools/cpupower.confd b/community/linux-tools/cpupower.confd
new file mode 100644
index 0000000000..1e67ed04e2
--- /dev/null
+++ b/community/linux-tools/cpupower.confd
@@ -0,0 +1,36 @@
+# /etc/conf.d/cpupower: config file for /etc/init.d/cpupower
+
+# Options when starting cpufreq (given to the `cpupower` program)
+# Possible options are:
+# -g --governor <GOV> (ie: ondemand, performance, or powersave)
+# -d --min <FREQ> (ie: 1000MHz)
+# -u --max <FREQ> (ie: 2000MHz)
+# -f --freq <FREQ> (requires userspace governor, this *can not* be combined with
+# with any other parameters).
+# Frequencies can be passed in Hz, kHz (default), MHz, GHz, or THz by postfixing the
+# value with the wanted unit name, without any space.
+# (frequency in kHz =^ Hz * 0.001 =^ MHz * 1000 =^ GHz * 1000000).
+
+START_OPTS="--governor ondemand"
+
+# Options when stopping cpufreq (given to the `cpupower` program)
+# This option can be used to change governer on stop. Leaving it empty will ensure
+# the governer remains on the one provided above.
+STOP_OPTS=""
+
+# Extra settings to write to sysfs cpufreq values.
+#
+# up_threshold: threshold for stepping up frequency, where the value represents
+# the percentage of cpu load.
+#
+# down_threshold: threshold for stepping down frequency, where the value
+# represents the percentage of cpu load.
+#
+# sampling_down_factor: determines how frequently the governor polls the cpu, a
+# value greater than 1 improves performance by reducing the polling when the
+# load is high. This tunable has no effect on behavior at lower CPU frequencies.
+#
+# ignore_nice_load: when set to '1' the processes that are run with a 'nice'
+# value will not count in the usage calculation.
+
+#SYSFS_EXTRA="ondemand/ignore_nice_load=1 ondemand/up_threshold=75 ondemand/sampling_down_factor=10"
diff --git a/community/linux-tools/cpupower.initd b/community/linux-tools/cpupower.initd
new file mode 100644
index 0000000000..7e4584f5a7
--- /dev/null
+++ b/community/linux-tools/cpupower.initd
@@ -0,0 +1,42 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+CPUFREQ_SYSFS=/sys/devices/system/cpu/cpufreq
+
+change() {
+ local c ret=0 opts="$1"
+ if [ -n "$opts" ] ; then
+ ebegin "Running cpupower -c all frequency-set ${opts}"
+ cpupower -c all frequency-set ${opts} >/dev/null 2>&1
+ : $(( ret += $? ))
+ eend ${ret}
+
+ if [ -d ${CPUFREQ_SYSFS} ] && [ -n "${SYSFS_EXTRA}" ] ; then
+ c=1
+ einfo "Setting extra options: ${SYSFS_EXTRA}"
+ if cd ${CPUFREQ_SYSFS} ; then
+ local o v
+ for o in ${SYSFS_EXTRA} ; do
+ v=${o#*=}
+ o=${o%%=*}
+ echo ${v} > ${o} || break
+ done
+ c=0
+ fi
+ eend ${c}
+ : $(( ret += c ))
+ fi
+ fi
+
+ return ${ret}
+}
+
+start() {
+ change "${START_OPTS}"
+}
+
+stop() {
+ change "${STOP_OPTS}"
+}