溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

linux內(nèi)核編譯常出現(xiàn)的問(wèn)題有哪些

發(fā)布時(shí)間:2021-10-15 09:23:49 來(lái)源:億速云 閱讀:171 作者:小新 欄目:系統(tǒng)運(yùn)維

這篇文章主要介紹了linux內(nèi)核編譯常出現(xiàn)的問(wèn)題有哪些,具有一定借鑒價(jià)值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。

1、若編譯內(nèi)核時(shí)總是出現(xiàn)同一個(gè)錯(cuò)誤,如下:
在make modules_install時(shí)最后幾行彈出錯(cuò)誤:
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] 錯(cuò)誤 137
如果繼續(xù)make install,重啟,是進(jìn)不去剛剛編譯安裝的那個(gè)內(nèi)核的,顯示內(nèi)核錯(cuò)誤。
分析:如果 System.map可讀 并且 /sbin/depmod可執(zhí)行;那么就執(zhí)行/sbin/depmod -ae -F System.map 2.6.20;結(jié)束
depmod(depend module)
功能說(shuō)明:分析可載入模塊的相依性。
語(yǔ) 法:depmod [-adeisvV][-m <文件>][--help][模塊名稱]
補(bǔ)充說(shuō)明:depmod可檢測(cè)模塊的相依性,供modprobe在安裝模塊時(shí)使用。
參 數(shù):
-a或--all 分析所有可用的模塊。
-d或debug 執(zhí)行排錯(cuò)模式。
-e 輸出無(wú)法參照的符號(hào)。
-i 不檢查符號(hào)表的版本。
-m<文件>或system-map<文件> 使用指定的符號(hào)表文件。
-s或--system-log 在系統(tǒng)記錄中記錄錯(cuò)誤。
-v或--verbose 執(zhí)行時(shí)顯示詳細(xì)的信息。
-V或--version 顯示版本信息。
--help 顯示幫助。
解決方法:make module_install之前你是否關(guān)閉了selinux,
該問(wèn)題是selinux阻止寫(xiě)/lib/modules/ <version> 目錄
2、若重啟系統(tǒng)后顯示:
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,存盤(pán)就可以把 selinux 關(guān)閉了
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設(shè)定為disable, 下次啟動(dòng)系統(tǒng)后將會(huì)停止SElinux.
Linux核心參數(shù)(Kernel Parameter)
或者可以在核心參數(shù)后加上: selinux=0 (停止) 或 selinux=1 (開(kāi)啟)參數(shù)
檔案/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現(xiàn)時(shí)況態(tài)
要知到你現(xiàn)在是否使用 SELinux:
# getenforce
disabled
4、重啟后若出現(xiàn)Kernel panic:VFS: Unable to mount root fs on unknown-block(0,0)
從錯(cuò)誤信息上看,是沒(méi)有識(shí)別到硬盤(pán)。看來(lái),我機(jī)器上的SATA硬盤(pán)必須在內(nèi)核中做相應(yīng)的配置才能識(shí)別。
仔細(xì)閱讀了內(nèi)核配置時(shí)的幫助信息,得知內(nèi)核支持兩種SATA驅(qū)動(dòng)程序:一種是libata,在SCSI子系統(tǒng)中,支持最新的SATA控制器;還有一種是 IDE驅(qū)動(dòng)程序中的SATA,主要是支持第一代的SATA控制器。我的機(jī)器應(yīng)該是比較新的,所以先按libata的方式來(lái)配置試試。
先看看我的SATA控制器是什么類(lèi)型的?運(yùn)行l(wèi)spci,輸出如下:
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Con troller (rev 01)
就是SATA控制器的類(lèi)型。
解決方法:在make menuconfig中設(shè)置以下選項(xiàng):
Device Driver
|---->SCSI device support
|---->SCSI disk support
|----->verbose SCSI error reporting (不是必須的,但可方便問(wèn)題定位)
|----->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、若重啟之后出現(xiàn)網(wǎng)卡不識(shí)別,無(wú)法激活,出現(xiàn)via-rhine device eth0 does not seem to be present, delaying initialization
缺少VIA 驅(qū)動(dòng)
運(yùn)行 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&hellip;
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!
運(yùn)行make menuconfig時(shí)在 device drivers ->[*] Multiple devices driver support (RAID and LVM)
如果有以下選項(xiàng),也應(yīng)該啟用它們:<*> Logical volume manager (LVM) support

感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“l(fā)inux內(nèi)核編譯常出現(xiàn)的問(wèn)題有哪些”這篇文章對(duì)大家有幫助,同時(shí)也希望大家多多支持億速云,關(guān)注億速云行業(yè)資訊頻道,更多相關(guān)知識(shí)等著你來(lái)學(xué)習(xí)!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI