我需要在2.6内核(普通内核,而不是ubuntu内核)上进行内核开发。我正在运行Ubuntu 12.04,x86。我的第一个障碍是获得正确的gcc版本来编译2.6内核。我已经过去了,并且能够安装gcc 4.2。但是,当我尝试 make menuconfig 时,我会收到错误,其中一些我在下面发布:
/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’
我认为这是因为我正在尝试在具有版本3内核头文件的系统上编译2.6内核?
有谁知道如何在Ubuntu 12.04上编译我的普通2.6内核?
答案 0 :(得分:1)
Ubuntu并不真正使用vanilla内核,你需要修补一个vanilla内核才能将Linux源代码用于Ubuntu内核。
请参阅this link以获取完整指南。