Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common problems in linux kernel compilation

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces what are the common problems in linux kernel compilation, which can be used for reference. I hope you can learn a lot after reading this article.

1. If the same error always occurs when compiling the kernel, as follows:

An error pops up on the last few lines of 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 killed / sbin/depmod-ae-F System.map 2.6. 12.2

Make: * [_ modinst_post] error 137

If you continue to make install and restart, you will not be able to enter the kernel that you just compiled and installed, showing a kernel error.

Analysis: if System.map is readable and / sbin/depmod is executable, then execute / sbin/depmod-ae-F System.map 2.6.20; end

Depmod (depend module)

Function description: analyze the dependency of loadable modules.

Syntax: depmod [- adeisvV] [- m] [--help] [module name]

Additional note: depmod can detect the dependency of the module for modprobe to use when installing the module.

Parameters:

-an or-- all analyzes all available modules.

-d or debug executes debug mode.

-e outputs symbols that cannot be referenced.

-I do not check the version of the symbol table.

-m or system-map uses the specified symbol table file.

-s or-- system-log records errors in the system record.

-v or-- verbose displays detailed information when it is executed.

-V or-- version displays version information.

-- help displays help.

Solution: did you shut down selinux before make module_install

The problem is that selinux prevents writing to the / lib/modules/ directory

2. If the system is rebooted, it is displayed:

Warning--SElinux relabel is required

Disabling security enforcement

Relabeling could take a very long time

Depending on file system size

You can change grub.conf to add selinux=0 to the following location

Kernel / vmlinuz-2.6.11-1.1369_FC4 ro root=LABEL=/ selinux=0 rhgb quiet

Or change / etc/selinux/config, SELINUX=Disabled, save the disk and close the selinux.

3. Modify selinux

On Red Hat and Fedora in the new version, modify the file / 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

Set SELINUX to disable, and the next time you start the system, it will stop SElinux.

Linux Core parameters (Kernel Parameter)

Or you can add: selinux=0 (stop) or selinux=1 (on) parameter after the core parameter

Archives / 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

Check the current status of SELinux

To know whether you are using SELinux now:

# getenforce

Disabled

4. If Kernel panic:VFS: Unable to mount root fs on unknown-block appears after restart

Judging from the error message, the hard drive is not recognized. It seems that the SATA hard drive on my machine must be configured in the kernel to be recognized.

After carefully reading the help information when configuring the kernel, we found that the kernel supports two kinds of SATA drivers: one is libata, which supports the latest SATA controller in the SCSI subsystem, and the other is SATA in the IDE driver, which mainly supports the first generation SATA controller. My machine should be relatively new, so try to configure it according to libata first.

Let's see what kind of SATA controller I have. Run lspci and the output is as follows:

00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Con troller (rev 01)

Is the type of SATA controller.

Workaround: set the following options in make menuconfig:

Device Driver

| |-> SCSI device support |

| |-> SCSI disk support |

| |-> verbose SCSI error reporting (not required, but can facilitate problem location) |

| |-> SCSI low-level drivers |

| |-> Serial ATA (SATA) support |

| |-> intel PIIX/ICH SATA support |

RAM disk support is in device drivers-> Block devices

Initial RAM disk (initrd) support in device drivers-> Block devices

Compressed ROM filesystem support (cramfs) in filesystems-> Miscellaneous filesystems

5. If the network card is not recognized and cannot be activated after reboot, via-rhine device eth0 does not seem to be present and delaying initialization appear.

Missing VIA driver

Run make menuconfig

Find "VIA Rhine RevB support" in Networking support-- > Networking device support-- > Ethernet (10 or 100Mbit)

6. If rebooted, the display is as follows:

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!

When running make menuconfig, device drivers-> [*] Multiple devices driver support (RAID and LVM)

You should also enable Logical volume manager (LVM) support if you have the following options

Thank you for reading this article carefully. I hope the article "what are the common problems in compiling the linux kernel" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report