Justin Kredible
Justin Kredible

Reputation: 8414

Compile 2.6 kernel on Ubuntu 12.04

I need to do kernel development on a 2.6 kernel (plain kernel, not ubuntu kernel). I'm running Ubuntu 12.04, x86. My first obstacle was getting the right gcc version to compile the 2.6 kernel. I've gotten past that and was able to get gcc 4.2 installed. However, when I try doing make menuconfig I get errors, some of which I've posted below:

/usr/include/arpa/inet.h:38: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘inet_lnaof’
/usr/include/arpa/inet.h:42: error: expected ‘)’ before ‘__net’
/usr/include/arpa/inet.h:46: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘inet_netof’
/usr/include/arpa/inet.h:50: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘inet_network’
/usr/include/arpa/inet.h:54: error: storage class specified for parameter ‘inet_ntoa’
/usr/include/arpa/inet.h:60: error: storage class specified for parameter ‘inet_pton’
/usr/include/arpa/inet.h:66: error: expected declaration specifiers or ‘...’ before ‘socklen_t’
/usr/include/arpa/inet.h:67: error: storage class specified for parameter ‘inet_ntop’
/usr/include/arpa/inet.h:74: error: storage class specified for parameter ‘inet_aton’
/usr/include/arpa/inet.h:78: error: expected ‘)’ before ‘__net’
/usr/include/arpa/inet.h:84: error: storage class specified for parameter ‘inet_net_ntop’
/usr/include/arpa/inet.h:90: error: storage class specified for parameter ‘inet_net_pton’
/usr/include/arpa/inet.h:96: error: storage class specified for parameter ‘inet_nsap_addr’
/usr/include/arpa/inet.h:101: error: storage class specified for parameter ‘inet_nsap_ntoa’
/usr/include/arpa/inet.h:104: error: expected declaration specifiers before ‘__END_DECLS’

I assume this is due to the fact that I'm trying to compile a 2.6 kernel on a system with version 3 kernel headers?

Does anyone know how I can compile my plain 2.6 kernel on Ubuntu 12.04?

Upvotes: 1

Views: 2058

Answers (1)

user1797612
user1797612

Reputation: 832

Ubuntu do not really use a vanilla kernel, you need to patch a vanilla kernel to be able to use the linux source for an Ubuntu kernel.

refer to this link for a complete guide.

Upvotes: 1

Related Questions