Chinaunix首页 | 论坛 | 博客
  • 博客访问: 527070
  • 博文数量: 120
  • 博客积分: 3030
  • 博客等级: 中校
  • 技术积分: 1445
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-05 01:00
文章存档

2011年(1)

2009年(2)

2008年(32)

2007年(33)

2006年(52)

我的朋友

分类: LINUX

2009-09-11 12:53:07

软件环境:
主系统:XP系统
主系统安装:Thunder5.8.7.625.exe(用于下载文件),FlashFXP_3.6.0.1240_SC.exe(FTP工具),UltraEdit_11.10b_SC.exe(在windows下查看linux下的文件)
虚拟机软件版本:VMware server 1.0.6
虚拟机内安装的操作系统:Linux 2.4.20-8 (Red Hat)

需要下载的文件:
linux-2.4.30.tar.gz
下载地址:


1、重新编译内核。
下载Linux内核,版本号为2.4.30,解压缩后置于/usr/src/linux目录下。
具体步骤如下:
a、从网站下载内核(linux-2.4.30.tar.gz)

b、启动虚拟机

c、通过网络访问或共享文件夹方式,将linux-2.4.30.tar.gz拷贝到Linux系统下
共享文件在/mnt/hgfs目录下。

d、解压内核
# cp linux-2.4.30.tar.gz /usr/src
# cd /usr/src
# tar -zxvf linux-2.4.30.tar.gz
# rm –rf linux 
# ln -s linux-2.4.30 linux
# cd linux

e、编译内核
# cd /usr/src/linux
# make mrproper (该命令可确保源代码目录下没有不正确的.o文件)
# make menuconfig (配置内核各选项)


Code maturity level options --->
[*]Prompt for development and/or incomplete code/drivers

Block devices --->
<*> RAM disk support
Default Ramdisk的大小应为1024的整数倍。默认值为4096,我们改为12288

SCSI support --->
<*> SCSI support ; SCSI low-level drviers --->
<*>BusLogic SCSI support

Network device support ---> Ethernet (10 or 100Mbit)--->
<*> Ethernet (10 or 100Mbit)
<*> AMDPCInet32

File systems--->
<*> Ext3 journalling file system support (EXPERIMEN-TAL);
<*> Second extended fs support

  上面,带*号的为必选项。

# make dep (建立编译时所需的从属文件。注意:如果内核从未编译过,此步可跳过)
# make clean  (清除内核编译的目标文件。注意:如果内核从未编译过,此步可跳过)
# make bzImage  (注意大小写。这一步才是真正编译内核)
内核编译成功后,会在/usr/src/linux/arch/i386/boot目录中生成一个新内核的映像文件bzImage。如果用 make  zImage编译,内核很大的话,系统会提示你使用make  bzImage命令来编译,所以我直接用make bzImage来编译。
# make modules
# make modules_install
# make install

You may find an error message "No module BusLogic found for kernel 2.4.30".
If this message occurs, don't be frustrated! See step follows.
Make up the mistakes or errors.

# mkinitrd --omit-scsi-modules /boot/initrd-2.4.20-8.img 2.4.30
# cp /usr/src/linux-2.4.30/arch/i386/boot/bzImage /boot/vmlinuz-2.4.30
# cp /usr/src/linux-2.4.30/System.map /boot/System.map-2.4.30
# cd /etc/
# grub-install /dev/sda
You will see that your new kernel is on the list.
# gedit /etc/modules.conf

将"alias scsi hostadapter BusLogic"这行注释掉,
即#alias scsi hostadapter BusLogic
保存 /etc/modules.conf,退出


# cd /usr/src/linux
# make install


# gedit /boot/grub/grub.conf
Grub.conf中"root=LABEL=/"改为"root=/dev/sda1"

运行新内核之前,请检查一下/boot/grub/grub.conf的内容,下面的配置可作参考

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,0)
#          kernel /boot/vmlinuz-version ro root=/dev/sda1
#          initrd /boot/initrd-version.img
#boot=/dev/sda
default=1
timeout=10
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Red Hat Linux (2.4.30)
root (hd0,0)
kernel /boot/vmlinuz-2.4.30 ro root=/dev/sda1
initrd /boot/initrd-2.4.30.img
title Red Hat Linux (2.4.20-8)
root (hd0,0)
kernel /boot/vmlinuz-2.4.20-8 ro root=LABEL=/
initrd /boot/initrd-2.4.20-8.img


# reboot

如果现在重启就会出现:
错误:VFS:cannot open root device "XXXX"or 00:00
错误的解决办法是:
将Grub.conf中"root=LABEL=/"改为"root=/dev/sda1"。

重新启动系统,在启动时选择新的内核。

来源于网络,回归于网络。
我的邮箱:happy.every.day@126.com QQ:48399956
快乐!
2009年8月23日
阅读(5743) | 评论(1) | 转发(1) |
给主人留下些什么吧!~~

chinaunix网友2009-09-14 12:35:10

内核中基于netfilter的编译选项 在内核配置文件中要启用一些较要的选项包括Netfilter连接跟踪、日志记录和包过滤。iptables 是通过使用由Netfilter提供的内核中的框架来建立一个策略的。 对于2.6系列的内核来说,大多数的Netfilter编译选项都位于Networking-->Networking Options下的Network Packet Filtering Framework一节中。在Network Packet Filtering Framework中还有两个额外的配置节--Core Netfilter Configuration(核心Netfilter配置)和IP:Netfilter Configuration (IP:Netfilter配置)。 1、核心Netfilter配置(如下的重要选项应该被启用) Comment match support (Comment 匹配支持) FTP support (FTP协议支持) Length mat