Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We're trying to build a piece of software that demands the kernel source, not just the headers. So we downloaded the kernel source via the centos src rpm.

However the autoconf.h is missing.

We tried

  • Put the .config in place (copied the one from /boot).

  • run make oldconfig

So what is creating the autoconf.h file? Do we actually have to build the kernel?

share|improve this question
    
In case someone is using Kconfig as build architecture for a project not related to Linux, the answer to this question is a bit different: to generate autoconf.h you need ./kconfig-frontends/frontends/conf/conf --silentoldconfig Kconfig –  Étienne Aug 14 at 15:49

1 Answer 1

up vote 4 down vote accepted

The file include/generated/autoconf.h is generated in the make prepare step. If you are trying to build a kernel module, you will also need the make scripts step:

gunzip < /proc/config.gz > .config
make oldconfig
make prepare
make scripts

Usually the kernel is accompied with a headers package, have you tried installing that first? For CentOS, try installing the kernel-devel package. Details can be found on http://wiki.centos.org/HowTos/I_need_the_Kernel_Source

share|improve this answer
    
Thanks! Yes, we had the headers package installed, but for some reasons the configure script was demanding the full source. We used the wiki page you linked. –  Stefan Jan 20 at 16:22
    
Just for completeness: on CentOS the kernel config is located in /boot (compare with uname -r to select the right one). –  Stefan Jan 20 at 16:25
1  
@Stefan On some distros (like Arch Linux) it is located in /lib/modules/$(uname -r)/build/.config (build usually symlinks to /usr/src/linux-$(uname -r)), others use /boot/config-$(uname -r) (such as Ubuntu, Debian and apparently CentOS). If enabled during compilation, it is also available from /proc/config.gz. –  Lekensteyn Jan 20 at 19:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.