Who is Kernel Headers ? - Questions

This is a discussion on Who is Kernel Headers ? - Questions ; Which files make up "Kernel Headers" ? Are these are part of the Kernel source tree ? I am using a from scratch Linux build, and my source code may not be located in a particular place on my system. ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Who is Kernel Headers ?

  1. Who is Kernel Headers ?

    Which files make up "Kernel Headers" ?

    Are these are part of the Kernel source tree ?

    I am using a from scratch Linux build, and my source code may not be
    located in a particular place on my system.

    How can I tell the compiler where to find the headers ?

    The package I am trying to compile is lilo-20

    I extract the source to a directory then run:

    make

    I get an error stating that the Kernel Headers are not installed.

    Thanks in advance to anyone who can help.



  2. Re: Who is Kernel Headers ?

    Mark Hobley wrote:
    > Which files make up "Kernel Headers" ?


    A lot of them.

    > Are these are part of the Kernel source tree ?


    Yes.

    > How can I tell the compiler where to find the headers ?


    -I

    Davide

    --
    | Q: Does Bill Gates use public domain software? A: Yes, as all of the
    | public has become Bill Gates' domain.

  3. Re: Who is Kernel Headers ?

    Mark Hobley wrote:
    > Which files make up "Kernel Headers" ?
    >
    > Are these are part of the Kernel source tree ?
    >
    > I am using a from scratch Linux build, and my source code may not be
    > located in a particular place on my system.
    >
    > How can I tell the compiler where to find the headers ?
    >
    > The package I am trying to compile is lilo-20
    >
    > I extract the source to a directory then run:
    >
    > make
    >
    > I get an error stating that the Kernel Headers are not installed.


    On an LFS system the kernel-headers were installed in both
    chapter 5 into the /tools/include directory and in chapter 6
    into /usr/include directory.

    The kernel-headers are the ".h" files in the
    /usr/include/{asm,asm-generic,linux} directories.

    --
    Confucius: He who play in root, eventually kill tree.
    Registered with The Linux Counter. http://counter.li.org/
    Slackware 9.1.0 Kernel 2.4.23 SMP i686 (GCC) 3.3.2
    Uptime: 11 days, 1:56, 1 user, load average: 1.04, 1.05, 1.06

  4. Re: Who is Kernel Headers ?

    Wiseguy wrote:
    >
    > do the following symlinks exist? ... create them!
    >
    > /usr/src/linux -> /usr/src/linux{currentversion}
    > /usr/include/linux -> /usr/src/linux/include/linux/


    TO QUOTE: Linux Torvalds

    I would suggest that people who compile new kernels should:

    - not have a single symbolic link in sight (except the one that
    the kernel build itself sets up, namely the "linux/include/asm"
    symlink that is only used for the internal kernel compile itself)

    And yes, this is what I do. My /usr/src/linux still has the old
    2.2.13 header files, even though I haven't run a 2.2.13 kernel
    in a _loong_time. But those headers were what Glibc was compiled
    against, so those headers are what matches the library object files.

    And this is actually what has been the suggested environment for
    at least the last five years. I don't know why the symlink
    business keeps on living on, like a bad zombie. Pretty much every
    distribution still has that broken symlink, and people still
    remember that the linux sources should go into "/usr/src/linux"
    even though that hasn't been true in a _loong_ time.

    --
    Confucius: He who play in root, eventually kill tree.
    Registered with The Linux Counter. http://counter.li.org/
    Slackware 9.1.0 Kernel 2.4.23 SMP i686 (GCC) 3.3.2
    Uptime: 11 days, 2:11, 1 user, load average: 1.08, 1.20, 1.13

  5. Re: Who is Kernel Headers ?

    In comp.os.linux.help David wrote:
    > at least the last five years. I don't know why the symlink
    > business keeps on living on, like a bad zombie. Pretty much every


    Because it's _correct_, no matter what people choose to say. Or do you
    think it was just there for no reason at all for the five years
    previously? (and it's not your five years ..). And the reason is ...

    If you don't have /usr/include/linux as a SYMLINK pointing into the
    CORRECT KERNEL source, then you can't compile any user space application
    that uses ioctls. Because ...

    The ioctls change with the kernel, not with libc. And then there are a
    whole lot of other bits and bobs that change with kernel, and not with
    libc. And I haven't changed my libc in 5 years (:- well, I use glibc
    2.1), but I change my kernel daily.

    > distribution still has that broken symlink, and people still


    Tut tut.

    Peter

  6. Re: Who is Kernel Headers ?

    Mark Hobley wrote:
    > Which files make up "Kernel Headers" ?


    All files in the kernel tree which end in .h

    > Are these are part of the Kernel source tree ?


    Well, yes, then.

    > I am using a from scratch Linux build, and my source code may not be
    > located in a particular place on my system.


    Yes it will be.
    /usr/src/linux holds the kernel tree.
    If not, you are in over your head...

    > How can I tell the compiler where to find the headers ?


    If you follow the LFS instructions *to the letter*, you won't have to.

    I would strongly advise you to use a solid guide or manual for
    installing this sort of thing until you know enough to do it on your own.

    Installing an LFS system is *not* trivial - in the sense that I could
    not do it without the documentation, and neither can you if you have
    questions like these.

    Not meant as criticism, but please... walk first, run later ;-)

  7. Re: Who is Kernel Headers ?

    On Thu, 01 Jan 2004 01:57:34 +0100, Jeroen Geilman
    wrote:

    >/usr/src/linux holds the kernel tree.
    >If not, you are in over your head...


    yeah, I know. Im actually trying to change the directory structure
    altogether.

    My source code is not at that location
    >
    >> How can I tell the compiler where to find the headers ?

    >
    >If you follow the LFS instructions *to the letter*, you won't have to.
    >


    Mines a butchered version. Its not like in the manual.

    I have a machine which has several partitions. Compiles are done in
    one partition and transferred to another partition for testing.

    I'm actually using some sort of mish-mashed hybrid.

    I started out with Debian. Then I applied some stuff from the LFS
    manual. I have changed and edited some files and moved some stuff
    around.

    I also have packages that I have compiled from source.

    Some of my linux stuff is actually stored on a network drive, This is
    downloaded and transferred to the butched machine for compilation and
    test.

    I'm actually building a totally customized system on a spare
    partition.

    The target build will not be using the standard directory layout, and
    to add further complication, the /lib stuff is being relocated.

    My mish-mashed linux has stuff moving around, and changes applied to
    try and mimic the target.

    I'm actually hoping to relocate some of the lib stuff on the target
    machine, so I'm not sure whether all this will work yet.

    It may all go bang at the end.

    (I am hoping that the kernel is written properly so that the path
    names are just a compile time parameter, or a one line code change)

    >Not meant as criticism, but please... walk first, run later ;-)


    Yeah, I know what you mean. I'm just in such an awful hurry.

    I'm actually an assembly language programmer from the MSDOS days. I am
    new to Linux, so I am having to learn everything at once.

    You guys have helped me shed loads !

    Thanks once again for all your help !

+ Reply to Thread