Steps for Linux kernel Cropping

Source: Internet
Author: User
Tags posix

 

Original article: http://cooldatabase.javaeye.com/blog/627482

Configure in menuconfig:
Detailed introduction to Kernel configuration options and deletions
Part 1: Delete All
Code maturity level options ---> code maturity level options
[] Prompt for development and/or incomplete code/drivers is selected by default. This will display the code and driver that is still being developed or not completed on the settings page. no.
Part 2: delete all items except the following
General setup-> -〉
System v ipc (IPC: Inter Process Communication) is a group system call and function library that allows programs to exchange information with each other synchronously. Some programs and DOS simulation environments need it. Provides a communication mechanism for processes, which enables information exchange and synchronization between processes in the system. Some programs can run only when y is selected, so you do not need to consider it.
Part 3: delete all items except the following
Loadable module support ---> the support for bootable modules is recommended to be added to the kernel as a module.
[] Enable loadable module support enables your kernel support module. What is the module? A module is a small piece of code. After compilation, You can dynamically Add the kernel when the system kernel is running, so as to add some features to the kernel or support certain hardware. Generally, some commonly used drivers or features can be compiled into modules to reduce the size of the kernel. You can run the modprobe command to load it to the kernel (you can also remove it when it is not needed ). The principle of compiling some features into modules is that they are not often used. In particular, drivers that are not required during system startup can compile them into modules, if the driver is used when the system starts, for example, the file system, the support of the system bus should not be compiled as a module, or the system cannot be started.
[] Automatic kernel module loading generally, if our kernel needs to use a driver or feature compiled as a module in some tasks, we need to use the modprobe command to load it before the kernel can be used. However, if you choose this option, when the kernel needs some modules, it can automatically call The modprobe command to load the required modules. This is a great feature, of course, you must choose y.
Part 4: delete all
Block layer -----> block Device
Part 5: delete all items except the following
Processor type and features ---> Processor type
Subarchitecture type (PC-compatible) ---> the main purpose of this option is to enable Linux to support multiple PC standards, generally, the PC we use follows the so-called IBM compatibility structure (PC/). This option allows you to select other architectures. We generally choose PC-compatible.
Processor family (386): it will optimize each type of CPU so that it can run well and well. Generally, you can select any type of CPU. I chose 386, which saves a lot of space for the kernel.
Part 6: delete all items except the following
Power Management Options (ACPI, APM) ---> power management options
[] Power Management debug support debugging information support for power management. Do not select this option if you do not want to debug the kernel related to power management.
ACPI support ---> Advanced Power Interface Configuration support. If BIOS support is available, we recommend that you select this option.
[] The button option is used to register power-based events, such as power and sleep. When you press the button, a daemon will read/proc/ACPI/event, and execute the actions defined by the user on these events, such as shutting down the system. You can select either of them based on your needs.
Part 7: delete all items except the following
Bus options (PCI, PCMCIA, Eisa, MCA, Isa) ---> bus options
[] PCI support
PCI access mode (any) ---> PCI peripheral device configuration. We recommend that you select any for the strong column. The system will first use mmconfig, then use bios, and finally use direct to detect PCI devices.
Part 8: delete all items except the following
Executable file formats --->
Kernel support for elf binaries elf is the most common binary file on open platforms. It supports different hardware platforms. Be sure to select.
Part 9: delete all items except the following
Networking
Networking options --->
[] Unix domain sockets
[] TCP/IP networking
Part 10: delete all items except the following
Device Drivers ---> Device Driver
Block devices -------> -------〉
[] Compaq smart2 support
[] Compaq smart array 5xxx support
[] Loopback device support most people select N for this option because it is unnecessary. But if you want to mount the ISO file, you have to choose y. This option means that a file can be mounted into a file system. If you want to burn an optical disc, it is very likely that you can check whether the file meets the is09660 File System Content and your requirements before burning a file. In addition, this file system can be protected. However, if you want to do this, you must have the latest mount program, which is version 2.5x or later. And if you want to add protection to this file system, you will have the des.1.tar.gz program. Note: This is not related to the network. We recommend that you compile it into a module.
[] RAM disk support
SCSI device support ---> for USB support, select
[] SCSI Device Support USB must be selected
[] Legacy/proc/SCSI/support USB must be selected
[] To use SCSI disk support USB, You must select
SCSI low-level Drivers
[] Serial ATA (SATA) Support
[] This option is required for Intel piix/ich SATA support. Otherwise, boot files cannot be generated.
[] Via SATA support
Networking device support ---> select the NIC Driver.
Ethernet (1000 Mbit)-& #61664; my computer is a gigabit Nic, so select this
[] Broadcom tigon3support
Input Device Support ---> set your mouse and keyboard
[] Provide legacy/dev/psaux Device
Graphics support --->
[] Support for frame buffer devices supports frame buffer. You must select
USB support --->
[] USB device filesystem, which seems required by a USB flash drive
[] Ehci hcd (USB 2.0) support with USB is selected and compiled into modules.
[] Ohci hcd support must be selected and compiled into modules
[] Uhci HCD (most intel and via) support must be selected and compiled into modules
[] USB Mass Storage support USB flash drives are required
Select USB mouse and USB keyboard in USB Human Interface Device (full hid) support.
Select hid input layer support
/Dev/hiddev raw HID device support if you have the USB keyboard and mouse options, be sure to select
Part 1: Delete all items except the following
File systems ---> File System
Second extended FS Support

Ext2 extended attributes

Ext2 POSIX access control lists

Ext2 Security labels
Ext3 Journalling File System Support

Ext3 extended attributes

Ext3 POSIX access control lists

Ext3 Security labels and above must be selected. Linux Standard File System
Kernel automounter support automatically mounts the kernel. Of course, select
Kernel automounter version 4 Support (also supports V3)
DOS/fat/NT filesystems --->
Dos fat FS Support
Msdos FS Support
Vfat (Windows-95) FS Support
NTFS file system support
Native Language Support & #61664; Language Support
[] Nls iso 8859-1 is required. This is about USB flash disk mounting.
CD-ROM/DVD filesystems ---> This is about mounting the ISO file, you can choose.
ISO 9660 CDROM File System Support
Part 1: Delete All
Instrumentation support
Part 1: Delete All
Kernel hacking ---> cracking core? Not a zombie.
Part 1: Delete All
Security Options --->
Part 1: Delete All
Cryptographic options ---> This is the core option that supports encryption.
Part 1: Delete All
Library Routines --->
Appendix:
Kernel configuration
There are many Kernel configuration methods, such as make config, make xconfig, make menuconfig, and make oldconfig. Their functions are the same. The differences can be seen by name, only make oldconfig refers to the current settings of the system (. /. config) as the default value. Here, make menuconfig is used.
It should be noted that the larger the number of unnecessary drivers, the larger the kernel, not only the slow running speed and high memory usage, but also other problems in a few cases. The procedure is 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/drivers [N/y/?]
If you are interested in testing some modules that have not yet been finalized in the kernel, select Y. Otherwise, select N. Do you want to know more details? The online help (below? ), N indicates the default value in uppercase.
2) processor type and features Processor type and features
Processor family (386,486/cx133, 586/K5/5x86/6x86, Pentium/K6/TSC, ppro/6x86mx) [ppro/6x86mx]
[] Is the default value. We can select the value based on the uname command execution result described above. If this parameter is greater than 386, the generated kernel cannot be started on the 386 host.
Math emulation (config_math_emulation) [N/y/?]
Need to perform coprocessor simulation? Normal machines return n. If the machine already has a Hardware Co-processor, the kernel will still use the hardware, while ignoring the math-emulation of the software, which will make the kernel become slower.
Mtrr (memory type range register) Support (config_mtrr) [N/y/?]
Image writing speed can be improved in Pentium, Pro/Pentium II systems.
Using Ric multi-processing support (config_smp) [Y/n/?]
If your machine has multiple processors, select y. Select the following enhanced real time clock support
3) loadable model support: supported modules
Enable loadable module support (config_modules) [Y/n/?]
It is best to select Y. Otherwise, many modules that are only for dynamic loading will not be available.
Set version information on all symbols for modules (config_modversions) [N/y/?]
Select n
Kernel module loader (config_kmod) [N/y/?]
4) General setup general settings
Networking Support (config_net) [Y/n/?]
Select Y. How many other computers do not need to access the Internet?
PCI support (config_pci) [Y/n/?]
There are always PCI bus and devices.
PCI access mode (bios, direct, any) [any]
The default value is relatively safe, but if you have confidence in your motherboard, choose BIOS.
PCI quirks (config_pci_quirks) [Y/n/?]
It is used to fix bugs that affect PCI in bios. Similarly, if you are confident about the motherboard, select n.
Backward-compatible/proc/PCI> (config_pci_old_proc) [Y/n/?]
The previous kernel uses/proc/PCI, and the new kernel uses/proc/bus/PCI. To maintain compatibility, select y.
MCA support (config_mca) [N/y/?]
View help.
SGI visual workstation support (config_visws) [N/y/?]
Is your machine SGI? Select y If yes.
System v ipc (config_sysvipc) [Y/n/?]
Inter-process communication functions and system calls. One of the five main components of the Linux kernel must be selected.
BSD process accounting (config_bsd_process_acct) [N/y/?]
It is used to start user-level system calls that write process information into files by the kernel. You don't want to use it anymore.
Sysctl support (config_sysctl) [Y/n/?]
Modify the kernel when the kernel is running. Exchange 8 KB space for convenience. Do not select it unless you really want to try it.
Kernel support for A. Out binaries (config_binfmt_aout) [Y/M/n/?]
In order to use the previously compiled program, select y.
Kernel support for elf binaries (config_binfmt_elf) [Y/M/n/?]
To use the compiled program, select y.
Kernel support for MISC binaries (config_binfmt_misc) [Y/M/n/?]
Select y to support Automatic Execution of Java and other code.
Parallel Port support (config_parport) [N/y/M/?]
Parallel Port devices, such as printers.
5) Plug and Play support plug-and-play devices
Plug and Play support (config_pnp) [N/y/?]
Select y.
6) Block devices
Normal PC floppy disk support (config_blk_dev_fd) [Y/M/n/?]
General soft drive. Select y.
Enhanced IDE/MFM/rll Disk/CDROM/tape/Floppy support (config_blk_dev_ide) [Y/M/n/?]
Hard drive, optical drive, tape, and soft drive with these interfaces. Select y.
Include IDE/atapi CDROM support (config_blk_dev_idecd) [Y/M/n/?]
CDROM. Select y.
7) networking options network options
PACKET socket (config_pachet) [Y/M/n/?]
According to the current network development status, selecting y is better. Of course, you can also select another one.
Kernel/user Netlink socke (config_netlink) [N/y/?]
Two-way communication between the kernel and user processes. Select y.
Network firewils (config_firewall) [N/y/?]
If you really need to use the firewall, select y.
UNIX domain sockets (confgi_unix) [Y/M/n/?]
Socket is too useful. Select y.
TCP/IP networking (config_inet) [Y/n/?]
Select Y. The reason is shown in the previous one.
The IPX protocol (config_ipx) [N/y/M/?]
In fact, not so many people really need to use or learn IPX, so n is generally used.
Appletalk DDP (config_atalk) [N/y/M/?]
Select N for the same reason.
8) SCSI support, SCSI low-level drives SCSI low-level driver
Select based on the actual situation of the SCSI device in the system.
9) networking device Support Network Device Support
If you use a LAN to access the Internet, select the NIC;
If you use a modem to dial up the Internet, it depends on the service provided by the ISP, which is generally PPP.
10) amateur radio support
I don't know what this is, so I chose n.
11) ISDN subsystem ISDN Subsystem
It seems that there is already a modem that supports ISDN, so it is best to check whether your modem is like this before selecting.
Old CD-ROM dfivers (not SCSI, not IDE) Drive
N is generally selected, because such devices are rare.
13) character devices character device
Virtual terminal (config_vt) [Y/n/?]
In Linux, you can use Alt + F1/F2/F3/F4 to switch between different task terminals. Even on a computer, you can fully use the LINUX multi-task capability, some software that needs to be installed in the command line mode is more convenient if the virtual terminal is supported. Therefore, select y.
Support for console on virtual terminal (config_vt_console) [Y/n/?]
Select y to support a virtual terminal as the console. It is generally Alt + F1.
Support for console on serial port (config_serial) [Y/M/n/?]
Select n unless you really need a serial console.
Extended dumb serial driver options (config_serial_extended) [N/y/?]
If you want to use the non-standard feature of "dumb" (such as hub6), select y, N.
Non-standard serial port support (config_serial_nonstandard) [N/y/?]
Non-standard serial port. N is generally used.
Unix98 Pty support (config_unix98_ptys) [Y/n/?]
Pty indicates a Pseudo Terminal. Generally, n is selected. If you want to use Telnet or xterms as the terminal to access the host and have installed glibc2.1, you can select y.
Maximum number of unix98 ptys in use (0-2048) (config_unix98_pty_count) [256]
The default value is enough.
Mouse support (not serial mice) (config_mouse) [Y/n/?]
Select y for non-serial ports such as PS/2; otherwise, select n.
14) mice mouse
Select your mouse type.
15) video for Linux video
Select a device based on the Audio/Video Capture Devices in the system.
16) joystick support joystick
Select a device based on the game lever in the system
17) ftape, The Floopy tape device driver ftape Device Driver
Ftape (QIC-80/travan) Support (config_ftape) [N/y/M/?]
If there is a tape drive in the system, select y.
18) filesystems File System
The file system should be carefully selected, because some of them provide support for some system functions. In addition to proc, ext2 and other file systems, other file systems (including the following network file systems) can be selected as M mode, thus reducing the volume of the kernel at startup.
Quota support (config_quota) [N/y/?]
It is used to allocate a certain amount of disk space to users. If this function is not used, select n.
Dos fat FS Support (config_fat_fs) [N/y/M/?]
Fat support is provided for the kernel. Most users may access Windows hard disk space in the same system from Linux, so y is the best choice.
ISO 9660 CDROM filesystem support (config_iso9660_fs) [Y/M/n/?]
Select y for a system with a standard optical drive.
Minix FS Support (config_minix_fs) [N/y/M/?]
Most file systems used to create a boot disk should be Y or M.
/Proc filesystem support (config_proc_fs) [Y/n/?]
For a virtual file system, select y.
Second extended FS Support (config_ext2_fs) [Y/M/n/?]
For Linux standard file systems, select y.
19) Network File Systems Network File System
Coda filesystem support (Advanced Network FS) (config_coda_fs) [N/y/M/?]
Check help and then select.
NFS filesystem support (config_nfs_fs) [Y/M/n/?]
Select y or N to access the remote NFS file system.
SMB filesystem support (to mount WFW shares etc.) (config_smb_fs) [N/y/M/?]
Select y to access Shared Resources in windows.
NCP filesystem support (to mout Netware volumes) (config_ncp_fs) [N/y/M/?]
If you really need to access the Netware File System, select y or M.
20) partion types partition type
Generally, it is not used. For more information, see help.
21) console drivers console driver
VGA text Console (config_vga_console) [Y/n/?]
If you use VGA mode to operate Linux in text mode, select y.
Video mode selection support (config_video_select) [N/y/?]
Most systems do not need this feature.
22) Sound
Sound Card support (config_sound) [N/y/M/?]
If the sound card is installed in the system, select y (or m) and view the help.
23) kernel hacking kernel monitoring
Kernel hacking usually generates a very large or very slow (or even large and slow) kernel, and may even cause unstable kernel operation. If you want to select, it is best not to select the "development", "experimental", and "debugging" items.

Related Article

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.