侯体宗的博客
  • 首页
  • Hyperf版
  • beego仿版
  • 人生(杂谈)
  • 技术
  • 关于我
  • 更多分类
    • 文件下载
    • 文字修仙
    • 中国象棋ai
    • 群聊
    • 九宫格抽奖
    • 拼图
    • 消消乐
    • 相册

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

linux  /  管理员 发布于 7年前   517

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


  • 上一条:
    Linux更新和查询命令chkconfig详细介绍
    下一条:
    用U盘来安装linux的方法技巧
  • 昵称:

    邮箱:

    0条评论 (评论内容有缓存机制,请悉知!)
    最新最热
    • 分类目录
    • 人生(杂谈)
    • 技术
    • linux
    • Java
    • php
    • 框架(架构)
    • 前端
    • ThinkPHP
    • 数据库
    • 微信(小程序)
    • Laravel
    • Redis
    • Docker
    • Go
    • swoole
    • Windows
    • Python
    • 苹果(mac/ios)
    • 相关文章
    • 在Linux系统中使用Iptables实现流量转发功能流程步骤(0个评论)
    • vim学习笔记-入门级需要了解的一些快捷键(0个评论)
    • 在centos7系统中实现分区并格式化挂载一块硬盘到/data目录流程步骤(0个评论)
    • 在Linux系统种查看某一个进程所占用的内存命令(0个评论)
    • Linux中grep命令中的10种高级用法浅析(0个评论)
    • 近期文章
    • 智能合约Solidity学习CryptoZombie第一课:生成一只你的僵尸(0个评论)
    • 在go中实现一个常用的先进先出的缓存淘汰算法示例代码(0个评论)
    • 在go+gin中使用"github.com/skip2/go-qrcode"实现url转二维码功能(0个评论)
    • 在go语言中使用api.geonames.org接口实现根据国际邮政编码获取地址信息功能(1个评论)
    • 在go语言中使用github.com/signintech/gopdf实现生成pdf分页文件功能(0个评论)
    • gmail发邮件报错:534 5.7.9 Application-specific password required...解决方案(0个评论)
    • 欧盟关于强迫劳动的规定的官方举报渠道及官方举报网站(0个评论)
    • 在go语言中使用github.com/signintech/gopdf实现生成pdf文件功能(0个评论)
    • Laravel从Accel获得5700万美元A轮融资(0个评论)
    • 在go + gin中gorm实现指定搜索/区间搜索分页列表功能接口实例(0个评论)
    • 近期评论
    • 122 在

      学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..
    • 123 在

      Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..
    • 原梓番博客 在

      在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..
    • 博主 在

      佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..
    • 1111 在

      佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
    • 2016-11
    • 2017-07
    • 2017-10
    • 2017-11
    • 2018-01
    • 2018-02
    • 2020-03
    • 2020-04
    • 2020-05
    • 2020-06
    • 2021-02
    • 2021-03
    • 2021-04
    • 2021-06
    • 2021-07
    • 2021-08
    • 2021-09
    • 2021-10
    • 2021-11
    • 2021-12
    • 2022-01
    • 2022-03
    • 2022-04
    • 2022-08
    • 2022-11
    • 2022-12
    • 2023-01
    • 2023-02
    • 2023-03
    • 2023-06
    • 2023-07
    • 2023-10
    • 2023-12
    • 2024-01
    • 2024-04
    Top

    Copyright·© 2019 侯体宗版权所有· 粤ICP备20027696号 PHP交流群

    侯体宗的博客