From b3a59b0e69ea28cc48757123a11c29969b5a891b Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 1 Sep 2011 09:35:22 +0200 Subject: [PATCH] linux: build and install 'cpupower' tool, set cpu to 'fullpower' on boot and to 'ondemand' after boot finished Signed-off-by: Stephan Raue --- packages/linux/build | 11 ++++++++++ packages/linux/init.d/01_cpupower | 28 ++++++++++++++++++++++++ packages/linux/install | 5 +++++ packages/linux/meta | 4 ++-- packages/mediacenter/xbmc/init.d/93_xbmc | 6 +++++ 5 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 packages/linux/init.d/01_cpupower diff --git a/packages/linux/build b/packages/linux/build index 1e2cb82784..064c354d09 100755 --- a/packages/linux/build +++ b/packages/linux/build @@ -51,3 +51,14 @@ rm -f modules/lib/modules/*/build rm -f modules/lib/modules/*/source make $KERNEL_IMAGE + +( cd tools/power/cpupower + + export CFLAGS="$TARGET_CFLAGS -I$SYSROOT_PREFIX/usr/include" + export LDFLAGS="$TARGET_LDFLAGS -L$SYSROOT_PREFIX/lib -L$SYSROOT_PREFIX/usr/lib" + + make CROSS="$TARGET_PREFIX" \ + V=1 \ + DEBUG=false \ + NLS=false \ +) \ No newline at end of file diff --git a/packages/linux/init.d/01_cpupower b/packages/linux/init.d/01_cpupower new file mode 100644 index 0000000000..314c7a8592 --- /dev/null +++ b/packages/linux/init.d/01_cpupower @@ -0,0 +1,28 @@ +################################################################################ +# Copyright (C) 2009-2010 OpenELEC.tv +# http://www.openelec.tv +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +# +# set cpupower to 'performance' +# +# runlevels: openelec, textmode + +progress "set cpu's to full power" + + cpupower frequency-set -g performance diff --git a/packages/linux/install b/packages/linux/install index 39d6a00e0d..a2162fbb64 100755 --- a/packages/linux/install +++ b/packages/linux/install @@ -46,3 +46,8 @@ mkdir -p $INSTALL/etc mkdir -p $INSTALL/etc/modprobe.d cp $PKG_DIR/modprobe.d/*.conf $INSTALL/etc/modprobe.d +mkdir -p $INSTALL/usr/lib + cp -P $PKG_BUILD/tools/power/cpupower/libcpupower.so* $INSTALL/usr/lib + +mkdir -p $INSTALL/usr/bin + cp -P $PKG_BUILD/tools/power/cpupower/cpupower $INSTALL/usr/bin diff --git a/packages/linux/meta b/packages/linux/meta index bdb0ae0063..6a98e9c2c0 100644 --- a/packages/linux/meta +++ b/packages/linux/meta @@ -25,8 +25,8 @@ PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="http://www.kernel.org" PKG_URL="http://www.kernel.org/pub/linux/kernel/v3.0/testing/$PKG_NAME-$PKG_VERSION.tar.bz2" -PKG_DEPENDS="busybox linux-drivers linux-firmware" -PKG_BUILD_DEPENDS="toolchain busybox-hosttools xz cpio" +PKG_DEPENDS="busybox linux-drivers linux-firmware pciutils" +PKG_BUILD_DEPENDS="toolchain busybox-hosttools xz cpio pciutils" PKG_PRIORITY="optional" PKG_SECTION="linux" PKG_SHORTDESC="linux26: The Linux kernel 2.6 precompiled kernel binary image and modules" diff --git a/packages/mediacenter/xbmc/init.d/93_xbmc b/packages/mediacenter/xbmc/init.d/93_xbmc index 92687c0e14..49f1162175 100644 --- a/packages/mediacenter/xbmc/init.d/93_xbmc +++ b/packages/mediacenter/xbmc/init.d/93_xbmc @@ -52,6 +52,12 @@ fi # waiting for Xorg to start wait_for_xorg +# set cpu's to 'on demand' + ( usleep 15000000 + progress "set cpu's to 'on demand'" + cpupower frequency-set -g ondemand + )& + # starting XBMC while true; do