This is an overhaul of the nvidia portage. Grab it from: http://cdf.toronto.edu/~agenkin/media-gfx.nvidia-new.tar.gz BTW, is media-gfx the right place for it? It's primarilly the X driver, so I think that these portages should go into x11-base or x11-misc.
Is there an advantage to having this split into 2 ebuilds?
I just wrote a message about this to gentoo-dev (see message <uobsf525o1.fsf@cdf.toronto.edu>). IMO, yes. Otherwise, when the latest versions of the kernel driver and the glx libraries differ (as they do now), which one determnines the version of the portage? Besides, updating the nvidia-kernel for a new Linux kernel does not require reinstall of the glx libraries. There are other changes (like installing the GLX libraries into /opt/NVIDIA, and more), which I discussed in the above message. Should I copy-paste into here?
No, I saw most of the other changes. I was just curious on the splitting issue.
Here are all the problems with these ebuilds that I found. Once fixed, I can add these ebuilds to Portage to replace our current ebuild. First, we're going to put them in "media-video". In the kernel ebuild: This: NV_KV="`readlink /usr/src/linux`" if [ $? -ne 0 ] then die "/usr/src/linux does not exist" fi NV_KV="${NV_KV/linux-/}" ...needs to be moved inside its own function and called by the src_*() functions that need it. This fixes another bug related to doing an emerge update on a brand-new system. Basically, we can't have the "readlink" run if the ebuild is simply sourced. This... [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules ...should not be in src_install. It should be in pkg_postinst() and only run if $ROOT = "/" The entire device node creation stuff should be completely removed from the ebuild. It is not necessary for devfs systems and writes outside of ${D} as well. Remove from src_install and move to pkg_postinst (only if $ROOT = "/") [ -x /sbin/depmod ] && /sbin/depmod -a Remove altogether (not our policy to auto-load modules): [ -x /sbin/modprobe ] && /sbin/modprobe NVdriver The glx ebuild: Remove (done automatically by emerge and certainly not supposed to be in src_install): [ -x /usr/sbin/env-update ] && /usr/sbin/env-update ldconfig Change /opt/NVIDIA to /opt/nvidia Using the 09nvidia script to precede X's libraries is a nice way to approach the problem, though. If you fix all the above-mentioned things I'll add these ebuilds to Portage.
Daniel, thanks for the feedback. I've updated the ebuilds as you suggested. The new version is posted at: http://cdf.toronto.edu/~agenkin/media-video.nvidia-new.tar.gz Regarding the device nodes... How about the people that don't use devfs? Should we provide a script for them? I've left the device-creation functions in the ebuild for now, but commented out invocation of nv_mk_dev_nodes function, so they are not used. Perhaps we can detect whether devfs is used and create the nodes otherwise? I tried creating the device entries in ${D}; it worked with installation, but not with unmerging. ;^)
We don't unmerge device nodes because it's a really bad thing to do. This was a concious design decision. You'll need to remove all the device node creation stuff from your ebuild. Add a script to files/ and point the user to it in pkg_postinst() if you want.
What would be a good destination directory for such script? /usr/lib/nvidia/ ?
I think /opt/nvidia/bin would be good.
OK, your new ebuilds look really great. If you want to submit a new version that includes a device node-making script, I'll add these 2 ebuilds to cvs.
Okay, updated. You can fetch them from: http://cdf.toronto.edu/~agenkin/media-video.nvidia-updated.tar.gz Thanks for bearing with me. ;^) I'll try to require less hand-holding the next time.
OK, thanks Arcady! I just added them to CVS. Now, if you could do one more thing. Please write up some easy-to-understand and thorough instructions for how people should install these new NVIDIA kernel/GLX packages, including configuring XF86Config. Then email these instructions to gentoo-announce@gentoo.org and cc g2boojum@gentoo.org. He will need to update the Gentoo Linux Desktop Guide on our site. Thanks for your great work! The NVIDIA drivers needed an overhaul and it looks like you've addressed all known issues. I'm now marking this bug as "FIXED".