diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rwxr-xr-x | kernels/linux-cpupower/BUILD | 3 | ||||
-rwxr-xr-x | kernels/linux-cpupower/CONFLICTS | 1 | ||||
-rwxr-xr-x | kernels/linux-cpupower/DEPENDS | 5 | ||||
-rwxr-xr-x | kernels/linux-cpupower/DETAILS | 35 | ||||
-rw-r--r-- | kernels/linux-cpupower/HISTORY | 4 | ||||
-rwxr-xr-x | kernels/linux-cpupower/INSTALL | 1 | ||||
-rwxr-xr-x | kernels/linux-cpupower/PRE_BUILD | 38 | ||||
-rwxr-xr-x | kernels/linux-cpupower/init.d/cpupowerd | 67 | ||||
-rw-r--r-- | kernels/linux-cpupower/init.d/cpupowerd.conf | 12 | ||||
-rw-r--r-- | mobile/cpufreqd/CONFLICTS | 1 | ||||
-rw-r--r-- | mobile/cpufreqd/HISTORY | 3 |
12 files changed, 174 insertions, 0 deletions
@@ -1,3 +1,7 @@ +2016-09-08 Eric Sandall <sandalle@sourcemage.org> + * kernels/linux-cpupower: Linux power management tool (may replace + cpufreqd). + 2016-09-05 Ismael Luceno <ismael@sourcemage.org> * devel/colm: new spell, Colm Programming Language diff --git a/kernels/linux-cpupower/BUILD b/kernels/linux-cpupower/BUILD new file mode 100755 index 0000000000..eeae46831b --- /dev/null +++ b/kernels/linux-cpupower/BUILD @@ -0,0 +1,3 @@ +# Build only cpupower +cd linux-${VERSION%.*}/tools/power/cpupower/ && +make diff --git a/kernels/linux-cpupower/CONFLICTS b/kernels/linux-cpupower/CONFLICTS new file mode 100755 index 0000000000..7d6a61002a --- /dev/null +++ b/kernels/linux-cpupower/CONFLICTS @@ -0,0 +1 @@ +conflicts cpufreqd diff --git a/kernels/linux-cpupower/DEPENDS b/kernels/linux-cpupower/DEPENDS new file mode 100755 index 0000000000..51011da738 --- /dev/null +++ b/kernels/linux-cpupower/DEPENDS @@ -0,0 +1,5 @@ +depends DEVICE-MANAGER && +depends LZMA && +depends pciutils && +depends perl && +depends sysfsutils diff --git a/kernels/linux-cpupower/DETAILS b/kernels/linux-cpupower/DETAILS new file mode 100755 index 0000000000..8976efa4f2 --- /dev/null +++ b/kernels/linux-cpupower/DETAILS @@ -0,0 +1,35 @@ + SPELL=linux-cpupower +# Linux kernel version containing the cpupower tool source + VERSION=4.7.4 + SOURCE=linux-${VERSION%.*}.tar.xz + SOURCE2=linux-${VERSION%.*}.tar.sign + SOURCE_URL[0]=${KERNEL_URL}/pub/linux/kernel/v${VERSION%%.*}.x/${SOURCE} +# Uncompressed tarball is signed + SOURCE2_URL[0]=${KERNEL_URL}/pub/linux/kernel/v${VERSION%%.*}.x/${SOURCE2} + SOURCE_GPG="kernel.gpg:${SOURCE/.xz/.sign}:UPSTREAM_HASH" + SOURCE2_IGNORE='signature' +# If not a .0 release, download the patch +if [[ "${VERSION##*.}" != '0' ]]; then + SOURCE3=patch-${VERSION}.xz + SOURCE4=patch-${VERSION}.sign + SOURCE3_URL[0]=${KERNEL_URL}/pub/linux/kernel/v${VERSION%%.*}.x/${SOURCE3} + SOURCE4_URL[0]=${KERNEL_URL}/pub/linux/kernel/v${VERSION%%.*}.x/${SOURCE4} + SOURCE3_GPG="kernel.gpg:${SOURCE3/.xz/.sign}:UPSTREAM_HASH" + SOURCE4_IGNORE='signature' +fi +SOURCE_DIRECTORY=$BUILD_DIRECTORY/${SPELL}-${VERSION} + LICENSE[0]=GPLv2 + WEB_SITE=http://www.kernel.org/ + KEYWORDS="power" + ENTERED=20160908 + SHORT="" +cat << EOF +"libcpupower" is a library which offers a unified access method for userspace +tools and programs to the cpufreq core and drivers in the Linux kernel. This +allows for code reduction in userspace tools, a clean implementation of +the interaction to the cpufreq core, and support for both the sysfs and proc +interfaces + +"cpupower" is a tool to examine and manage your processor's power saving +features. +EOF diff --git a/kernels/linux-cpupower/HISTORY b/kernels/linux-cpupower/HISTORY new file mode 100644 index 0000000000..a6cd956cf7 --- /dev/null +++ b/kernels/linux-cpupower/HISTORY @@ -0,0 +1,4 @@ +2016-09-08 Eric Sandall <sandalle@sourcemage.org> + * Created spell, a modern replacement of cpufreqd. + This would be better done to use the existing installed linux files. + diff --git a/kernels/linux-cpupower/INSTALL b/kernels/linux-cpupower/INSTALL new file mode 100755 index 0000000000..ecc5ee1d38 --- /dev/null +++ b/kernels/linux-cpupower/INSTALL @@ -0,0 +1 @@ +DESTDIR="${INSTALL_ROOT}" make install diff --git a/kernels/linux-cpupower/PRE_BUILD b/kernels/linux-cpupower/PRE_BUILD new file mode 100755 index 0000000000..fe33cd556f --- /dev/null +++ b/kernels/linux-cpupower/PRE_BUILD @@ -0,0 +1,38 @@ +# kenel.org signs the uncompressed files... +mk_source_dir "${SOURCE_DIRECTORY}" && +cd "${SOURCE_DIRECTORY}" && +# Make sure our target doesn't exist before uncompressing +if [[ -f "${SOURCE_CACHE}/${SOURCE/.xz}" ]]; then + rm "${SOURCE_CACHE}/${SOURCE/.xz}" +fi && +unxz -k "${SOURCE_CACHE}/${SOURCE}" && +# Fake new SOURCE for unpack_file and verify_file +SOURCE=${SOURCE/.xz} && +verify_file '' && +unpack_file '' && +# Clean up +message "${MESSAGE_COLOR}Removing temporary ${SOURCE_CACHE}/${SOURCE}...${DEFAULT_COLOR}" && +rm "${SOURCE_CACHE}/${SOURCE}" && + +# Subdirectory +cd linux-${VERSION%.*} && + +# If not a .0 release, apply the patch +if [[ "${VERSION##*.}" != '0' ]]; then + message "${MESSAGE_COLOR}Applying patch for ${VERSION}...${DEFAULT_COLOR}" && + # Make sure our target doesn't exist before uncompressing + if [[ -f "${SOURCE_CACHE}/${SOURCE3/.xz}" ]]; then + rm "${SOURCE_CACHE}/${SOURCE3/.xz}" + fi && + unxz -k "${SOURCE_CACHE}/${SOURCE3}" && + # Fake new SOURCE3 for unpack_file and verify_file + SOURCE3=${SOURCE3/.xz} && + verify_file '3' && + patch -p1 < "${SOURCE_CACHE}/${SOURCE3}" && + # Clean up + message "${MESSAGE_COLOR}Removing temporary ${SOURCE_CACHE3}/${SOURCE}...${DEFAULT_COLOR}" && + rm "${SOURCE_CACHE}/${SOURCE3}" +fi && + +# Fix copying of symlinks +sed -i 's:cp -fpR:cp -d:' "${SOURCE_DIRECTORY}"/linux-${VERSION%.*}/tools/power/cpupower/Makefile diff --git a/kernels/linux-cpupower/init.d/cpupowerd b/kernels/linux-cpupower/init.d/cpupowerd new file mode 100755 index 0000000000..f0ccc99740 --- /dev/null +++ b/kernels/linux-cpupower/init.d/cpupowerd @@ -0,0 +1,67 @@ +#!/bin/bash +# +# Source Mage init.d install information +# +# Startup script for cpupower. +# + +# `/usr/bin/cpupower frequency-set` fails to work +PROGRAM=/usr/bin/cpufreq-set +DESC="CPU Power Tool" +RUNLEVEL=3 + +. /etc/init.d/smgl_init +. /etc/sysconfig/cpupowerd + +required_executable $PROGRAM + +start() +{ + # From https://gist.github.com/devkral/1579210 + params='' + if [[ "${governor}" ]]; then + grep -qw "${governor}" /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_governors || modprobe -q cpufreq_${governor} + if [[ "${governor}" != "userspace" ]] && [[ "${freq}" ]]; then + echo "Error: freq needs userspace governor" + exit 1 + fi + + params="-g ${governor} " + params+="${min_freq:+-d $min_freq} " + params+="${max_freq:+-u $max_freq} " + params+="${freq:+-f $freq} " + else + echo "Governer isn't set." + exit 1 + fi + + echo "Starting $DESC: $NAME ${params}" + loadproc $PROGRAM ${params} + evaluate_retval +} + +stop() +{ + echo "Stopping $DESC: $NAME " + killproc $PROGRAM + evaluate_retval +} + +status() +{ + statusproc $PROGRAM +} + +restart() +{ + # + # If the "reload" option is implemented, move the "force-reload" + # option to the "reload" entry above. If not, "force-reload" is + # just the same as "restart". + # + echo "Restarting $DESC: $NAME" + stop + sleep 1 + start +} + diff --git a/kernels/linux-cpupower/init.d/cpupowerd.conf b/kernels/linux-cpupower/init.d/cpupowerd.conf new file mode 100644 index 0000000000..58d6a8aa16 --- /dev/null +++ b/kernels/linux-cpupower/init.d/cpupowerd.conf @@ -0,0 +1,12 @@ +# Config file for cpupower +# +# Valid governors: ondemand, performance, powersave, conservative, userspace +#governor="ondemand" + +# Limit frequency range (optional) +# valid suffixes: Hz, kHz (default), MHz, GHz, THz +#min_freq="1.5GHz" +#max_freq="3GHz" + +# Set the exact cpu frequency via the userspace governor +#freq= diff --git a/mobile/cpufreqd/CONFLICTS b/mobile/cpufreqd/CONFLICTS new file mode 100644 index 0000000000..200064ff06 --- /dev/null +++ b/mobile/cpufreqd/CONFLICTS @@ -0,0 +1 @@ +conflicts linux-cpupower diff --git a/mobile/cpufreqd/HISTORY b/mobile/cpufreqd/HISTORY index 481c49673a..b7556735df 100644 --- a/mobile/cpufreqd/HISTORY +++ b/mobile/cpufreqd/HISTORY @@ -1,3 +1,6 @@ +2016-09-08 Eric Sandall <sandalle@sourcemage.org> + * CONFLICTS: Conflicts with new linux-cpupower (replacement). + 2015-05-25 Thomas Orgis <sobukus@sourcemage.org> * DETAILS: remove SOURCEFORGE_URL usage (automated) |