LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 750|回复: 2

新手急求助安装kernel-2.6.15-1.2054_FC5.src.rpm 重启不可运行的问题

[复制链接]
发表于 2006-6-14 21:15:22 | 显示全部楼层 |阅读模式
为了 运行 《linux设备驱动程序第三版》第二章中那个示例模块,我在我的AMD64机上安装了 2.6.15-1.2054_FC5 x86_64,然后又按照下面的帖子 编译了kernel-2.6.15-1.2054_FC5.src.rpm
1.确定安装了GCC与RPM相关的包。
2.安装相应的内核源代码,因为FC5本身没有提供相应的源码包在安装盘上,所以要在官方网站上下载,网址如下。
http://download.fedora.redhat.co ... -1.2054_FC5.src.rpm
也可以从www.kernel.org上下载到相应 ... 这个,怕Fedora 5发行版的和这个有点差别)
3.编译内核源码:
[root@sunshine srpms]#rpm –Uvh kernel-2.6.15-1.2054_FC5.src.rpm
[root@sunshine srpms]#cd /usr/src/redhat/SPECS
[root@sunshine SPECS]#rpmbuild  -bp --target $(uname -m) kernel-2.6.spec
[root@sunshine SPECS]# ls /usr/src/redhat/BUILD/kernel-2.6.15/
Config.mk  linux-2.6.15.i686  vanilla  xen  xen-vanilla (有可能是i586我的是i686)
[root@sunshine SPECS]# cd /usr/src
[root@sunshine src]#mkdir kernels (默认的安装是没有kernels这个文件夹)
[root@sunshine src]# ls -l /lib/modules/2.6.15-1.2054_FC5/
总计 1152
lrwxrwxrwx  1 root root     47 04-29 12:08 build -> ../../../usr/src/kernels/2.6.1 5-1.2054_FC5-i686
drwxr-xr-x  2 root root   4096 03-15 05:02 extra
drwxr-xr-x 10 root root   4096 04-29 12:08 kernel
-rw-r--r--  1 root root 239062 04-29 12:09 modules.alias
-rw-r--r--  1 root root     69 04-29 12:09 modules.ccwmap
-rw-r--r--  1 root root 238199 04-29 12:09 modules.dep
-rw-r--r--  1 root root    813 04-29 12:09 modules.ieee1394map
-rw-r--r--  1 root root    206 04-29 12:09 modules.inputmap
-rw-r--r--  1 root root  11158 04-29 12:09 modules.isapnpmap
-rw-r--r--  1 root root 182372 04-29 12:09 modules.pcimap
-rw-r--r--  1 root root    799 04-29 12:09 modules.seriomap
-rw-r--r--  1 root root 104167 04-29 12:09 modules.symbols
-rw-r--r--  1 root root 279653 04-29 12:09 modules.usbmap
lrwxrwxrwx  1 root root      5 04-29 12:08 source -> build
drwxr-xr-x  2 root root   4096 03-15 05:02 updates
从这里可以看出需要链接文件build所指向的文件是无效的,因为那个文件不存在
[root@sunshine src]# cd kernels/
[root@sunshine kernels]# ln -s ../redhat/BUILD/kernel-2.6.15/linux-2.6.15.i686/ 2.6.15-1.2054_FC5-i686
[root@sunshine kernels]# ls
2.6.15-1.2054_FC5-i686
[root@sunshine kernels]# cd 2.6.15-1.2054_FC5-i686/
[root@sunshine 2.6.15-1.2054_FC5-i686]# cp configs/kernel-2.6.15-i686.config .config
cp:是否覆盖“.config”? y

修正Makefile
------------------------------------
[root@sunshine 2.6.15-1.2054_FC5-i686]#uname –r (得到2.6.15-1.2054_FC5)
2.6.15-1.2054_FC5
那么就要将Makefile中的
EXTRAVERSION = -prep
换成
EXTRAVERSION = -1.2054_FC5
-------------------------------------
继续编译:
[root@sunshine 2.6.15-1.2054_FC5-i686]#make mrproper
[root@sunshine 2.6.15-1.2054_FC5-i686]#make oldconfig
[root@sunshine 2.6.15-1.2054_FC5-i686]#make  
[root@sunshine 2.6.15-1.2054_FC5-i686]#make modules_install
到此我们要用的内核编译完成

在重启选中Fedora Core (2.6.15-1.2054_FC5)后,电脑出现如下画面就停止不动了:
……
Decompressing Linux … done.
Booting the kernel.
Red Hat nash version 5.0.32 starting
Insmod: error inserting ‘/lib/scsi_mod.ko’: -1 Operation not permitted
Insmod: error inserting ‘/lib/sd_mod.ko’: -1 Operation not permitted
Insmod: error inserting ‘/lib/libata.ko’: -1 Operation not permitted
Insmod: error inserting ‘/lib/sata_via.ko’: -1 Operation not permitted
Insmod: error inserting ‘/lib/jbd.ko’: -1 Operation not permitted
Insmod: error inserting ‘/lib/ext3.ko’: -1 Operation not permitted
mount: error mounting /dev/root on /sysroot as ext3: No such device
setuproot: moving/dev failed: No such file or directory
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
switchroot: mount failed: No such file or directory
kernel panic – not syncing: Attempted to kill init.
请教各位Linux高手,出现上述现象怎么回事?如何补救?若不可补救只能重装系统,需要怎样避免出现同一问题?另外,上述安装就可以正确运行 《linux设备驱动程序第三版》第二章中那个示例模块了么?
请各位不吝赐教,十分感谢,新手在迷茫郁闷网上等待中……
 楼主| 发表于 2006-6-15 08:17:08 | 显示全部楼层
怎么没人给予帮助啊?
回复 支持 反对

使用道具 举报

发表于 2006-6-15 08:52:58 | 显示全部楼层
你原来的内核是什么版本的?
貌似像是内核模块不正确。
请把你的grub.conf贴上来。

如果内核参数不正确,可能需要重新启用旧内核,然后重新编译新内核。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表