歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux管理 >> Linux問題解決 >> linux內核編譯常常出現的問題的解決辦法

linux內核編譯常常出現的問題的解決辦法

日期:2017/3/6 10:17:02   编辑:Linux問題解決
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
Copyright © Linux教程網 All Rights Reserved