Commit 0c760a9f authored by philm's avatar philm

add acpi_call for hybrid switching

parent 611bd5ae
#
# Chakra Packages for Chakra, part of chakra-project.org
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
pkgname=acpi_call
pkgver=20101109
pkgrel=1
pkgdesc="A kernel module that enables you to call parameterless ACPI methods by writing the method name to /proc/acpi/call, e.g. to turn off discrete graphics card in a dual graphics environment (like NVIDIA Optimus)."
arch=('i686' 'x86_64')
url=("http://github.com/mkottman/acpi_call")
license=('GPL')
depends=('kernel26' 'kernel26-headers')
makedepends=('git')
install=acpi_call.install
source=(http://chakra-project.org/sources/${pkgname}/${pkgname}-${pkgver}.tar.xz)
md5sums=('79e7a95ebeff1df29201cae22067921f')
# create tarball: source PKGBUILD && mksource
mksource() {
git clone http://github.com/mkottman/acpi_call.git
pushd acpi_call
popd
tar -cvJf ${pkgname}-${pkgver}.tar.xz acpi_call/*
md5sum ${pkgname}-${pkgver}.tar.xz
}
build() {
cd ${srcdir}
## Build
rm -rf ${srcdir}/$pkgname-build
cp -r ${srcdir}/$pkgname ${srcdir}/$pkgname-build
cd ${srcdir}/$pkgname-build
make
}
package() {
cd ${srcdir}/$pkgname-build
install -d ${pkgdir}/usr/share/$pkgname || return 1
install -d ${pkgdir}/usr/bin || return 1
install -d ${pkgdir}/usr/share/$pkgname/doc || return 1
cp -a ${srcdir}/$pkgname-build/test_off.sh \
${pkgdir}/usr/share/$pkgname || return 1
ln -s /usr/share/$pkgname/test_off.sh \
${pkgdir}/usr/bin/test_off.sh || return 1
install -Dm644 README \
${pkgdir}/usr/share/$pkgname/README
for _kernver in $(file /boot/* | sed -n '/Linux kernel/s/.* version \(2\.6\.[-[:alnum:]_]\+\).*/\1/p'); do
msg2 "Building module for $_kernver..."
# KDIR is necessary even when cleaning
make KDIR=/usr/src/linux-${_kernver} clean
make KDIR=/usr/src/linux-${_kernver}
install -D -m644 acpi_call.ko ${pkgdir}/lib/modules/${_kernver}/kernel/drivers/acpi/acpi_call.ko
done
}
post_install() {
depmod -a
echo ""
echo "[+] modprobe acpi_call"
echo ">>> run /usr/bin/test_off.sh to test/view different acpi_call functions to see if it disables your secondary/hybrid video card"
}
post_upgrade() {
depmod -a
echo ""
echo "[+] modprobe acpi_call"
echo ">>> run /usr/bin/test_off.sh to test/view different acpi_call functions to see if it disables your secondary/hybrid video card"
}
post_remove() {
depmod -a
}
op=$1
shift
$op $*
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment