[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: kernel source location



On Sat, Aug 31, 2002 at 03:40:22AM -0600, Bob Proulx wrote:
> Russell <rjshaw@iprimus.com.au> [2002-08-31 19:02:36 +1000]:

> > Do i need /usr/include/linux and /usr/include/asm ?
> 
> Yes.  Some source code will reference it.  But most importantly libc
> will reference it internally to other headers in /usr/include.
> 
> > Do they need to be the same version as the currently running kernel?
> 
> No.  Unless you are changing an program ABI the kernel is mostly
> backward compatible and therefor as long as the interface is
> compatible they don't need to match.
> 


What do you mean by `changing an program ABI'? I mean, is this the
same as modifying the type of parameters that are given or returned by
some function? Is it possible not to modify the source and still change
the ABI? If not, why they are talking about ABI in the first place?


> > (i think on other systems these are provided in the kernel source
> > directly)
> 
> That has been the traditional linux method.  But it does not have to
> be that way.  And that way has problems.  /usr/src is a source
> development area.  /usr/include is an area for installed files, not
> development files.  People doing development in /usr/src can easily
> break compilation of programs using /usr/include.
> 
> Therefore after development of files in /usr/src they are installed
> for production use in /usr/include.  At least that is one methodology.
> Rather like developing in unstable and then releasing to stable.  This
> is the default for Debian.  It makes the system more robust.
> 
> But on your system you can customize it however you like.
> 
> > I found some interesting things from
> >   http://www.opensound.com/linux-x86.html :
> > 
> >  The problem under Debian and SuSE is that the linux kernel is
> >  not installed under /usr/src/linux - so you just need to ensure
> >  that /usr/src/linux links to the directory containing the Linux
> >  kernel sources. Additionally, Debian and SuSE ships with
> >  /usr/include/linux and /usr/include/asm that are directories
> >  that are the header files that are used to build Debian or SuSE.
> >  These technically should be the header files from the kernel
> >  source tree so you really have to remove these directories and
> >  link /usr/include/linux and /usr/include/asm to the kernel
> >  source directory. Please follow the steps below. 
> > 
> >    ln -s /usr/src/linux-x.x.x /usr/src/linux (where x.x.x is the kernel version,
> >      eg: ln -s /usr/src/linux-2.2.17 /usr/src/linux)
> >    mv /usr/include/linux /usr/include/linux.orig
> >    mv /usr/include/asm /usr/include/asm.orig
> >    ln -s /usr/src/linux/include/linux /usr/include/linux
> >    ln -s /usr/src/linux/include/asm /usr/include/asm
> 
> On Debian the files in /usr/include/{asm,linux} are provided in the
> libc6-dev package.  That is the installed file location of kernel
> headers.  IIRC it follows the FHS which I believe would be violated if
> you were really pointing off to /usr/src although I will admit to not
> looking up the docs at this moment.


/usr/share/doc/kernel-package/README.headers looks to me much relevant
to this discussion.


> When I started using debian Lamont passed along these instructions to
> me on one method to rebuild the kernel.  Everyone has personal
> preferences and different users will suggest different methods.  YMMV.
> I have tweaked these instructions so any errors are my own.
> 
>   1) apt-get install kernel-source-2.4.18 kernel-package
>   2) cd /usr/src
>   3) tar xjf kernel-source-2.4.18.tar.bz2
>   4) cd kernel-source-2.4.18
>   5) cp /boot/config-whatever .config
>   6) make menuconfig or whatever...
>   7) make-kpkg --revision rwp.1 binary-arch
>   8) cd ..
>   9) dpkg -i *rwp.1_i386.deb
> 
>   s/2.4.18/current.kernel.revision/g
>   s/rwp/your-login/g
> 


Those instructions are very similar to the ones given by the
kernel-package package; Probably because this is what the 
kernel-package is expecting.


> HTH
> Bob



-- 

    Shaul Karl, shaulka@bezeqint.n e t



Reply to: