diff options
-rw-r--r-- | x11-drivers/asus-switcheroo/ChangeLog | 4 | ||||
-rw-r--r-- | x11-drivers/asus-switcheroo/Manifest | 6 | ||||
-rw-r--r-- | x11-drivers/asus-switcheroo/asus-switcheroo-0_p20110814.ebuild | 117 | ||||
-rw-r--r-- | x11-drivers/asus-switcheroo/metadata.xml | 3 |
4 files changed, 128 insertions, 2 deletions
diff --git a/x11-drivers/asus-switcheroo/ChangeLog b/x11-drivers/asus-switcheroo/ChangeLog index dab59ac01..d90bf9e67 100644 --- a/x11-drivers/asus-switcheroo/ChangeLog +++ b/x11-drivers/asus-switcheroo/ChangeLog @@ -2,6 +2,10 @@ # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 20 Aug 2011; Nick Robbins (Nicias) <nickrobbins@yahoo.com> + +asus-switcheroo-0_p20110814.ebuild, metadata.xml: + Updating to allow use of /etc/X11/xorg.conf.d/ and byo-switcheroo + 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, diff --git a/x11-drivers/asus-switcheroo/Manifest b/x11-drivers/asus-switcheroo/Manifest index fed0e7ee8..f46843f2e 100644 --- a/x11-drivers/asus-switcheroo/Manifest +++ b/x11-drivers/asus-switcheroo/Manifest @@ -3,7 +3,9 @@ AUX switcheroo-to-nvidia.sh 118 RMD160 5df94ef90b23974384e7ccf2111959fa7d57c873 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 +DIST asus-switcheroo-0_p20110814.tar.gz 18948 RMD160 b973cace5a9542f6abf60a00f9ce70935847c686 SHA1 5d139fac5f6dd409b58932a80b3ab99a90fbfff7 SHA256 a3a927965aca5cad8ed0312aa50a102a0287dc7c022d9bc87f54bac0a000ea5d EBUILD asus-switcheroo-0_p20110504.ebuild 2353 RMD160 473a3bc1a5b9194ed3491c0a8ade00defaf005da SHA1 e7c984a29426b94903e5e78f29ec2f224f298fcb SHA256 41d0d80ad6721ccbf3202327737fd2d6a00ec807907df688a948b80aab152ec5 +EBUILD asus-switcheroo-0_p20110814.ebuild 3319 RMD160 e3a0cb3f164ee9c360941f33250d200dd4ff9486 SHA1 cad68b0b89b4beb3110b7bc678e7d4251a4f9b5b SHA256 79733fe287d031983b4174fd53d3dc01661254d4841a7916df9bf62854ffccf1 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 +MISC ChangeLog 604 RMD160 b5e7bb6e91a03b92b05b9779a7973a8c4e8534ff SHA1 fed2edde8d2b19a32d9060cc99806bd9c2ab60c3 SHA256 6d2c2876c60ea0f93c1c3abcfff1abfea16c4ad4df1112556afaacadf0582714 +MISC metadata.xml 308 RMD160 2f01fafd2aa588f978505632df469ae21bc82af7 SHA1 a76b7d9add33f4fcf81dc043c9e8a3bebc3e8f29 SHA256 f7135d0fb7b25613ff24bf5fbacd56a5e7e377e4b796ef868c13c1b1ad356792 diff --git a/x11-drivers/asus-switcheroo/asus-switcheroo-0_p20110814.ebuild b/x11-drivers/asus-switcheroo/asus-switcheroo-0_p20110814.ebuild new file mode 100644 index 000000000..6d523e14f --- /dev/null +++ b/x11-drivers/asus-switcheroo/asus-switcheroo-0_p20110814.ebuild @@ -0,0 +1,117 @@ +# 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="byo video_cards_intel video_cards_nouveau video_cards_nvidia" +REQUIRED_USE="video_cards_nouveau? ( !video_cards_nvidia )" + +GITHUB_COMMIT="9231be9" +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 byo && MODULE_NAMES="byo-switcheroo(extra/${PN}:${S})" + use video_cards_nouveau && MODULE_NAMES="${MODULE_NAMES} nouveau-jprobe(extra/${PN}:${S})" + + if kernel_is ge 3 0 0; then + eerror "This package has only been tested with 2.6.x version kernels" + die + fi + + if kernel_is ge 2 6 38; then + CONFIG_CHECK="VGA_SWITCHEROO" + else + use video_cards_intel && MODULE_NAMES="${MODULE_NAMES} i915-jprobe(extra/${PN}:${S})" + fi + + linux-mod_pkg_setup +} + +src_install(){ + linux-mod_src_install + exeinto /etc/pm/sleep.d + doexe ${PN}-pm + + if kernel_is ge 2 6 38 ; then + sed -i "/915/d" ${PN}.conf-modprobe.d + fi + + sed -i '1ioptions asus-switcheroo ' ${PN}.conf-modprobe.d + + if ( use video_cards_nvidia || use byo) ; then + sed -i "s:options.*oo:& dummy-client=1 \n:" ${PN}.conf-modprobe.d + fi + + if use video_cards_nvidia ; then + sed -i "s:/sbin/modprobe nouveau-jprobe:/bin/echo DIS > /sys/kernel/debug/vgaswitcheroo/switch:" ${PN}.conf-modprobe.d + sed -i "s:ouveau:vidia:g" ${PN}.conf-modprobe.d + fi + + if use byo ; then + sed -i "s:asus:byo:g" ${PN}.conf-modprobe.d + sed -i "s:options.*oo:& model=AsusUL30VT:" ${PN}.conf-modprobe.d + fi + + if use video_cards_nvidia ; then + sed -i '1iblacklist nvidia' ${PN}.conf-modprobe.d + + insinto /etc/modprobe.d + newins ${PN}.conf-modprobe.d ${PN}.conf + + newinitd "${FILESDIR}"/switcheroo-dir.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 or byo_switcheroo" + elog "to /etc/conf.d/modules, and edit your laptop model." + 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/local.d/switcheroo.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/metadata.xml b/x11-drivers/asus-switcheroo/metadata.xml index e6233b5dc..863af0272 100644 --- a/x11-drivers/asus-switcheroo/metadata.xml +++ b/x11-drivers/asus-switcheroo/metadata.xml @@ -3,4 +3,7 @@ <pkgmetadata> <herd>no-herd</herd> <maintainer><email>maintainer-wanted@gentoo.org</email></maintainer> +<use> +<flag name='byo'>Enables usage of the byo-swicheroo module</flag> +</use> </pkgmetadata> |