Linux kernel compilation, configuring native drivers

Source: Internet
Author: User
Tags lenovo

1. Preface

The reason to compile the Linux kernel failed many times is to drive the wrong choice, suitable for their own native drive is not compiled into. In the face of special platform (or some neat person, I am ^_^), to compile the thin kernel, as long as the native drive, no other need. In the face of the kernel so many drivers, do not understand the hardware, we see the head big. The first time I installed Gentoo, the kernel compiled 5 times, the first 4 major failure reasons are Ethernet card driver, wireless card driver, graphics driver, sound card driver is not configured correctly at once. Although Gentoo provides the Genkernel command to automatically compile the kernel for you, you still want to try it yourself manually.

2. Get native Drive information

Since the kernel hooks, we get the native kernel driver information The most direct way is to use the lspci command, this command can output native drive information, with the-k option can see this driver in the kernel seat.

General Compile kernel scenario: Update old kernel, install custom Linux distribution (Gentoo,arch, etc.), embedded platform, other special platforms, etc...

Most scenarios can be used under the LSPCI command, and the LiveCD version of the Gentoo installation provides the tool, if no other system installs the tool

Debian Series Installation

1 $:sudoinstall

or source code compiled and installed, https://www.kernel.org/pub/software/utils/pciutils/

Then we get the existing driver information in the native environment, here is the information on my machine:

1$:LSPCI-k2 xx:00.0Host Bridge:intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev the)3 Subsystem:lenovo Device 21e24 xx:01.0PCI Bridge:intel Corporation Xeon e3- -/2nd Generation Core Processor Family PCI Express Root Port (rev the)5Kernel DriverinchUse:pcieport6 xx:02.0VGA compatible Controller:intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev the)7 Subsystem:lenovo Device 21e38Kernel Driverinchuse:i9159 xx:16.0Communication Controller:intel Corporation6series/c200 Series Chipset Family MEI Controller #1(RevGeneva)Ten Subsystem:lenovo Device 21e2 OneKernel DriverinchUse:mei_me A xx: 1a.0USB Controller:intel Corporation6series/c200 Series Chipset Family USB enhanced Host Controller #2(RevGeneva) - Subsystem:lenovo Device 21e2 -Kernel Driverinchuse:ehci-PCI the xx: 1b.0Audio Device:intel Corporation6series/c200 Series Chipset Family high Definition Audio Controller (revGeneva) - Subsystem:lenovo Device 21e2 -Kernel DriverinchUse:snd_hda_intel - xx: 1c.0PCI Bridge:intel Corporation6series/c200 Series Chipset Family PCI Express Root Port1(rev b4) +Kernel DriverinchUse:pcieport - xx: 1c.1PCI Bridge:intel Corporation6series/c200 Series Chipset Family PCI Express Root Port2(rev b4) +Kernel DriverinchUse:pcieport A xx: 1c.2PCI Bridge:intel Corporation6series/c200 Series Chipset Family PCI Express Root Port3(rev b4) atKernel DriverinchUse:pcieport - xx: 1c.3PCI Bridge:intel Corporation6series/c200 Series Chipset Family PCI Express Root Port4(rev b4) -Kernel DriverinchUse:pcieport - xx: 1c.7PCI Bridge:intel Corporation6series/c200 Series Chipset Family PCI Express Root Port8(rev b4) -Kernel DriverinchUse:pcieport - xx: 1d.0USB Controller:intel Corporation6series/c200 Series Chipset Family USB enhanced Host Controller #1(RevGeneva) in Subsystem:lenovo Device 21e2 -Kernel Driverinchuse:ehci-PCI to xx: 1f.0ISA Bridge:intel Corporation HM65 Express Chipset Family LPC Controller (revGeneva) + Subsystem:lenovo Device 21e2 -Kernel DriverinchUse:lpc_ich the xx: 1f.2SATA Controller:intel Corporation6series/c200 Series Chipset Family6Port SATA AHCI Controller (revGeneva) * Subsystem:lenovo Device 21e2 $Kernel DriverinchUSE:AHCIPanax Notoginseng xx: 1f.3Smbus:intel Corporation6series/c200 Series Chipset Family SMBus Controller (revGeneva) - Subsystem:lenovo Device 21e2 the  on:00.0VGA compatible controller:advanced Micro Devices, Inc. [Amd/ati] Seymour [Radeon HD 6400m/7400M Series] (Rev FF) +Kernel DriverinchUse:radeon A Geneva:00.0Ethernet Controller:realtek Semiconductor Co., Ltd. rtl8111/8168/8411PCI Express Gigabit Ethernet Controller (rev .) the Subsystem:lenovo Device 21e2 +Kernel Driverinchuse:r8169 - Geneva:00.0System Peripheral:ricoh Co Ltd PCIe sdxc/mmc Host Controller (rev -) $ Subsystem:lenovo Device 21e2 $Kernel Driverinchuse:sdhci-PCI -  the:00.0Network Controller:realtek Semiconductor Co., Ltd. RTL8188CE802.11b/g/n WiFi Adapter (rev on) -Subsystem:realtek Semiconductor Co., Ltd. Device8195 theKernel DriverinchUse:rtl8192ce

We can see that each driver is followed by Kernel driver in use:, which represents a link seat that drives in the kernel.

3. Configuring the kernel driver

Download kernel source https://www.kernel.org/, I download here is stable 4.3.3, extracted into the source directory to execute:

1 $: make Menuconfig

The compilation Options screen will then pop up,

We can see that there are shortcut key operating instructions, I focus on </> for search, in the interface directly press the backslash, into the search interface. And then we'll pick a key driver.

Network controller, you can see the model is Realtek rtl8188ce, and then kernel driver in use: rtl8192ce, the seat link in the kernel is Rtl8192ce

We press </>, enter rtl8192ce, and then enter, the detailed seat will appear,

we can see the pormt tip is the same as the model I want, the specific options in front of a (1), notice here the same sombol (is just the input rtl8192ce) have a lot of options, I based on the previous sequence number, according to the corresponding number you can go directly to the option, press <esc> to return to this interface. Here, I press 1 directly. Press 1 to go to the specific option,

We see above, the release version in order to be compatible with various machines, all Realtek drivers are compiled into the module. Next, keep your driver model and remove the others.

The rest of the drive is the same as above, and some unnecessary drivers are directly compiled into the kernel, not modules. Control your own drive, others can not. The kernel after configuration

configuration files are best Save, if the driver is not configured successfully, and then configure the time to copy the saved configuration file to the source directory, named . config. Continue make menuconfig configuration.

Linux kernel compilation, configuring native drivers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.