summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Robbins (Nicias) <nickrobbins@yahoo.com>2011-05-19 19:11:39 +0000
committerNick Robbins (Nicias) <nickrobbins@yahoo.com>2011-05-19 19:11:39 +0000
commite133da8a9704a370caa44dbc05abed01a3ebd780 (patch)
tree1b75ff072a534e076c37f3715378eec0aad1f876 /x11-drivers
parentdev-python/peppercorn: New ebuild for bug 368013 (diff)
downloadsunrise-reviewed-e133da8a9704a370caa44dbc05abed01a3ebd780.tar.gz
sunrise-reviewed-e133da8a9704a370caa44dbc05abed01a3ebd780.tar.bz2
sunrise-reviewed-e133da8a9704a370caa44dbc05abed01a3ebd780.zip
x11-drivers/asus-switcheroo: New build for bug #366503
svn path=/sunrise/; revision=12072
Diffstat (limited to 'x11-drivers')
-rw-r--r--x11-drivers/asus-switcheroo/ChangeLog10
-rw-r--r--x11-drivers/asus-switcheroo/Manifest9
-rw-r--r--x11-drivers/asus-switcheroo/asus-switcheroo-0_p20110504.ebuild83
-rw-r--r--x11-drivers/asus-switcheroo/asus-switcheroo-9999.ebuild82
-rw-r--r--x11-drivers/asus-switcheroo/files/asus-switcheroo.conf-nvidia6
-rwxr-xr-xx11-drivers/asus-switcheroo/files/switcheroo-to-nvidia.sh5
-rwxr-xr-xx11-drivers/asus-switcheroo/files/switcheroo.rc19
-rw-r--r--x11-drivers/asus-switcheroo/files/xorg.conf-nvidia4
-rw-r--r--x11-drivers/asus-switcheroo/metadata.xml6
9 files changed, 224 insertions, 0 deletions
diff --git a/x11-drivers/asus-switcheroo/ChangeLog b/x11-drivers/asus-switcheroo/ChangeLog
new file mode 100644
index 000000000..dab59ac01
--- /dev/null
+++ b/x11-drivers/asus-switcheroo/ChangeLog
@@ -0,0 +1,10 @@
+# ChangeLog for x11-drivers/asus-switcheroo
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+ 19 May 2011; Nick Robbins (Nicias) <nickrobbins@yahoo.com>
+ +asus-switcheroo-0_p20110504.ebuild, +asus-switcheroo-9999.ebuild,
+ +files/asus-switcheroo.conf-nvidia, +files/switcheroo.rc,
+ +files/switcheroo-to-nvidia.sh, +files/xorg.conf-nvidia, +metadata.xml:
+ New build for bug #366503
+
diff --git a/x11-drivers/asus-switcheroo/Manifest b/x11-drivers/asus-switcheroo/Manifest
new file mode 100644
index 000000000..fed0e7ee8
--- /dev/null
+++ b/x11-drivers/asus-switcheroo/Manifest
@@ -0,0 +1,9 @@
+AUX asus-switcheroo.conf-nvidia 283 RMD160 331d4ba735e062fe887d8ae25d11a0f8d85c3182 SHA1 c84704cc0e070b58cb559b5cb8169db3f09ec38b SHA256 7979d0147b463c411e2185a4feb533df6dd54e06bc231635755719d5b63e7fbd
+AUX switcheroo-to-nvidia.sh 118 RMD160 5df94ef90b23974384e7ccf2111959fa7d57c873 SHA1 c06e04f3e6ecdd37d24161209fb28e371cb3bc39 SHA256 b30adf1463a6f9927e71e0aba7a9ae5912e4ec6ccac6807c5165ec0487fbac8e
+AUX switcheroo.rc 492 RMD160 49dedf89b885b44eff9f65c4f2f11fa6d3550e53 SHA1 96dacc81e36edf8562b4348813769f7768736615 SHA256 a8f554e1249b3e29b3b4b7ba784a1350eb2a5845af1dc2b29bf44a67c1fa0224
+AUX xorg.conf-nvidia 71 RMD160 8dec6315b21c46922bd774369ff1e40a41fe1425 SHA1 7209e9426f6b5b4600914d70796023c6f932338d SHA256 e52661ae1f301c0b2635766c3842625442e3a43bb655917ba406b3b70bf6b835
+DIST asus-switcheroo-0_p20110504.tar.gz 16375 RMD160 a344827fedb81d47f9e45b58b8d6365ac875fec8 SHA1 8ea950363c621a81dfe426f99ab503fd8a60f8e0 SHA256 dcef0431a2c3d961c73692239be391f2ad12a2faacf34453c2e6cea38dc96627
+EBUILD asus-switcheroo-0_p20110504.ebuild 2353 RMD160 473a3bc1a5b9194ed3491c0a8ade00defaf005da SHA1 e7c984a29426b94903e5e78f29ec2f224f298fcb SHA256 41d0d80ad6721ccbf3202327737fd2d6a00ec807907df688a948b80aab152ec5
+EBUILD asus-switcheroo-9999.ebuild 2248 RMD160 70258dee676221ac6502f3d1f26e16ab5e19dd4f SHA1 d94a65ff2962ebf016a8b972bf234fa44e917c2c SHA256 1bf69c4e88255f21c343dbb17ec13e827565c352d30760481a9661e4cce5343e
+MISC ChangeLog 421 RMD160 8a3580d2eb27556d1ce62bb5fdd6d70ed9a15cc6 SHA1 c6fd22ac76e2ec5bb6a0ab4c59816b474090df4e SHA256 1fa250256ab61c369db7f084fc1e5ccbfeb2cc68aa4d6bd56d6c6476013393e7
+MISC metadata.xml 229 RMD160 f0f6417bec31ce8baba6d476664f7210c8c84c98 SHA1 e5f94f5caadc6f843fc90bb7959570cd503676fd SHA256 3b08fca3c878bdfc4e7639f477dd542d55a4ab5dce39a475e82633071d13eb3f
diff --git a/x11-drivers/asus-switcheroo/asus-switcheroo-0_p20110504.ebuild b/x11-drivers/asus-switcheroo/asus-switcheroo-0_p20110504.ebuild
new file mode 100644
index 000000000..ee0ec029a
--- /dev/null
+++ b/x11-drivers/asus-switcheroo/asus-switcheroo-0_p20110504.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=4
+inherit linux-mod eutils
+
+DESCRIPTION="Modules to turn off nVidia card for ASUS laptops"
+HOMEPAGE="https://github.com/awilliam/asus-switcheroo"
+
+KEYWORDS="~amd64"
+DEPEND="sys-power/pm-utils"
+RDEPEND="${DEPEND}"
+SLOT="0"
+LICENSE="GPL-2"
+IUSE="video_cards_intel video_cards_nouveau video_cards_nvidia"
+REQUIRED_USE="video_cards_nouveau? ( !video_cards_nvidia )"
+
+GITHUB_COMMIT="178d072"
+SRC_URI="http://www.github.com/awilliam/${PN}/tarball/${GITHUB_COMMIT} -> ${P}.tar.gz"
+S="${WORKDIR}/awilliam-${PN}-${GITHUB_COMMIT}"
+
+BUILD_TARGETS="default"
+
+pkg_setup() {
+ MODULE_NAMES="${PN}(extra/${PN}:${S})"
+ use video_cards_intel && MODULE_NAMES="${MODULE_NAMES} i915-jprobe(extra/${PN}:${S})"
+ use video_cards_nouveau && MODULE_NAMES="${MODULE_NAMES} nouveau-jprobe(extra/${PN}:${S})"
+
+ linux-mod_pkg_setup
+}
+
+src_install(){
+ linux-mod_src_install
+ exeinto /etc/pm/sleep.d
+ doexe ${PN}-pm
+
+ if use video_cards_nvidia ; then
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/${PN}.conf-nvidia ${PN}.conf
+
+ newinitd "${FILESDIR}"/switcheroo.rc switcheroo
+
+ exeinto /usr/sbin
+ newexe "${FILESDIR}"/switcheroo-to-nvidia.sh switcheroo-to-nvidia
+
+ insinto /etc/X11
+ doins "${FILESDIR}"/xorg.conf-nvidia
+
+ elif use video_cards_nouveau ; then
+ insinto /etc/modprobe.d
+ newins ${PN}.conf-modprobe.d ${PN}.conf
+ fi
+}
+
+pkg_postinst() {
+ elog "If debugfs isn't automatically mounted for you,"
+ elog " add this to your /etc/fstab:"
+ elog ""
+ elog " debugfs /sys/kernel/debug debugfs defaults 0 0"
+ elog ""
+ elog "Remember to add asus_switcheroo to /etc/conf.d/modules"
+ elog ""
+ elog "To turn off the discrete card on boot, put"
+ elog ""
+ elog 'if [ -f "/sys/kernel/debug/vgaswitcheroo/switch" ] ; then '
+ elog " /bin/echo OFF > /sys/kernel/debug/vgaswitcheroo/switch"
+ elog "fi"
+ elog ""
+ elog "in /etc/conf.d/local.start"
+
+ if use video_cards_nvidia ; then
+ elog ""
+ elog "This ebuild has installed a system for switching"
+ elog "to the nVidia card and driver. This system requires"
+ elog "that you use the supplied xorg.conf for nVidia"
+ elog "and no xorg.conf for the intel card. The switching"
+ elog "is handled by the command switcheroo-to-nvidia"
+ elog "and the switcheroo init.d script."
+ fi
+
+ linux-mod_pkg_postinst
+}
diff --git a/x11-drivers/asus-switcheroo/asus-switcheroo-9999.ebuild b/x11-drivers/asus-switcheroo/asus-switcheroo-9999.ebuild
new file mode 100644
index 000000000..18f8ac9f8
--- /dev/null
+++ b/x11-drivers/asus-switcheroo/asus-switcheroo-9999.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=4
+inherit linux-mod eutils git-2
+KEYWORDS=""
+SLOT="0"
+LICENSE="GPL-2"
+
+DESCRIPTION="Modules to turn off nVidia card for ASUS laptops"
+HOMEPAGE="https://github.com/awilliam/asus-switcheroo"
+
+IUSE="video_cards_intel video_cards_nouveau video_cards_nvidia"
+REQUIRED_USE="video_cards_nouveau? ( !video_cards_nvidia )"
+
+DEPEND="sys-power/pm-utils"
+RDEPEND="${DEPEND}"
+
+EGIT_REPO_URI="git://github.com/awilliam/${PN}.git"
+
+BUILD_TARGETS="default"
+
+pkg_setup() {
+ MODULE_NAMES="${PN}(extra/${PN}:${S})"
+ use video_cards_intel && MODULE_NAMES="${MODULE_NAMES} i915-jprobe(extra/${PN}:${S})"
+ use video_cards_nouveau && MODULE_NAMES="${MODULE_NAMES} nouveau-jprobe(extra/${PN}:${S})"
+
+ linux-mod_pkg_setup
+}
+
+src_install(){
+ linux-mod_src_install
+ exeinto /etc/pm/sleep.d
+ doexe ${PN}-pm
+
+ if use video_cards_nvidia ; then
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/${PN}.conf-nvidia ${PN}.conf
+
+ newinitd "${FILESDIR}"/switcheroo.rc switcheroo
+
+ exeinto /usr/sbin
+ newexe "${FILESDIR}"/switcheroo-to-nvidia.sh switcheroo-to-nvidia
+
+ insinto /etc/X11
+ doins "${FILESDIR}"/xorg.conf-nvidia
+
+ elif use video_cards_nouveau ; then
+ insinto /etc/modprobe.d
+ newins ${PN}.conf-modprobe.d ${PN}.conf
+ fi
+}
+
+pkg_postinst() {
+ elog "If debugfs isn't automatically mounted for you,"
+ elog " add this to your /etc/fstab:"
+ elog ""
+ elog " debugfs /sys/kernel/debug debugfs defaults 0 0"
+ elog ""
+ elog "Remember to add asus_switcheroo to /etc/conf.d/modules"
+ elog ""
+ elog "To turn off the discrete card on boot, put"
+ elog ""
+ elog 'if [ -f "/sys/kernel/debug/vgaswitcheroo/switch" ] ; then '
+ elog " /bin/echo OFF > /sys/kernel/debug/vgaswitcheroo/switch"
+ elog "fi"
+ elog ""
+ elog "in /etc/conf.d/local.start"
+
+ if use video_cards_nvidia ; then
+ elog ""
+ elog "This ebuild has installed a system for switching"
+ elog "to the nVidia card and driver. This system requires"
+ elog "that you use the supplied xorg.conf for nVidia"
+ elog "and no xorg.conf for the intel card. The switching"
+ elog "is handled by the command switcheroo-to-nvidia"
+ elog "and the switcheroo init.d script."
+ fi
+
+ linux-mod_pkg_postinst
+}
diff --git a/x11-drivers/asus-switcheroo/files/asus-switcheroo.conf-nvidia b/x11-drivers/asus-switcheroo/files/asus-switcheroo.conf-nvidia
new file mode 100644
index 000000000..ab885c9ca
--- /dev/null
+++ b/x11-drivers/asus-switcheroo/files/asus-switcheroo.conf-nvidia
@@ -0,0 +1,6 @@
+options asus-switcheroo dummy-client=1
+blacklist nvidia
+
+install nvidia /sbin/modprobe asus-switcheroo ; /bin/echo DIS > /sys/kernel/debug/vgaswitcheroo/switch ; /sbin/modprobe --ignore-install nvidia
+install i915 /sbin/modprobe i915-jprobe; /sbin/modprobe --ignore-install i915
+
diff --git a/x11-drivers/asus-switcheroo/files/switcheroo-to-nvidia.sh b/x11-drivers/asus-switcheroo/files/switcheroo-to-nvidia.sh
new file mode 100755
index 000000000..ff59fe653
--- /dev/null
+++ b/x11-drivers/asus-switcheroo/files/switcheroo-to-nvidia.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+( /etc/init.d/xdm stop;
+/sbin/modprobe nvidia;
+/etc/init.d/switcheroo restart;
+/etc/init.d/xdm start ) &
diff --git a/x11-drivers/asus-switcheroo/files/switcheroo.rc b/x11-drivers/asus-switcheroo/files/switcheroo.rc
new file mode 100755
index 000000000..2331287f5
--- /dev/null
+++ b/x11-drivers/asus-switcheroo/files/switcheroo.rc
@@ -0,0 +1,19 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2
+# $Header: /var/cvsroot/gentoo-x86/x11-base/xorg-server/files/xdm.initd-3,v 1.2 2011/01/22 15:30:07 lxnay Exp $
+
+depend() {
+ before xdm
+}
+
+start() {
+ if ( lsmod | grep nvidia ) ; then
+ /usr/bin/eselect opengl set nvidia
+ /bin/ln -f /etc/X11/xorg.conf-nvidia /etc/X11/xorg.conf
+ else
+ /usr/bin/eselect opengl set xorg-x11
+ /bin/rm -f /etc/X11/xorg.conf
+ fi
+}
+
diff --git a/x11-drivers/asus-switcheroo/files/xorg.conf-nvidia b/x11-drivers/asus-switcheroo/files/xorg.conf-nvidia
new file mode 100644
index 000000000..3fa647477
--- /dev/null
+++ b/x11-drivers/asus-switcheroo/files/xorg.conf-nvidia
@@ -0,0 +1,4 @@
+Section "Device"
+Identifier "NVIDIA_Device"
+Driver "nvidia"
+EndSection
diff --git a/x11-drivers/asus-switcheroo/metadata.xml b/x11-drivers/asus-switcheroo/metadata.xml
new file mode 100644
index 000000000..e6233b5dc
--- /dev/null
+++ b/x11-drivers/asus-switcheroo/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>no-herd</herd>
+<maintainer><email>maintainer-wanted@gentoo.org</email></maintainer>
+</pkgmetadata>