blog » linux常用技巧 » linux内核编译笔记

linux内核编译笔记

操作环境

系统:CentOS4.3

内核:2.6.9-34.EL

新内核版本2.6.17
编译
2.6的内核编译操作
# make menuconfig
# make
# make modules_install
# make install

注:
以前2.4的内核编译操作

# make modules
# make modules_install
# make install
# cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.17

# cp System.map /boot/System.map-2.6.17

# mkinitrd ……
# ln -s /boot/vmlinuz-2.6.7 /boot/vmlinuz
# ln -s /boot/System.map-2.6.7 /boot/System.map
#vim /boot/grub/menu.lst常见问题
1.错误提示:Enforcing mode requested but no policy loaded
因为系统启用了selinux的enforcing模式,需要回到原来的系统关闭selinux,如果不需要selinux,可以编内核的时候就去掉。

2.错误提示:VFS:Unable to mount root fs on unknown-block(0,0)
确保以下两项被编进内核
Device Drivers ---> Block devices --->
<*> RAM disk support
[*] Initial RAM disk (initrd) support
3.启动错误提示:
mkrootdev:lable /1 not found
mount:error 2 mounting ext3
mount:error 2 mounting none
switchroot:mount failed:22
Umount /initrd/dev failed:2
需要以下驱动支持:
Device Drivers ---> ATA/ATAPI/MFM/RLL support ---> [*] PCI IDE chipset support

4.错误提示:

Enforcing mode requested but no policy loaded. Halting now.
kernel panic - not syncing: Attenpted to kill init!

编缉/etc/grub/grup.conf

title CentOS (2.6.17)
root (hd0,0)
kernel /vmlinuz-2.6.17 ro root=LABEL=/ enforcing=0
initrd /initrd-2.6.17.img
在后面加入enforcing=0

RSS 2.0 | leave a response | trackback

17fav 收藏本文

One Response

  1. 9 20th, 2008 / 14:58 crorts Says:

    这编译的事完全不明白,我刚接触LINUX ,有空请赐教~

Leave a Reply

收藏 & 分享

Powered by 17fav.com