Re: kernel headers from vanilla kernel compilation




John-Paul Stewart wrote:
Tom Forsmo wrote:
When using kernels from linux distributions there are usually a kernel package and a kernel-headers package which are be installed.
But when compiling the a vanilla kernel, there are no instructions in the readme file on how to install the headers. How can this be done

Which "kernel headers" are you referring to? On most distros there are two types of of "kernel header" packages available.
....
Then (on Debian, at least) there is also a linux-kernel-headers package that contains the headers from /usr/include/linux and /usr/include/asm. You need these headers (and hence this package) to build user space programs. Those directories used to be symlinks to the live kernel headers under /usr/src/linux but this no longer recommended. You need your distro's package for these "kernel headers" regardless of what kernel version you're currently running.

It makes sense now. I was not aware that the headers were from different packages. So that means the headers in /usr/include must be compatible with the glibc version and package.

I would assume that truecrypt is a user space program (not a kernel module), so you need the second type of "kernel headers". Install your distribution's packaged headers. (Note that the package name may not be "kernel headers" at all. Those might be in a glibc-devel package or something.)

its both a kernel module and a userspace program. But I have managed to make the kernel module compile without problems, so the problem now lies with the userspace program

The BYTE_ORDER macro you mention is defined in /usr/include/endian.h which should be in the same package as the other basic glibc headers, not the "kernel headers" of any sort.

The program seems to include its own endian.h file, which might override the /usr/include/endian.h. I am not sure whats going on here, but there seems to be either some conflict or that the truecrypt local endian.h file are missing something it expects from the system version.

Maybe this problem is distribution dependant, because different distributions contains different glibc version and mine just does not contain the version of glibc headers truecrypt needs. So the remedy might seem to be finding out why the local endian.h does not define BYTE_ORDER and what else might be missing compared to the system/glibc version of endian.h Would that be a correct analysis?

Below is the output from the compilation:

[root@duplo Linux]# ./build.sh
Building truecrypt... Compiling Aescrypt.c
cc -w -I../../Crypto -I../../Common -I../Kernel -I/usr/include -D_cdecl="" -DBOOL=int -DTRUE=1 -DFALSE=0 -DMAX_PATH=260 -D__int8="char" -D__int16="short" -D__int32="int" -D__int64="long long" -O2 -fno-strict-aliasing -MMD -o ../../Crypto/Aescrypt.o -c .../../Crypto/Aescrypt.c
In file included from ../../Crypto/Aesopt.h:144,
from ../../Crypto/Aescrypt.c:33:
.../../Common/Endian.h:43:5: error: #error Byte order cannot be determined (BYTE_ORDER undefined)
make: *** [../../Crypto/Aescrypt.o] Error 1
Error: Failed to build truecrypt



regards

tom
.



Relevant Pages

  • Re: VMWare Server and Kernel? [signed]
    ... you have installed, not the source package. ... have the configured headers specific to that kernel image and will ... require you to just go ahead and re-compile your kernel. ...
    (Debian-User)
  • Re: pros/cons of installing from source
    ... Debian supply both optimised kernels and to a lesser degree ... Doing a full emerge of the kernel source (inside the ... really required and what is not for a package (this requires the most ... soon as it stopped compiling and installing. ...
    (Debian-User)
  • Re: strange insmod problem
    ... > headers instead of kernel mode headers. ... > version you are using was compiled using 2.4.9 kernel headers. ... Stock kernel sources do not have the EXTRAVERSION set. ... you are compiling a kernel with the same version number as your ...
    (comp.os.linux.development.system)
  • Re: building 2.6.35
    ... I did trying using the packages for 2.6.35, but you can't install the ... Why do you want to install the headers if you already have the whole ... building a custom kernel? ... A Debian source package for 2.6.35 is also ...
    (Debian-User)
  • Re: How to use kernel-2.6.6-1.435.src.rpm
    ... Untarring, patching, configuring, compiling, ... if you just want to build a new kernel from source the package ... The kernel-*.src.rpm is meant for building a binary kernel package. ...
    (Fedora)