Steps for Linux kernel Cropping

Source: Internet
Author: User

I recently learned how to buy a 44b0 Development Board by myself.

Speaking of arm, we have to mention Linux. Speaking of Linux, we have to mention that the kernel embedded Linux kernel needs to be modified and tailored to actual needs, that is, to remove unnecessary features. The following describes the kernel tailoring steps. configure in menuconfig: Describes Kernel configuration options in detail and the first part of deleting and modifying the kernel: delete all code maturity level options ---> code maturity level option [] prompt for development and/or incomplete code/drivers is selected by default, this will display the code and driver that are still being developed or not completed on the settings page. no. Part 2: Except for the following options, General setup-> System v ipc (IPC: Inter Process Communication) is a group system call and function library, it allows programs to exchange information synchronously with each other. 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: in addition to the following options, delete all loadable module support ---> support for bootable modules. We recommend that you add the kernel [] Enable loadable module support option as a module to enable your kernel support module, what is a 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 layers -----> Block devices Part 5: delete all processor types 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 in the kernel. Part 6: delete all the other options except the following: Power Management Options (ACPI, APM) ---> power management option [] 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 the BiOS supports this option, we recommend that you use this [] button option to register power button-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 bus options (PCI, PCMCIA, Eisa, MCA, Isa) except the following options ---> bus options [] PCI supppci PCI access mode (any) ---> the configuration of the PCI peripheral device. 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 the PCI device. Part 8: In addition to the following options, all the other options except executable file formats ---> kernel support for elf binaries elf are the most commonly used binary files on open platforms. It supports different hardware platforms. Be sure to select. Part 9: Except for the following options, delete all networkingnetworking options ---> [] Unix domain sockets [] TCP/IP networking Part 10: Except for the following options, delete all other device drivers ---> device drive 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 des.1.tar.gz
This program. Note: This is not related to the network. We recommend that you compile it into the module [] RAM disk suppscsi SCSI device support ---> which contains USB support. You need to select [] SCSI Device Support USB, [] legacy/proc/SCSI/support USB must be selected, [] SCSI disk support USB must be selected, and SCSI low-level drivers [] Serial ATA (SATA) must be selected) support [] intel piix/ich SATA support This must be selected; otherwise, a boot file cannot be generated.[] Via SATA supportnetworking device support ---> select the NIC Driver. You must select Ethernet (1000 Mbit)-& #61664; my computer is a gigabit Nic, so choose [] Broadcom tigon3supportinput device support ---> set your mouse and keyboard in this [] provide legacy/dev/psaux devicegraphics support ---> [] Support for frame buffer devices supports frame buffer, be sure to select USB support ---> [] USB device filesystem, which seems to be required by a USB flash drive [] ehci hcd (USB 2.0) support, compiling to module [] ohci hcd support must be selected. Compiling to module [] uhci HCD (most intel and via) support must be selected, to compile it into a module [] USB Mass Storage support, USB mouse and USB keyboard must be selected in USB Human Interface Device (full hid) support, if you have selected this required hid input layer support, you should select/dev/hiddev raw HID device support. If you have the USB keyboard and mouse options, you must select Part 1: delete all 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 must be selected. The kernel of the standard Linux File System Kernel automounter support is automatically mounted. Of course, the kernel automounter version 4 Support (also supports V3) must be selected) of course, select DOS/fat/NT filesystems ---> Dos fat FS Support Msdos FS Support Vfat (Windows-95) FS Support NTFS file system supportnative Language Support, 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? This is not a zombie. Part 1 is not selected. Part 2: delete all security options ---> Part 2: Delete All cryptographic options ---> This is part 2 of core encryption options: delete all Library Routines ---> Appendix: There are many Kernel configuration methods, such as make config, make xconfig, make menuconfig, and make oldconfig, which have the same functions, the difference can be seen from the 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 specific steps are as follows: first, make sure that shell is Bash. Then, $ make menuconfig has some default symbols, which have the following meanings: Y: Load N: Do not load M: can be configured as a module load 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 family (386,486/cx133, 586/K5/5x86/6x86, Pentium/K6/TSC, ppro/6x86mx) [ppro/6x86mx] [] contains 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. In this case, select the following enhanced real time clock support3) loadable model support. The loading module supports 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 nkernel module loader (config_kmod) [N/y/?] 4) General setup generally sets 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 are confident about 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 support Plug and Play support (config_pnp) [N/y/?] Select y. 6) Block devices block device 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 option 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. The SCSI low-level drives SCSI low-level driver is selected based on the actual situation of the SCSI device in the system. 9) networking device support network devices support Nic if lan is used for Internet access. If modem is used for dial-up Internet access, it depends on the service provided by the ISP, which is generally PPP. 10) amateur radio support. I don't know what it is, so I chose n. 11) the ISDN subsystem seems to already have a modem that supports ISDN, so it is best to check whether your modem is like this before selecting. 12) Old CD-ROM dfivers (not SCSI, not IDE) vintage drive n, because this device is 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) select your mouse type based on your mouse type. 15) video for Linux video is selected based on the audio/video capturing device in the system. 16) joystick support joystick choose 17 based on the player's device in the system) 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 should be carefully selected, because some of them provide support for certain 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 types are generally not used. For more information, see help. 21) the 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 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.