Current location - Health Preservation Learning Network - Healthy weight loss - How to cut the linux kernel?
How to cut the linux kernel?
Configure in menuconfig:

Detailed introduction of kernel configuration options and deletion.

Part I: Delete all.

Code maturity level options-> Code maturity options

[] Prompt to develop and/or complete the code/driver is selected by default, and the codes and drivers being developed or not yet completed will be displayed in the setting interface. Do not choose.

Part II: Delete all options except the following.

General settings-

System v IPC (IPC: Interprocess Communication) is a group system call and function library, which enables programs to exchange information synchronously with each other. Some programs and DOS simulation environments need it. Provide communication mechanism for processes, so that processes in the system can exchange information and keep synchronization. Some programs can only run if you choose Y, so don't consider it, you must choose here.

Part III: Delete all options except the following.

Loadable module support-> Bootable modules support the suggestion of adding the kernel as a module.

[] Enable loadable module support This option allows your kernel to support modules. What is a module? A module is a small piece of code that can be dynamically added to the compiled system kernel when it is running, thus adding some features to the kernel or supporting some hardware. Generally speaking, some rarely used drivers or functions can be compiled into modules to reduce the size of the kernel. At runtime, you can use the modprobe command to load it into the kernel (and delete it when it is not needed). The principle of whether some features are compiled into modules is that drivers that are not often used, especially those that are not needed when the system is started, can be compiled into modules. If the system needs some drivers, such as file system, the system bus support should not be compiled into modules, otherwise the system cannot be started.

[] Automatic kernel module loading Generally speaking, if our kernel wants to use some drivers or features compiled into modules in some tasks, we have to use the modprobe command to load them before the kernel can use them. But if you choose this option, when the kernel needs some modules, it can automatically call the modprobe command to load the required modules, which is a great feature. Of course, you should choose y.

Part IV: Delete all.

Block layer-> block device

Part V: Delete all options except the following.

Processor type and function->; cpu

Sub-architecture type (PC compatible)->; The main purpose of this option is to make Linux support multiple PC standards. Generally, the PC we use follows the so-called IBM compatible architecture (pc/at). This option allows you to choose some other architectures. We usually choose PC-compatible.

Processor family (386): It will optimize each CPU to make it run well and quickly. Generally speaking, you can choose any model. I chose 386, so the kernel will save a lot of space.

Part VI: Delete all options except the following.

Power management options (ACPI, APM)->; Power management options

[] Power management debugging supports debugging information of power management. Do not select this option if you have not debugged the power management part of the kernel.

Acpi support-> advanced power interface configuration support. This option is recommended if BIOS supports it.

[] Button This option is used to register events based on the power button, such as power, sleep, etc. When you press the button, events will occur, and a daemon will read /proc/acpi/event and perform user-defined actions on these events, such as shutting down the system. You don't have to choose according to your own needs.

Part VII: Delete all options except the following.

Bus options (PCI, PCMCIA, EISA, MCA, ISA)->; Bus option

[]PCI support

PCI access mode (arbitrary)->; PCI peripheral configuration, it is strongly recommended to choose Any, and the system will use MMConfig first, then BIOS, and finally use Direct to detect PCI devices.

Part VIII: Delete all options except the following.

Executable file format->;

The kernel supports ELF binary ELF is the most commonly used binary file under the open platform and supports different hardware platforms. Be sure to choose.

Part IX: Delete all options except the following.

Establish a working network

Network options->

[]Unix domain socket

[]TCP/IP network

Part X: Delete all options except the following.

Device driver->; device driver

Block devices->

[]Compaq SMART2 support

[] Compaq smart array 5xxx support

[] Loopback devices support that most people choose n as this option because it is unnecessary. But if you want to mount an iso file, you must select Y, which means that you can hang a file as a file system. If you want to burn a CD, it is very likely that before burning the file, you will see whether the file conforms to the contents of the file system of IS09660 and whether it meets your needs. In addition, the file system can be protected. However, if you want to do this, you must have the latest mount program, the version is above 2.5X If you want to protect this file system, you must have the program des. 1.tar.gz Note: this has nothing to do with the network. Recommend compiling into modules.

[] RAM disk support

SCSI device support->; About USB support, you have to choose.

[] To support USB with []SCSI devices, you must select.

[]legacy /proc/scsi/ support USB is used and must be selected.

[] To support USB with []SCSI disk, you must select.

SCSI low-level driver

[] Serial ATA(SATA) support

[] Intel PIIX/ICH SATA support must select this option, otherwise the boot file cannot be generated.

[] Supported by SATA

Network equipment support-> The following is the choice of network card driver, you must choose it.

Ethernet (1000mbit)-? My computer is a gigabit network card, so I chose this one.

[]Broadcom tigon 3 support

Input device support->; You should set up your mouse and keyboard here.

[] Provide traditional/development /psaux equipment.

Graphic support->

[] Devices that support frame buffers support frame buffers, so you must select it.

USB support->;

[]USB device file system This seems to be necessary to use a USB flash drive.

[]EHCI HCD (usb2.0) supports selecting usb2.0 and compiling it into a module if it is available.

[] OHCI HCD support must be selected and compiled into a module.

[] uhcihcd (most Intel and VIA) support must be selected and compiled into a module.

[] U disk must be selected for []USB mass storage support.

Select usb mouse and usb keyboard in USB man-machine interface device (full HID) support. If you have to choose this option, you must choose it.

HID input layer support should be selected.

/dev/hiddev raw HID device support If there are USB keyboard and mouse options here, be sure to select them.

Part XI: Delete all options except the following.

File system-> File system

Second extension of fs support

Ext2 extended attribute

Ext2positix access control list

Ext2 security label

Ext3 Log File System Support

Ext3 extended attribute

Ext3positix access control list

Ext3 security labels These must be selected, the standard file system of linux.

Kernel autoloader supports kernel automount, of course, you have to choose.

Of course, you should choose the kernel automatic installer version 4 support (also supports v3).

DOS/FAT/NT file system->;

DOS FAT fs support

MSDOS fs support

VFAT (Windows-95) fs support

NTFS file system support

Mother tongue support? Language support, only English and Chinese are supported here, not to mention.

You must select [] nliso8859-1. This is about mounting a USB flash drive.

CD-ROM/DVD file system-> This is about installing ISO files. Please select it if you use it.

ISO 9660 CDROM file system support

Part XII: Delete All

Instrument support

Part XIII: Delete all.

Kernel hacker->; Crack the core? Don't be a skeleton guest, don't choose.

Part XIV: Delete all.

Security options->

Part XV: Delete all.

Encryption options-> This is the option that the core supports encryption

Part XVI: Delete all.

Library routine->;

Attached:

Kernel configuration

There are many ways to configure the kernel, such as make config, make xconfig, make menuconfig, make oldconfig, etc. They all have the same function, and the difference should be obvious from the name. Only make oldconfig refers to using the current system settings (. /.config) as the default value. Make menuconfig is used here.

It should be remembered that the more unnecessary drivers, the larger the kernel, which will not only run slowly, but also occupy more memory, and in a few cases, it will cause other problems. The specific steps are as follows:

First make sure that the shell is bash.

then

$make menuconfig

Some default symbols have the following meanings:

Y: load

N: do not load

M: loaded as a module

You can configure the following options:

1) code maturity level option code maturity

Prompt for development and/or incomplete code/driver [N/y/? ]

If you are interested in testing some modules in the kernel that have not yet been finalized, choose Y, otherwise choose N. Want to know more details? You will see the online help (as follows? The meaning of is the same), and n capitalization means the default value.

2) Processor type and characteristics Processor type and characteristics.

Processor family (386,486/CX 486,586/K5/5x86, Pentium /K6/TSC, PPRO/6x8MX) [PPRO/6x8MX]

The value in [] is the default value, which we can choose according to the execution result of the uname command introduced earlier. If this item is higher than 386, the generated kernel will not be started on the 386 machine.

Mathematical simulation (config _ math _ simulation) [n/y/? ]

Do you need to do coprocessor simulation? Ordinary machines return to n, if the machine already has a hardware coprocessor, the kernel will still use hardware, ignoring the mathematical-simulation of software, which will make the kernel bigger and slower.

MTRR (memory type range register) supports (CONFIG_MTRR)[N/y/? ]

Image writing speed can be improved in Pentium and Pro/Pentium II systems.

Symmetric multiprocessing support (CONFIG_SMP)[Y/n/? ]

If your machine has multiple processors, please select Y. At this time, please select the following enhanced real-time clock support.

3) Loadable models support loadable modules.

Enable loadable module support (CONFIG_MODULES)[Y/n/? ]

You'd better choose Y, otherwise many modules that are only used for dynamic loading will not be available.

Set version information of all symbols.