Chinaunix

标题: 新手kernel2.6.0编译升级方法 [打印本页]

作者: zhangweibo    时间: 2003-12-24 14:03
标题: 新手kernel2.6.0编译升级方法
原文地址:
http://www.5ilinux.com/kernel01.html

关键字:内核 编译 Kernel 2.6.0 make menuconfig mrproper bzImage modules_install



编译升级Kernel-2.6.0内核

终于等来2.6.0的内核正式发布,马上在自己的机器上升级一下,发现编译内核的方法更加方便了,如果你用的是GRUB的引导,那安装新内核更加方便,都不用你改什么文件。



1。下载2.6.0的内核

wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.0.tar.gz


2。在/usr/src目录下解压内核

tar zvxf /下载的路径/linux-2.6.0.tar.gz



3。配置

# make mrproper
# make menuconfig


make mrproper 是清理代码树的动作,保证源代码是干净的


4.编译

make

5。安装

make modules_install

make install



看来2。6的编译确实比以前方便多了,以前的make bzImage make modules等步骤都在make一步都搞定,以前还要cp 内核和System.map,修改Grub.conf的步骤,统统make install搞定,方便吧



如果你放心,你可以去/boot目录看看是否已经有最新的vlinuz-2.6.0和System.map-2.6.0还有grub.conf是否已经给你自动配置好了



ok,reboot机器

哈哈,去领略2.6内核的魅力吧,enjoy it



附:(常见错误)

1.启后出现一句错误提示后就死锁了:
kernel panic : no init found ,try passing init = option to kernel.............

解决办法:注意如果你的系统一开始是ext3格式,最好直接把ext3文件系统编译进内核,而不要以模块的加载,否则启动将报类似的错误

2.下列驱动程序你最好直接编译进内核,不要以模块加载,否则不能正常加载
(不断更新)

网卡:
8139   这个网卡太普遍了,应该会有很多朋友碰到这个问题

显卡:
intel 845    我估计810也有可能,810主板的朋友实验一下

USB
LG的usb鼠标






张微波
2003年12月24日中午
作者: yulc    时间: 2003-12-24 14:06
标题: 新手kernel2.6.0编译升级方法
补充一下:
网卡也要在编译到内核中去,模块形式不能启动网卡。
12.24中午1点亲身测试得来。
作者: zhangweibo    时间: 2003-12-24 14:08
标题: 新手kernel2.6.0编译升级方法
原帖由 "yulc" 发表:
补充一下:
网卡也要在编译到内核中去,模块形式不能启动网卡。
12.24中午1点亲身测试得来。


不一定哦,我的网卡就是以模块加载的,没有编译进去
作者: yulc    时间: 2003-12-24 14:10
标题: 新手kernel2.6.0编译升级方法
那就不知道了。
你是什么环境?

我是AS3.0上编译 2.6.0内核
8139的网卡
作者: zhangweibo    时间: 2003-12-24 14:14
标题: 新手kernel2.6.0编译升级方法
我是在Fedora Core 1上编译的
网卡是Broadcom 440x,由于网卡太新
2.4的内核还不支持我的网卡,没想到2.6支持了
作者: 好好先生    时间: 2003-12-24 14:16
标题: 新手kernel2.6.0编译升级方法
8139的网卡有点特殊吧?直接编译rh8,rh9自带的内核,如果编译时不选择一下,它也不能用.
作者: 双眼皮的猪    时间: 2003-12-24 14:24
标题: 新手kernel2.6.0编译升级方法
恩,谢谢楼主,我今天也下载了as3,编译了2.6的内核,还好,奇怪的是,我在as3上发现比rh9上机器要快些,浏览网页很爽...纳闷呢....
不知道是mozilla快了,还是系统快了....
不知道Fedora Core 1怎么样....呵呵....
作者: zhangweibo    时间: 2003-12-24 14:57
标题: 新手kernel2.6.0编译升级方法
原帖由 "双眼皮的猪" 发表:
恩,谢谢楼主,我今天也下载了as3,编译了2.6的内核,还好,奇怪的是,我在as3上发现比rh9上机器要快些,浏览网页很爽...纳闷呢....
不知道是mozilla快了,还是系统快了....
不知道Fedora Core 1怎么样....呵呵....


我也觉得特快,不知是不是心里作用,不过肯定比我的xp+ie6快多了,一点都不拖泥带水
作者: zhangweibo    时间: 2003-12-24 15:18
标题: 新手kernel2.6.0编译升级方法
看来我的显卡也不能以模块的方式加载,怪了,害的我编译了好多次

现在知道的一些驱动是必须编译进内核的有

网卡:
8139

显卡
Intel 845
作者: 好好先生    时间: 2003-12-24 15:21
标题: 新手kernel2.6.0编译升级方法
楼主,我想把你这个贴子置顶,让大家讨论讨论这个2.6的内核编译.可以吗?这一段时间,这个问题是热门.
作者: zhangweibo    时间: 2003-12-24 15:24
标题: 新手kernel2.6.0编译升级方法
那感情好,大家可以把编译的过程中碰到的问题汇总一下,特别是那些驱动必须编译进内核等.....

省得大家走弯路
作者: 好好先生    时间: 2003-12-24 15:30
标题: 新手kernel2.6.0编译升级方法
鉴于近期编译2.6内核的讨论比较多,特设此贴.对此问题有什么见解,什么看法,欢迎在此跟贴讨论.
作者: mb    时间: 2003-12-24 15:37
标题: 新手kernel2.6.0编译升级方法
iptables -L 如下提示:

iptables v1.2.6 ;can`t initialize iptables table 'filter': iptables who?
(do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

为什么会这样,怎样才能支持我的iptables呢
作者: 双眼皮的猪    时间: 2003-12-24 15:40
标题: 新手kernel2.6.0编译升级方法
恩,我的网卡dfe530tx也不支持了...是不是kernel有什么改变呢?
作者: yulc    时间: 2003-12-24 16:03
标题: 新手kernel2.6.0编译升级方法
期待iptables 的新动向呀。
今天没时间弄了,明天继续研究。

我一定,一定要在2.6.0上面运行好iptables.
各位,等我的好消息。
作者: mb    时间: 2003-12-24 16:06
标题: 新手kernel2.6.0编译升级方法
好,期待
作者: yulc    时间: 2003-12-24 16:53
标题: 新手kernel2.6.0编译升级方法
搞定了。。。
已发贴,有什么问题就说呀。
作者: haohaoo    时间: 2003-12-26 13:16
标题: 新手kernel2.6.0编译升级方法
怎么将网卡等直接编译进去,不要动态加载?
作者: shuecy    时间: 2003-12-26 14:19
标题: 新手kernel2.6.0编译升级方法
需要编译进内核的,就选择,然后确定.
在 make 这步里面就会自动编译进内核.

bw:我也没用过,不过刚才我这么做了,而且已经成功了.
作者: dgvri    时间: 2004-01-07 11:03
标题: 新手kernel2.6.0编译升级方法
我打完 make menuconfig 后,最后出来个列表,这是做什么用的?下一步如何做?在线等。

Code maturity level options  --->;                                        x x
  x x                           General setup  --->;                                                      x x
  x x                           Loadable module support  --->;                                            x x
  x x                           Processor type and features  --->;                                        x x
  x x                           Power management options (ACPI, APM)  --->;                               x x
  x x                           Bus options (PCI, PCMCIA, EISA, MCA, ISA)  --->;                          x x
  x x                           Executable file formats  --->;                                            x x
  x x                           Device Drivers  --->;                                                     x x
  x x                           File systems  --->;                                                       x x
  x x                           Profiling support  --->;                                                  x x
  x x                           Kernel hacking  --->;                                                     x x
  x x                           Security options  --->;                                                   x x
  x x                           Cryptographic options  --->;                                              x x
  x x                           Library routines  --->;                                                   x x
  x x                       ---                                                                          x x
  x x                           Load an Alternate Configuration File                                     x x
  x x                           Save Configuration to an Alternate File
作者: 双眼皮的猪    时间: 2004-01-07 11:12
标题: 新手kernel2.6.0编译升级方法
建议去学点基础知识再来发问,谢谢...
作者: dgvri    时间: 2004-01-07 11:17
标题: 新手kernel2.6.0编译升级方法
已经做完了,谢谢。刚才没仔细看。
作者: zhlchen    时间: 2004-01-07 11:20
标题: 新手kernel2.6.0编译升级方法
不解,为什么我在执行make mrproper口令是提示
make: *** No rule to make target `mrproper'.  Stop.
是怎么回事讷?我是rh9系统
作者: 双眼皮的猪    时间: 2004-01-07 11:26
标题: 新手kernel2.6.0编译升级方法
请确认您在正确的文件夹里make ,在进入该文件夹后直接ls看一下...看你安装的时候是否选择了开发工具等啥的...
作者: dgvri    时间: 2004-01-07 12:07
标题: 新手kernel2.6.0编译升级方法
出问题了,求救,完成后用新的内核启动,启动到出现如下提示就不走了:
Kernel panic:No init fount. Try passing initption to kernel
怎么解决?请指点。
作者: zhlchen    时间: 2004-01-07 12:08
标题: 新手kernel2.6.0编译升级方法
请问我要到哪个文件夹下面去make?
作者: zhangweibo    时间: 2004-01-07 12:11
标题: 新手kernel2.6.0编译升级方法
原帖由 "dgvri" 发表:
出问题了,求救,完成后用新的内核启动,启动到出现如下提示就不走了:
Kernel panic:No init fount. Try passing initption to kernel
怎么解决?请指点。



我不是付了常见错误说明吗
作者: zhangweibo    时间: 2004-01-07 12:12
标题: 新手kernel2.6.0编译升级方法
[quote]原帖由 "zhlchen"]请问我要到哪个文件夹下面去make?[/quote 发表:


一般在
/usr/src/linux
作者: dgvri    时间: 2004-01-07 12:13
标题: 新手kernel2.6.0编译升级方法
拷,我瞎了。
作者: dgvri    时间: 2004-01-07 12:15
标题: 新手kernel2.6.0编译升级方法
如果重新再编还行吗?
是不是在选择的那步,直接把ext3文件系统选择上?
谢谢。我是个新手。
作者: zhangweibo    时间: 2004-01-07 12:32
标题: 新手kernel2.6.0编译升级方法
选择以后,要重新编译
作者: dgvri    时间: 2004-01-07 12:45
标题: 新手kernel2.6.0编译升级方法
是执行:make menuconfig 后出现列表,选择后,再执行make menuconfig ,还是直接执行下面的make?
作者: dgvri    时间: 2004-01-07 14:06
标题: 新手kernel2.6.0编译升级方法
不行呀,我重新编译了,把EXT2和EXT3的都选取上了,完了还是上面的提示?这是为什么呀?
作者: lyking    时间: 2004-01-07 14:28
标题: 新手kernel2.6.0编译升级方法
要让ext3编译进内核,编译完成后重新安装make install,再检查一下initrd是否创建成功。
作者: dgvri    时间: 2004-01-07 14:36
标题: 新手kernel2.6.0编译升级方法
“要让ext3编译进内核”,这一句看不明白?
作者: lyking    时间: 2004-01-07 14:41
标题: 新手kernel2.6.0编译升级方法
*:代表编译到内核
M:代表模块方式

你的/如果是用ext3格式化的,就要把ext3文件系统编译进内核。
作者: lyking    时间: 2004-01-07 14:53
标题: 新手kernel2.6.0编译升级方法
另外问题,我的2.6编译并安装后,发现rpm不能正常使用,如果用原来的2.4.20内核启动就没问题,有没有人碰到过?
http://bbs.chinaunix.net/forum/viewtopic.php?t=237230&highlight=lyking
作者: dgvri    时间: 2004-01-07 15:01
标题: 新手kernel2.6.0编译升级方法
谢谢,正在试。
作者: cniis    时间: 2004-02-18 11:02
标题: 新手kernel2.6.0编译升级方法
我的系统是redhat9,CIII,300SDRAM内存.
下载了linux-2.6.2.tar.bz2
解开后,
从晚上12点开始
# make mrproper
# make menuconfig
到了 make menuconfig ,实在太多看不懂.不知道哪些应该选择.湖乱选了一通.
之后 make .似乎要很久,于是去睡觉.到4点钟起来,已经不知道什么时候完成了.呵呵.之后
make modules_install

make install
都很快.之后 reboot .发现grub多了一项启动 2.6.2 的.于是启动这个,启动过程发现很多失败的.启动完之后,倒是正常.但不能上网,查看知道是网卡没有被激活.也不能激活.

我想今天回去后再试一下编译2.6.2内核.不知道这个东西还能继续编译的么?如果能.则上一次的编译是否被替换?
作者: dylibin    时间: 2004-03-11 20:44
标题: 新手kernel2.6.0编译升级方法
要不要安装 module-init-tools 和 modutils呀??
作者: 水若寒    时间: 2004-12-01 12:07
标题: 新手kernel2.6.0编译升级方法
出现如下提示是什么原因?


  1. [root@yf165 linux-2.6.9]# make mrproper
  2. [root@yf165 linux-2.6.9]# make menuconfig
  3.   HOSTCC  scripts/basic/fixdep
  4.   HOSTCC  scripts/basic/split-include
  5.   HOSTCC  scripts/basic/docproc
  6.   SHIPPED scripts/kconfig/zconf.tab.h
  7.   HOSTCC  scripts/kconfig/conf.o
  8.   HOSTCC  scripts/kconfig/mconf.o
  9.   SHIPPED scripts/kconfig/zconf.tab.c
  10.   SHIPPED scripts/kconfig/lex.zconf.c
  11.   HOSTCC  -fPIC scripts/kconfig/zconf.tab.o
  12.   HOSTLLD -shared scripts/kconfig/libkconfig.so
  13.   HOSTLD  scripts/kconfig/mconf
  14.   HOSTCC  scripts/lxdialog/checklist.o
  15. In file included from scripts/lxdialog/checklist.c:24:
  16. scripts/lxdialog/dialog.h:29:20: curses.h: No such file or directory
  17. In file included from scripts/lxdialog/checklist.c:24:
  18. scripts/lxdialog/dialog.h:127: syntax error before "use_colors"
  19. scripts/lxdialog/dialog.h:127: warning: type defaults to `int' in declaration of `use_colors'
  20. scripts/lxdialog/dialog.h:127: warning: data definition has no type or storage class
  21. scripts/lxdialog/dialog.h:128: syntax error before "use_shadow"
  22. scripts/lxdialog/dialog.h:128: warning: type defaults to `int' in declaration of `use_shadow'
  23. scripts/lxdialog/dialog.h:128: warning: data definition has no type or storage class
  24. scripts/lxdialog/dialog.h:130: syntax error before "attributes"
  25. scripts/lxdialog/dialog.h:130: warning: type defaults to `int' in declaration of `attributes'
  26. scripts/lxdialog/dialog.h:130: warning: data definition has no type or storage class
  27. scripts/lxdialog/dialog.h:143: syntax error before '*' token
  28. scripts/lxdialog/dialog.h:143: warning: function declaration isn't a prototype
  29. scripts/lxdialog/dialog.h:146: syntax error before '*' token
  30. scripts/lxdialog/dialog.h:146: warning: function declaration isn't a prototype
  31. scripts/lxdialog/dialog.h:147: syntax error before '*' token
  32. scripts/lxdialog/dialog.h:147: warning: function declaration isn't a prototype
  33. scripts/lxdialog/dialog.h:148: syntax error before '*' token
  34. scripts/lxdialog/dialog.h:149: warning: function declaration isn't a prototype
  35. scripts/lxdialog/dialog.h:150: syntax error before '*' token
  36. scripts/lxdialog/dialog.h:150: warning: function declaration isn't a prototype
  37. scripts/lxdialog/checklist.c:32: syntax error before '*' token
  38. scripts/lxdialog/checklist.c:34: warning: function declaration isn't a prototype
  39. scripts/lxdialog/checklist.c: In function `print_item':
  40. scripts/lxdialog/checklist.c:38: warning: implicit declaration of function `wattrset'
  41. scripts/lxdialog/checklist.c:38: `win' undeclared (first use in this function)
  42. scripts/lxdialog/checklist.c:38: (Each undeclared identifier is reported only once
  43. scripts/lxdialog/checklist.c:38: for each function it appears in.)
  44. scripts/lxdialog/checklist.c:39: warning: implicit declaration of function `wmove'
  45. scripts/lxdialog/checklist.c:39: `choice' undeclared (first use in this function)
  46. scripts/lxdialog/checklist.c:41: warning: implicit declaration of function `waddch'
  47. scripts/lxdialog/checklist.c:44: `selected' undeclared (first use in this function)
  48. scripts/lxdialog/checklist.c:46: warning: implicit declaration of function `wprintw'
  49. scripts/lxdialog/checklist.c:46: `status' undeclared (first use in this function)
  50. scripts/lxdialog/checklist.c:51: warning: implicit declaration of function `mvwaddch'
  51. scripts/lxdialog/checklist.c:51: `item' undeclared (first use in this function)
  52. scripts/lxdialog/checklist.c:53: warning: implicit declaration of function `waddstr'
  53. scripts/lxdialog/checklist.c:56: warning: implicit declaration of function `wrefresh'
  54. scripts/lxdialog/checklist.c: At top level:
  55. scripts/lxdialog/checklist.c:64: syntax error before '*' token
  56. scripts/lxdialog/checklist.c:66: warning: function declaration isn't a prototype
  57. scripts/lxdialog/checklist.c: In function `print_arrows':
  58. scripts/lxdialog/checklist.c:67: `win' undeclared (first use in this function)
  59. scripts/lxdialog/checklist.c:67: `y' undeclared (first use in this function)
  60. scripts/lxdialog/checklist.c:67: `x' undeclared (first use in this function)
  61. scripts/lxdialog/checklist.c:69: `scroll' undeclared (first use in this function)
  62. scripts/lxdialog/checklist.c:82: `height' undeclared (first use in this function)
  63. scripts/lxdialog/checklist.c:85: `item_no' undeclared (first use in this function)
  64. scripts/lxdialog/checklist.c:85: `choice' undeclared (first use in this function)
  65. scripts/lxdialog/checklist.c: At top level:
  66. scripts/lxdialog/checklist.c:103: syntax error before '*' token
  67. scripts/lxdialog/checklist.c:104: warning: function declaration isn't a prototype
  68. scripts/lxdialog/checklist.c: In function `print_buttons':
  69. scripts/lxdialog/checklist.c:105: `width' undeclared (first use in this function)
  70. scripts/lxdialog/checklist.c:106: `height' undeclared (first use in this function)
  71. scripts/lxdialog/checklist.c:108: `dialog' undeclared (first use in this function)
  72. scripts/lxdialog/checklist.c:108: `selected' undeclared (first use in this function)
  73. scripts/lxdialog/checklist.c: In function `dialog_checklist':
  74. scripts/lxdialog/checklist.c:126: `WINDOW' undeclared (first use in this function)
  75. scripts/lxdialog/checklist.c:126: `dialog' undeclared (first use in this function)
  76. scripts/lxdialog/checklist.c:126: `list' undeclared (first use in this function)
  77. scripts/lxdialog/checklist.c:126: warning: left-hand operand of comma expression has no effect
  78. scripts/lxdialog/checklist.c:132: warning: implicit declaration of function `endwin'
  79. scripts/lxdialog/checklist.c:133: warning: implicit declaration of function `fprintf'
  80. scripts/lxdialog/checklist.c:133: `stderr' undeclared (first use in this function)
  81. scripts/lxdialog/checklist.c:150: `COLS' undeclared (first use in this function)
  82. scripts/lxdialog/checklist.c:151: `LINES' undeclared (first use in this function)
  83. scripts/lxdialog/checklist.c:153: `stdscr' undeclared (first use in this function)
  84. scripts/lxdialog/checklist.c:155: warning: implicit declaration of function `newwin'
  85. scripts/lxdialog/checklist.c:156: warning: implicit declaration of function `keypad'
  86. scripts/lxdialog/checklist.c:156: `TRUE' undeclared (first use in this function)
  87. scripts/lxdialog/checklist.c:189: warning: implicit declaration of function `subwin'
  88. scripts/lxdialog/checklist.c:221: warning: implicit declaration of function `wnoutrefresh'
  89. scripts/lxdialog/checklist.c:223: warning: implicit declaration of function `doupdate'
  90. scripts/lxdialog/checklist.c:226: warning: implicit declaration of function `wgetch'
  91. scripts/lxdialog/checklist.c:233: `KEY_UP' undeclared (first use in this function)
  92. scripts/lxdialog/checklist.c:233: `KEY_DOWN' undeclared (first use in this function)
  93. scripts/lxdialog/checklist.c:243: `FALSE' undeclared (first use in this function)
  94. scripts/lxdialog/checklist.c:244: warning: implicit declaration of function `scrollok'
  95. scripts/lxdialog/checklist.c:245: warning: implicit declaration of function `wscrl'
  96. scripts/lxdialog/checklist.c:272: called object is not a function
  97. scripts/lxdialog/checklist.c:308: warning: implicit declaration of function `delwin'
  98. scripts/lxdialog/checklist.c:312: `KEY_LEFT' undeclared (first use in this function)
  99. scripts/lxdialog/checklist.c:313: `KEY_RIGHT' undeclared (first use in this function)
  100. /usr/include/bits/string2.h: At top level:
  101. scripts/lxdialog/dialog.h:130: warning: array `attributes' assumed to have one element
  102. make[2]: *** [scripts/lxdialog/checklist.o] Error 1
  103. make[1]: *** [menuconfig] Error 2
  104. make: *** [menuconfig] Error 2
  105. [root@yf165 linux-2.6.9]#

复制代码





欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2