


Code: Select all
ln -sf linux version linux
Code: Select all
ln -sf /usr/src/linux-`uname -r` /usr/src/linux
if ! [ -e /lib/modules/`uname -r`/video/nvidia.o ] ;
then
emerge nvidia-kernel nvidia-glx
modprobe nvidia
fi

You're only emerging a package. Do you realize that when you compile programs, some programs use that symlink to compile to?NiklasH wrote:I have had this for a long time in my /etc/conf.d/local.start:
, to automatically get the nvidia modules loaded for my new kernel.Code: Select all
ln -sf /usr/src/linux-`uname -r` /usr/src/linux if ! [ -e /lib/modules/`uname -r`/video/nvidia.o ] ; then emerge nvidia-kernel nvidia-glx modprobe nvidia fi
Works fine for me.
that's not a problem if you always compile it right after emerging.NiklasH wrote:Yes, but that package uses the /usr/src/linux symlink to put the nvidia module. And why would I want a program that compiles against the kernel to compile against something other than the running kernel?

I didn't expect you to have any problems, but it must take quite some time to boot whenever you've changed your kernel or you decided to boot an alternative kernel. That's why I assumed you don't reboot quite often.NiklasH wrote:Nope, I turn off my computer almost every night.
Haven't had any problems.
I already said it: If you happen to use a 2.6 kernel and you still have 2.4 in your world file. Let's assume you just did an emerge world and there is an update to 2.4 and another one to nvidia-kernel. If you include a symlink change into the kernel ebuild this will lead to a new nvidia module compiled for a 2.4 kernel. The nvidia-kernel ebuild removes "old" instances, so you won't have nvidia.ko in your /lib/modules/2.6.<whatever>. That's the confusion I'm talking about.NiklasH wrote: And what kind of confusion would it lead to? If i keep the symlink to an old kernel, it could also cause trouble if I compile some new program against it.
I've only got 2 myself (nvidia-kernel and at76c503a). But the current setup is quite convenient IMO - I don't want to count the report requests this new ebuild would cause ("I just emerged X and after modprobing it I'm told that Module doesn't exists).NiklasH wrote: The only programs that could run into troubles are the ones that install their own modules, as far as I can tell. And they aren't that many, at least not on my system.

Maybe I'm too tired to see what you mean, but I don't. My computer boots in about 20-30 seconds, if that's what you mean? And I tend to use one kernel until another one comes along that seems neat. And then I of course use make oldconfig.nerdbert wrote:I didn't expect you to have any problems, but it must take quite some time to boot whenever you've changed your kernel or you decided to boot an alternative kernel. That's why I assumed you don't reboot quite often.NiklasH wrote:Nope, I turn off my computer almost every night.
Haven't had any problems.
I'm not talking about the kernel ebuild. I'm talking about rebooting into another kernel. The script I use is in my local.start, for precisely that reason: that the module is removed from other kernels.I already said it: If you happen to use a 2.6 kernel and you still have 2.4 in your world file. Let's assume you just did an emerge world and there is an update to 2.4 and another one to nvidia-kernel. If you include a symlink change into the kernel ebuild this will lead to a new nvidia module compiled for a 2.4 kernel. The nvidia-kernel ebuild removes "old" instances, so you won't have nvidia.ko in your /lib/modules/2.6.<whatever>. That's the confusion I'm talking about.NiklasH wrote: And what kind of confusion would it lead to? If i keep the symlink to an old kernel, it could also cause trouble if I compile some new program against it.
Maybe we're not talking about the same thing? Are you talking about changing the symlink in the ebuild? If that's the case, then we agree: I don't want it in the ebuild either. But that wasn't in my original post, OTOH.I've only got 2 myself (nvidia-kernel and at76c503a). But the current setup is quite convenient IMO - I don't want to count the report requests this new ebuild would cause ("I just emerged X and after modprobing it I'm told that Module doesn't exists).NiklasH wrote: The only programs that could run into troubles are the ones that install their own modules, as far as I can tell. And they aren't that many, at least not on my system.

it's not a stupid idea to include it in an ebuild - I just believe it doesn't make sense to have it as a default optionewan.paton wrote:yeh the ebuild to make symlink was a stupid idea, i think the idea of startup script is a lot more useful. i was just being lazy and wanted to type as little as posible, the scrip alows me to change kernels often and not have remeber or type stuff

Then I think we pretty much agreenerdbert wrote:I don't really know if we're talking about the same thing. I'll try to clarify my point:
Whenever your script leads to a reemerge of nvidia-kernel and nvidia-glx it takes more than 30s to boot. I've got more than 1 kernel in my grub.conf and whenever I want to boot a different one this would really take a while.
But I like your additions to local.start and I can perfectly understand why you use this.
If you want to have an automatic link created whenever you emerge a new kernel (I'm also tired - wasn't this ewan.paton's suggestion?) this might be realized in the kernel's ebuild. IMO it just doesn't make sense in the average case scenario, because people tend to emerge kernels they don't really use.

