内核编译简法

王朝other·作者佚名  2008-05-18
窄屏简体版  字體: |||超大  

具体如下:太多了,打了主要的部分。有些地方没有说明,看命令就明白了。

1、下载内核文件如:linux-2.4.18-3.tar.gz拷贝到/usr/src目录并解压缩。

# cd /usr/src

# tar zvxf linux-2.4.18-3.tar.gz

2、进入解压目录。(/usr/src/linux-2.4.18-3,视文件名而定)

# cd /usr/src/linux-2.4.18-3

# make mrproper

# make xconfig

3、进行选译,自己设定个性化的内核。完后点“save and exit”

4、进行编译。

# make dep

# make clean

# make bzImage (I要大写哟)

5、编译模块。

# make modules

# make modules_install

# depmod -a

6、编译完成,开始替换文件。

# cd /boot

# rm System.map

# rm vmlinuz

# mv /usr/src/linux-2.4.18-3/System.map System.map

# mv /usr/src/linux-2.4.18-3/arch/i386/boot/bzImage vmlinux

7.修改开机设定。

GRUB是 /boot/grub/grub.conf文件 lilo是/etc/lilo.conf文件

可以用命令

# mkinitrd /boot/initrd-2.4.18-3.img 2.4.18-3来生成initrd文件。

用GRUB来举例子说。(红色部分)

# grub.conf generated by anaconda

#

# Note that you do not have to rerun grub after making changes to this file

# NOTICE: You have a /boot partition. This means that

# all kernel and initrd paths are relative to /boot/, eg.

# root (hd0,7)

# kernel /vmlinuz-version ro root=/dev/hda10

# initrd /initrd-version.img

#boot=/dev/hda

default=1

timeout=5

splashimage=(hd0,7)/grub/splash.xpm.gz

title Red Hat Linux (2.4.18-3)

root (hd0,7)

kernel /vmlinuz-2.4.18-3 ro root=/dev/hda10

initrd /initrd-2.4.18-3.img

title win xp

rootnoverify (hd0,0)

chainloader +1

重启计算机,完工。

附加说明:

内核编译好后在以下几个位置的。

1。bzImage文件 /usr/src/linux-2.4.18-3/arch/i386/boot目录

2。外挂模块 /usr/src/linux-2.4.18-3/arch/i386/lib目录

3。已安装的模块文件 /lib/modules/2.4.18-3目录

好了就打到这儿,手都打软了,有没有稿费给我哟。找冷风肯定不行了,只有找你2位了。哈哈----

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航