1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit linux-mod eutils git-2
11 DESCRIPTION="Modules to turn off nVidia card for ASUS laptops"
12 HOMEPAGE="https://github.com/awilliam/asus-switcheroo"
14 IUSE="video_cards_intel video_cards_nouveau video_cards_nvidia"
15 REQUIRED_USE="video_cards_nouveau? ( !video_cards_nvidia )"
17 DEPEND="sys-power/pm-utils"
20 EGIT_REPO_URI="git://github.com/awilliam/${PN}.git"
22 BUILD_TARGETS="default"
25 MODULE_NAMES="${PN}(extra/${PN}:${S})"
26 use video_cards_intel && MODULE_NAMES="${MODULE_NAMES} i915-jprobe(extra/${PN}:${S})"
27 use video_cards_nouveau && MODULE_NAMES="${MODULE_NAMES} nouveau-jprobe(extra/${PN}:${S})"
34 exeinto /etc/pm/sleep.d
37 if use video_cards_nvidia ; then
38 insinto /etc/modprobe.d
39 newins "${FILESDIR}"/${PN}.conf-nvidia ${PN}.conf
41 newinitd "${FILESDIR}"/switcheroo.rc switcheroo
44 newexe "${FILESDIR}"/switcheroo-to-nvidia.sh switcheroo-to-nvidia
47 doins "${FILESDIR}"/xorg.conf-nvidia
49 elif use video_cards_nouveau ; then
50 insinto /etc/modprobe.d
51 newins ${PN}.conf-modprobe.d ${PN}.conf
56 elog "If debugfs isn't automatically mounted for you,"
57 elog " add this to your /etc/fstab:"
59 elog " debugfs /sys/kernel/debug debugfs defaults 0 0"
61 elog "Remember to add asus_switcheroo to /etc/conf.d/modules"
63 elog "To turn off the discrete card on boot, put"
65 elog 'if [ -f "/sys/kernel/debug/vgaswitcheroo/switch" ] ; then '
66 elog " /bin/echo OFF > /sys/kernel/debug/vgaswitcheroo/switch"
69 elog "in /etc/conf.d/local.start"
71 if use video_cards_nvidia ; then
73 elog "This ebuild has installed a system for switching"
74 elog "to the nVidia card and driver. This system requires"
75 elog "that you use the supplied xorg.conf for nVidia"
76 elog "and no xorg.conf for the intel card. The switching"
77 elog "is handled by the command switcheroo-to-nvidia"
78 elog "and the switcheroo init.d script."
81 linux-mod_pkg_postinst