当前位置: 移动技术网 > 科技>操作系统>Linux > linux内核编译常常出现的问题的解决办法

linux内核编译常常出现的问题的解决办法

2019年05月31日  | 移动技术网科技  | 我要评论

早乙女ルイ,胡萝卜的功效与作用,单田芳评书网mp3

1、若编译内核时总是出现同一个错误,如下:
在make modules_install时最后几行弹出错误:
if [ -r system.map -a -x /sbin/depmod ]; then /sbin/depmod -ae -f system.map 2.6.12.2; fi
/bin/sh: line 1: 3357 已杀死 /sbin/depmod -ae -f system.map 2.6 .12.2
make: *** [_modinst_post] 错误 137
如果继续make install,重启,是进不去刚刚编译安装的那个内核的,显示内核错误。
分析:如果 system.map可读 并且 /sbin/depmod可执行;那么就执行/sbin/depmod -ae -f system.map 2.6.20;结束
depmod(depend module)
功能说明:分析可载入模块的相依性。
语 法:depmod [-adeisvv][-m <文件>][--help][模块名称]
补充说明:depmod可检测模块的相依性,供modprobe在安装模块时使用。
参 数:
-a或--all 分析所有可用的模块。
-d或debug 执行排错模式。
-e 输出无法参照的符号。
-i 不检查符号表的版本。
-m<文件>或system-map<文件> 使用指定的符号表文件。
-s或--system-log 在系统记录中记录错误。
-v或--verbose 执行时显示详细的信息。
-v或--version 显示版本信息。
--help 显示帮助。
解决方法:make module_install之前你是否关闭了selinux,
该问题是selinux阻止写/lib/modules/ <version> 目录
2、若重启系统后显示:
warning--selinux relabel is required
disabling security enforcement
relabeling could take a very long time
depending on file system size
可以更改grub.conf 将selinux=0添加到如下位置
kernel /vmlinuz-2.6.11-1.1369_fc4 ro root=label=/ selinux=0 rhgb quiet
或者更改/etc/selinux/config,将selinux=disabled,存盘就可以把 selinux 关闭了
3、修改selinux
在新版本中的red hat 和 fedora 上,修改档案/etc/sysconfig/selinux:
# this file controls the state of selinux on the system.
# selinux= can take one of these three values:
# enforcing - selinux security policy is enforced.
# permissive - selinux prints warnings instead of enforcing.
# disabled - selinux is fully disabled.
selinux=enforcing
# selinuxtype= type of policy in use. possible values are:
# targeted - only targeted network daemons are protected.
# strict - full selinux protection.
selinuxtype=targeted
把 selinux设定为disable, 下次启动系统后将会停止selinux.
linux核心参数(kernel parameter)
或者可以在核心参数后加上: selinux=0 (停止) 或 selinux=1 (开启)参数
档案/boot/grub/menu.lst
title fedora core (2.6.18-1.2798.fc6)
root (hd0,0)
kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=label=/ rhgb quiet selinux=0
initrd /initrd-2.6.18-1.2798.fc6.img
检查selinux现时况态
要知到你现在是否使用 selinux:
# getenforce
disabled
4、重启后若出现kernel panic:vfs: unable to mount root fs on unknown-block(0,0)
从错误信息上看,是没有识别到硬盘。看来,我机器上的sata硬盘必须在内核中做相应的配置才能识别。
仔细阅读了内核配置时的帮助信息,得知内核支持两种sata驱动程序:一种是libata,在scsi子系统中,支持最新的sata控制器;还有一种是 ide驱动程序中的sata,主要是支持第一代的sata控制器。我的机器应该是比较新的,所以先按libata的方式来配置试试。
先看看我的sata控制器是什么类型的?运行lspci,输出如下:
00:1f.2 ide interface: intel corporation 82801gbm/ghm (ich7 family) sata ide con troller (rev 01)
就是sata控制器的类型。
解决方法:在make menuconfig中设置以下选项:
device driver
|---->scsi device support
|---->scsi disk support
|----->verbose scsi error reporting (不是必须的,但可方便问题定位)
|----->scsi low-level drivers
|---->serial ata (sata) support
|---->intel piix/ich sata support
<*> ram disk support 在 device drivers -> block devices中
<*> initial ram disk (initrd) support 在 device drivers -> block devices中
<*> compressed rom file system support (cramfs) 在file systems -> miscellaneous filesystems中
5、若重启之后出现网卡不识别,无法激活,出现via-rhine device eth0 does not seem to be present, delaying initialization
缺少via 驱动
运行 make menuconfig
在networking support-->networking device support --> ethernet (10 or 100mbit) 里找到 <m>"via rhine revb support"
6、若重启后显示如下:
reading all physical volumns, this may take a while…
no volumns group found!
unable to find volumns group "volgroup00"
error: /bin/lvm exited abnormal with value 5 (pid 335)
error 6 mounting ext3
error opening /dev/console!!:2
error dup2ing fd of 0 to 0
error dup2ing fd of 1 to 1
error duping fd of 2 to 2
switchroot:mount failed:22
kernel panic - no syncing: attempted to kill init!
运行make menuconfig时在 device drivers ->[*] multiple devices driver support (raid and lvm)
如果有以下选项,也应该启用它们:<*> logical volume manager (lvm) support

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网