linux內核編譯常常出現的問題的(de)解決辦法
1、若編譯內核時總是出現同一(yī)個錯誤(wù),如下:
在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;結(jié)束
depmod(depend module)
功能說明:分析可載入模塊(kuài)的相依性。
語 法:depmod [-adeisvV][-m <文(wén)件>][--help][模塊名稱]
補充說明:depmod可檢測(cè)模塊的相依性,供modprobe在安裝模塊時使用。
參 數:
-a或--all 分析所有可用(yòng)的模塊。
-d或debug 執行排錯模式(shì)。
-e 輸出無(wú)法參照的符號。
-i 不檢查(chá)符號表的版本。
-m<文件(jiàn)>或system-map<文(wén)件> 使用指定的(de)符號表文件。
-s或--system-log 在係統記錄中記錄錯誤。
-v或--verbose 執行(háng)時顯示(shì)詳細的信息。
-V或--version 顯示版本信息。
--help 顯示幫助。
解決方法:make module_install之前你是否關閉了selinux,
該問題是selinux阻止寫/lib/modules/ <version> 目錄(lù)
2、若重(chóng)啟係統後顯示:
Warning--SElinux relabel is required
Disabling security enforcement
Relabeling could take a very long time
depending on file system size
可(kě)以更改grub.conf 將selinux=0添加到如下(xià)位置(zhì)
kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=LABEL=/ selinux=0 rhgb quiet
或(huò)者更改/etc/selinux/config,將(jiāng)SELINUX=Disabled,存盤就(jiù)可以把 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)
或者可(kě)以在核心參數(shù)後加上: selinux=0 (停止) 或 selinux=1 (開啟)參數(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ǐ)用 SELinux:
# getenforce
disabled
4、重啟後若出現Kernel panic:VFS: Unable to mount root fs on unknown-block(0,0)
從錯誤信息上看,是沒有識別到硬盤(pán)。看來,我機器上的SATA硬盤必須(xū)在內核中做相應的配置才能識(shí)別。
仔細閱讀了內核配置時的幫助信息,得知內核支持兩種SATA驅動程序:一種是libata,在SCSI子係統中,支持最新的SATA控(kòng)製器;還有一種是 IDE驅動程序(xù)中的SATA,主要是支持第一代的SATA控製器(qì)。我(wǒ)的機器應該是比較(jiào)新的,所以先按libata的方式(shì)來配置試試。
先看看我的SATA控製器是什麽類型的?運行lspci,輸出如(rú)下:
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Con troller (rev 01)
就是SATA控製器的類型。
解(jiě)決方法:在(zài)make menuconfig中設置以下選項:
Device Driver
|---->SCSI device support
|---->SCSI disk support
|----->verbose SCSI error reporting (不是(shì)必(bì)須的,但可方便問題定位)
|----->SCSI low-level drivers
|---->Serial ATA (SATA) support
|---->intel PIIX/ICH SATA support
<*> RAM disk support 在(zài) device drivers -> Block devices中
<*> Initial RAM disk (initrd) support 在(zài) device drivers -> Block devices中(zhōng)
 
關鍵詞:linux
閱讀(dú)本文後您(nín)有什麽感想? 已有 人給出評價!
- 0
- 0
- 0
- 0
- 0
- 0