DELL 2650 升级内核 with GRUB
时间:2004-12-28 来源:chenlei9907
用grub升级 linux内核 从2.4.20 到 2.4.28 。同事修改一些内核参数
1 优化内核参数
修改下列linux源文件
/usr/src/linux/include/net/tcp.h
/* Change the tcp time_out time from 15 to 5 ( 30 min time_out ) */
#define TCP_RETR2 5
/* decrease the time_wait_length from 60 sec to 20 seconds , but I don’t know where it is used in tcp*.c ,it seems no use */
#define TCP_TIMEWAIT_LEN (20*HZ)
/usr/src/linux/include/linux/limits.h
/* increase the max open files in system and per process */
#define NR_OPEN 10240
#define OPEN_MAX 8192 /* # open files a process may have */
/usr/src/linux/include/linux/fs.h
#define INR_OPEN 32768
#define NR_FILE 8192 /* this can well be larger on a larger system */
#define NR_SUPER 1024
² 编译内核
cd /usr/src/linux
make mrproper //整理源代码树, 删除源代码目录中残留的.o文件和其它从属文件。
make menuconfig
Loadable module support à Enable loadable module support == y
Processor type and features à High Memory Support = 4GB
Networking options ---> IP: TCP syncookie support (disabled per default) ==y
SCSI support ---> SCSI CD-ROM support y
SCSI support ---> SCSI low-level drivers ---> Adaptec AIC7xxx support Y
Network device support ---> Dummy net driver support == n
Ethernet (10 or 100Mbit) à Ethernet (10 or 100Mbit) == y
Ethernet (1000 Mbit) à Broadcom tigon3 support == Y
File systems à Ext3 journalling file system support == Y
File systems à JBD (ext3) debugging support == Y
Sound ---> Sound card support n
make dep //是用于检查依赖关系的, 确保关键文件在正确的位置
make bzImage //编译压缩形式的内核)
make modules
make modules_install
4 修改GRUB 红色是加入的部分,绿色是原来部分,
前提是df看看是否 “/”是sda1
#boot=/dev/sda
default=0 ß修改成,目的是用新的内核启动
timeout=10
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Red Hat Linux (2.4.28) 20041228
root (hd0,0)
kernel /boot/vmlinuz-2.4.28 ro root=/dev/sda1 hdc=ide-scsi
title Red Hat Linux (2.4.20-8smp)
root (hd0,0)
kernel /boot/vmlinuz-2.4.20-8smp ro root=LABEL=/
initrd /boot/initrd-2.4.20-8smp.img
♣ 建议,由于升级内核会因为机器的具体环境而不同,因此建议在本机用键盘操作,以便升级内核失败之后可以用回原来的内核启动