Re: [gentoo-user] Re: Kernel upgrading and linux symlink

2009-11-01 Thread Dirk Heinrichs
Am Samstag 31 Oktober 2009 22:03:03 schrieb Alan McKinnon:
> Yes, almost every app that installs kernel drivers will go to
>  /usr/src/linux/  looking for kernel sources

Nope. They look into $KBUILD_OUTPUT and $KERNEL_DIR, which both default to 
/usr/src/linux.

Bye...

Dirk


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Re: Kernel upgrading and linux symlink

2009-10-31 Thread Mark Knecht
On Sat, Oct 31, 2009 at 4:40 PM, walt  wrote:
> On 10/31/2009 04:29 PM, Mark Knecht wrote:
>
>> So I think this thread addresses a question I've had about the kernel
>> installation process over the years. I only copy bzImage to /boot with
>> a rename to whatever this kernel is. I don't do anything with the
>> other files - System.map and something else - which I don't even have
>> on most of my systems anymore. They don't seem to be needed...
>
> They're needed if you are trying to debug kernel crashes, but AFAIK
> not needed for anything else.
>

Thanks.

- Mark



[gentoo-user] Re: Kernel upgrading and linux symlink

2009-10-31 Thread walt
On 10/31/2009 04:29 PM, Mark Knecht wrote:

> So I think this thread addresses a question I've had about the kernel
> installation process over the years. I only copy bzImage to /boot with
> a rename to whatever this kernel is. I don't do anything with the
> other files - System.map and something else - which I don't even have
> on most of my systems anymore. They don't seem to be needed...

They're needed if you are trying to debug kernel crashes, but AFAIK
not needed for anything else.




Re: [gentoo-user] Re: Kernel upgrading and linux symlink

2009-10-31 Thread Alan McKinnon
On Saturday 31 October 2009 23:43:21 Mark Knecht wrote:
> On Sat, Oct 31, 2009 at 2:27 PM, Nikos Chantziaras  wrote:
> > On 10/31/2009 11:07 PM, Alan McKinnon wrote:
> >> On Saturday 31 October 2009 22:03:04 Nikos Chantziaras wrote:
>  For instance, you might be running 2.6.31-r4 and also have 2.6.31-r3
>  installed. To install nvidia-drivers, you must build it twice -
>  against each kernel you want to use it with (nvidia-drivers builds and
>  installs a
>  kernel driver into /lib/modules/)
> >>>
> >>> It's a bit more obfuscated than that.  Maybe nvidia-drivers work
> >>> different, but ati-drivers will build against /usr/src/linux but
> >>> install the actual modules in /lib/modules/running_kernel.  If
> >>> /usr/src/linux doesn't point to the running kernel, the modules will be
> >>> installed in the wrong place.
> >>
> >> That is just so mind-bogglingly absurdly stupid I doubt if ATI should
> >> even be
> >> allowed near a computer
> >>
> >> Compiling code never depends on something running, it only depends on
> >> things
> >> being present that can be linked against.
> >>
> >> Thanks for reminding me why I insist on NVidia GPUs, I'd forgotten.
> >
> > This isn't ATI's installer.  It's the ebuild that does this.
> 
> And from deep memory it seems like there were other packages that
> operated this way 8-10 years ago. I know in 1999 I had to be very
> careful about where the linux link pointed, and while it's not as
> necessary today to do so i'm still quite careful.
> 
> I use the ATI drivers on my AMD64 machine. I think I've always found
> that I needed to emerge fglrx after the new kernel had been booted but
> never understood why. This email is helpful. It seems to me that if it
> is the ebuild that's doing this is needs to be fixed. If I understand
> correctly I could be building for 2.6.31 but installing in 2.6.29?
> That's not right...

I agree, the ebuild should be fixed. I can't think of any valid reason for 
that behaviour.

-- 
alan dot mckinnon at gmail dot com



Re: [gentoo-user] Re: Kernel upgrading and linux symlink

2009-10-31 Thread Mark Knecht
On Sat, Oct 31, 2009 at 2:27 PM, Nikos Chantziaras  wrote:
> On 10/31/2009 11:07 PM, Alan McKinnon wrote:
>>
>> On Saturday 31 October 2009 22:03:04 Nikos Chantziaras wrote:

 For instance, you might be running 2.6.31-r4 and also have 2.6.31-r3
 installed. To install nvidia-drivers, you must build it twice - against
 each kernel you want to use it with (nvidia-drivers builds and installs
 a
 kernel driver into /lib/modules/)
>>>
>>> It's a bit more obfuscated than that.  Maybe nvidia-drivers work
>>> different, but ati-drivers will build against /usr/src/linux but install
>>> the actual modules in /lib/modules/running_kernel.  If /usr/src/linux
>>> doesn't point to the running kernel, the modules will be installed in
>>> the wrong place.
>>
>>
>> That is just so mind-bogglingly absurdly stupid I doubt if ATI should even
>> be
>> allowed near a computer
>>
>> Compiling code never depends on something running, it only depends on
>> things
>> being present that can be linked against.
>>
>> Thanks for reminding me why I insist on NVidia GPUs, I'd forgotten.
>
> This isn't ATI's installer.  It's the ebuild that does this.

And from deep memory it seems like there were other packages that
operated this way 8-10 years ago. I know in 1999 I had to be very
careful about where the linux link pointed, and while it's not as
necessary today to do so i'm still quite careful.

I use the ATI drivers on my AMD64 machine. I think I've always found
that I needed to emerge fglrx after the new kernel had been booted but
never understood why. This email is helpful. It seems to me that if it
is the ebuild that's doing this is needs to be fixed. If I understand
correctly I could be building for 2.6.31 but installing in 2.6.29?
That's not right...

Thanks to all for the info.

Cheers,
Mark



[gentoo-user] Re: Kernel upgrading and linux symlink

2009-10-31 Thread Nikos Chantziaras

On 10/31/2009 11:07 PM, Alan McKinnon wrote:

On Saturday 31 October 2009 22:03:04 Nikos Chantziaras wrote:

For instance, you might be running 2.6.31-r4 and also have 2.6.31-r3
installed. To install nvidia-drivers, you must build it twice - against
each kernel you want to use it with (nvidia-drivers builds and installs a
kernel driver into /lib/modules/)


It's a bit more obfuscated than that.  Maybe nvidia-drivers work
different, but ati-drivers will build against /usr/src/linux but install
the actual modules in /lib/modules/running_kernel.  If /usr/src/linux
doesn't point to the running kernel, the modules will be installed in
the wrong place.



That is just so mind-bogglingly absurdly stupid I doubt if ATI should even be
allowed near a computer

Compiling code never depends on something running, it only depends on things
being present that can be linked against.

Thanks for reminding me why I insist on NVidia GPUs, I'd forgotten.


This isn't ATI's installer.  It's the ebuild that does this.




Re: [gentoo-user] Re: Kernel upgrading and linux symlink

2009-10-31 Thread Alan McKinnon
On Saturday 31 October 2009 22:03:04 Nikos Chantziaras wrote:
> > For instance, you might be running 2.6.31-r4 and also have 2.6.31-r3
> > installed. To install nvidia-drivers, you must build it twice - against
> > each kernel you want to use it with (nvidia-drivers builds and installs a
> > kernel driver into /lib/modules/)
> 
> It's a bit more obfuscated than that.  Maybe nvidia-drivers work 
> different, but ati-drivers will build against /usr/src/linux but install 
> the actual modules in /lib/modules/running_kernel.  If /usr/src/linux 
> doesn't point to the running kernel, the modules will be installed in 
> the wrong place.


That is just so mind-bogglingly absurdly stupid I doubt if ATI should even be 
allowed near a computer

Compiling code never depends on something running, it only depends on things 
being present that can be linked against.

Thanks for reminding me why I insist on NVidia GPUs, I'd forgotten.

-- 
alan dot mckinnon at gmail dot com



Re: [gentoo-user] Re: Kernel upgrading and linux symlink

2009-10-31 Thread Alan McKinnon
On Saturday 31 October 2009 22:06:35 Harry Putnam wrote:
> Alan McKinnon  writes:
> > Nikos is being kind to the document writers :-)
> 
> Thanks for saving me from the Dunce cap...hehe.
> 
> But I might yet acquire full rights to it..
> 
> So, is the symlink not really necessary?  Doe something look at
> /usr/src/linux for files?

Yes, almost every app that installs kernel drivers will go to /usr/src/linux/ 
looking for kernel sources

> For example, if you cd 'ed into the sources top dir.  And started
> `make' (after the makeconfig step), would it matter if there was a
> symlink or not?

It doesn't matter at all. There's a Makefile in that directory and it will do 
whatever it's supposed to do. The symlink to it is irrelevant and is only 
there as a shortcut with a known name


-- 
alan dot mckinnon at gmail dot com



Re: [gentoo-user] Re: Kernel upgrading and linux symlink

2009-10-31 Thread Neil Bothwick
On Sat, 31 Oct 2009 20:00:35 +0200, Nikos Chantziaras wrote:

> So, to sum it up, when you update to a new kernel, first update the 
> symlink (or let the ebuild take care of it), build the kernel, boot it, 
> *then* rebuild external modules (like ati-drivers).  If you know what 
> you're doing, you don't need to reboot before rebuilding external 
> modules, for example I do:
> 
> ebuild /usr/portage/x11-drivers/ati-drivers/ati-drivers-N.ebuild compile
> mkdir /lib/modules/KERNEL_VERSION/video
> cp 
> /var/tmp/portage/x11-drivers/ati-drivers-N/work/common/lib/modules/fglrx/build_mod/2.6.x/fglrx.ko
>  
> /lib/modules/KERNEL_VERSION/video/

I don't use ati, but with other modules, this is not necessary. As long
as /usr/srx/linux contains a valid .config, you can build modules against
that kernel without running or even compiling it.


-- 
Neil Bothwick

Thesaurus: ancient reptile with an excellent vocabulary


signature.asc
Description: PGP signature


[gentoo-user] Re: Kernel upgrading and linux symlink

2009-10-31 Thread Harry Putnam
Alan McKinnon  writes:

> Nikos is being kind to the document writers :-)

Thanks for saving me from the Dunce cap...hehe.

But I might yet acquire full rights to it..

So, is the symlink not really necessary?  Doe something look at
/usr/src/linux for files?

For example, if you cd 'ed into the sources top dir.  And started
`make' (after the makeconfig step), would it matter if there was a
symlink or not?

(In the instant case I did create the symlink looking at newest
sources, so all is well I hope... have yet to boot the creation.
Waiting on some emerging left in emerge -vuD system)




[gentoo-user] Re: Kernel upgrading and linux symlink

2009-10-31 Thread Nikos Chantziaras

On 10/31/2009 09:18 PM, Alan McKinnon wrote:

On Saturday 31 October 2009 20:09:37 Harry Putnam wrote:

Nikos Chantziaras  writes:

The link is created only if you have the "symlink" USE flag enabled.

Also, "Gentoo requires that the [...] symbolic link points to the
sources of the kernel you are running" is not entirely correct.  It is
required only when you want to build something against that
kernel.

. . . .  Obviously, you need to create the symlink if you want to build
the newly installed kernel, even though the system is still running an
older one.


Why is that obvious?  That's what seemed confusing to me.

Nothing about creating it with USE=symlin, eselect, or by hand is a
problem. Or hard to follow, and I've always just done it by hand.



Nikos is being kind to the document writers :-)

In fact, the documentation is flat out wrong - there is no requirement for the
symlink to point to the currently running kernel. It must point to the kernel
sources you want to *configure* or use for an emerge that installs a kernel
driver.

For instance, you might be running 2.6.31-r4 and also have 2.6.31-r3
installed. To install nvidia-drivers, you must build it *twice* - against each
kernel you want to use it with (nvidia-drivers builds and installs a kernel
driver into /lib/modules/)


It's a bit more obfuscated than that.  Maybe nvidia-drivers work 
different, but ati-drivers will build against /usr/src/linux but install 
the actual modules in /lib/modules/running_kernel.  If /usr/src/linux 
doesn't point to the running kernel, the modules will be installed in 
the wrong place.





Re: [gentoo-user] Re: Kernel upgrading and linux symlink

2009-10-31 Thread Alan McKinnon
On Saturday 31 October 2009 20:09:37 Harry Putnam wrote:
> Nikos Chantziaras  writes:
> > The link is created only if you have the "symlink" USE flag enabled.
> >
> > Also, "Gentoo requires that the [...] symbolic link points to the
> > sources of the kernel you are running" is not entirely correct.  It is
> > required only when you want to build something against that
> > kernel.
> >
> > . . . .  Obviously, you need to create the symlink if you want to build
> > the newly installed kernel, even though the system is still running an
> > older one.
> 
> Why is that obvious?  That's what seemed confusing to me.
> 
> Nothing about creating it with USE=symlin, eselect, or by hand is a
> problem. Or hard to follow, and I've always just done it by hand.
> 

Nikos is being kind to the document writers :-)

In fact, the documentation is flat out wrong - there is no requirement for the 
symlink to point to the currently running kernel. It must point to the kernel 
sources you want to *configure* or use for an emerge that installs a kernel 
driver.

For instance, you might be running 2.6.31-r4 and also have 2.6.31-r3 
installed. To install nvidia-drivers, you must build it *twice* - against each 
kernel you want to use it with (nvidia-drivers builds and installs a kernel 
driver into /lib/modules/)

USE="symlink" just runs 
ln -sfn /usr/src/ linux
at the end of the merge , no further magic. It's purely a convenience thing, 
you can just as easily do that step yourself


-- 
alan dot mckinnon at gmail dot com



[gentoo-user] Re: Kernel upgrading and linux symlink

2009-10-31 Thread Nikos Chantziaras

On 10/31/2009 08:09 PM, Harry Putnam wrote:

Nikos Chantziaras  writes:


The link is created only if you have the "symlink" USE flag enabled.

Also, "Gentoo requires that the [...] symbolic link points to the
sources of the kernel you are running" is not entirely correct.  It is
required only when you want to build something against that
kernel.



. . . .  Obviously, you need to create the symlink if you want to build
the newly installed kernel, even though the system is still running an
older one.


Why is that obvious?  That's what seemed confusing to me.


How obvious it is probably depends in prior knowledge here.  There's 
absolutely nothing in a running system that needs anything from 
/usr/src/linux.  If fact, you could, completely uninstall all kernel 
sources and totally wipe out /usr/src.  It's only needed when you build 
something that needs kernel sources.


Of course if you didn't know that, then yes, it's not obvious :)




[gentoo-user] Re: Kernel upgrading and linux symlink

2009-10-31 Thread Harry Putnam
Nikos Chantziaras  writes:

> The link is created only if you have the "symlink" USE flag enabled.
>
> Also, "Gentoo requires that the [...] symbolic link points to the
> sources of the kernel you are running" is not entirely correct.  It is
> required only when you want to build something against that
> kernel.

> . . . .  Obviously, you need to create the symlink if you want to build
> the newly installed kernel, even though the system is still running an
> older one.

Why is that obvious?  That's what seemed confusing to me.

Nothing about creating it with USE=symlin, eselect, or by hand is a
problem. Or hard to follow, and I've always just done it by hand.





[gentoo-user] Re: Kernel upgrading and linux symlink

2009-10-31 Thread Nikos Chantziaras

On 10/31/2009 06:52 PM, Harry Putnam wrote:

Looking at the kernel upgrade pages at
   http://www.gentoo.org/doc/en/kernel-upgrade.xml

Its a bit confusing about the symlink creation.  I've wondered about
it a few times.

At the top, you're told how to get the sources and then a discussion
of the symlink follows.

It appears you are expected to change the symlink to the newly
installed sources.

But then it says:
4.  Updating the /usr/src/linux symbolic link

   "Gentoo requires that the /usr/src/linux symbolic link points to the
   sources of the kernel you are running."

So if gentoo `requires' the symlink to point to the running kernel
why are we changing it to the newly installed but not yet compiled or
started kernel?

And in fact does it really matter if its pointing at the newly
installed or actual running kernel, when kernel compiling operations
take place?


The link is created only if you have the "symlink" USE flag enabled.

Also, "Gentoo requires that the [...] symbolic link points to the 
sources of the kernel you are running" is not entirely correct.  It is 
required only when you want to build something against that kernel. 
Obviously, you need to create the symlink if you want to build the newly 
installed kernel, even though the system is still running an older one.


And, btw, the symlink is changed easily with eselect:

  eselect kernel list

to get a list and:

  eselect kernel set N

to point the symlink to the Nth kernel.

So, to sum it up, when you update to a new kernel, first update the 
symlink (or let the ebuild take care of it), build the kernel, boot it, 
*then* rebuild external modules (like ati-drivers).  If you know what 
you're doing, you don't need to reboot before rebuilding external 
modules, for example I do:


ebuild /usr/portage/x11-drivers/ati-drivers/ati-drivers-N.ebuild compile
mkdir /lib/modules/KERNEL_VERSION/video
cp 
/var/tmp/portage/x11-drivers/ati-drivers-N/work/common/lib/modules/fglrx/build_mod/2.6.x/fglrx.ko 
/lib/modules/KERNEL_VERSION/video/


But it general, just boot the new kernel and emerge external modules 
again; safer and more straight forward.