Why prune the kernel?
Because the kernel partition of mtd is only 2M, and the actual kernel is 2.37MB, it needs to be cut to less than 2M (or the mtd partition value is modified)
First cut the irrelevant CPU/board files in the kernel
Through vi .config, and then search for 2440, as shown below:
Then refer to the picture above, make menuconfig
Enter System Type ---> SAMSUNG S3C24XX SoCs Support:
As shown in the picture above, only 2440 is selected under CPU, and only SMDK2440 and MINI2440 related are selected under single board file.
Crop irrelevant file systems ext2, ext3, ext4
Remake menuconfig, enter File systems, and remove:
< > Second extended fs support //ext2
< > Ext3 journalling file system support
< > The Extended 4 (ext4) filesystem
Crop Disc File System CD-ROM
Enter File systems---> CD-ROM/DVD Filesystems and remove:
< > ISO 9660 CDROM file system support
Prune infrequently used miscellaneous file systems
Enter File systems---> Miscellaneous filesystems and remove:
< > Compressed ROM file system support (cramfs) // cramfs compressed file system
[ ] Include support for ZLIB compressed file systems //zlib compressed file systems
< > ROM file system support // Romfs
Clipping by kernel boot information
As shown in the figure below, when the kernel starts, the PS2 mouse driver is initialized.
Since our 2440 board only has a USB interface, we need to cut out the PS2 mouse driver:
Remake menuconfig, enter Device Drivers->Input device support, and remove:
[ ] Provide legacy /dev/psaux device //The mouse device file pointed by the PS2 mouse
[ ] Mice ---> //Other mouse drivers, including PS2 mouse, I2C mouse, touchpad, etc.
[ ] PS/2mouse
Crop by the contents of the .config file
Through vi.config, find the picture below. Since CONFIG_TOUCHSCREEN_USB (USB touchpad) is rarely seen, remove it.
USB-based Watchdog Cards (USB-based watchdog cards)
As shown in the figure below, this watchdog card is rarely used, so CONFIG_SSB_POSSIBLE is removed.
USB-based Watchdog Cards (USB-based watchdog cards) Sonics Silicon Backplane (Silicon backplane under Sonics) As shown in the figure below, this company's products are not used, so CONFIG_BCMA_POSSIBLE is removed
Find the picture shown below. Since CONFIG_SND_USB (USB sound card) is not used, remove it.
Remove CONFIG_USB_LIBUSUAL, not used
Finally, make menuconfig through the cropped content found in the previous section.
Remove CONFIG_TOUCHSCREEN_USB
-> Device Drivers
->Input device support
-> Generic input layer
->Touchscreens
<*> Samsung S3C2410/generic touchscreen input driver //Add its own touch screen driver
< > USB Touchscreen Driver //Remove the USB touchscreen driver
Remove CONFIG_SSB_POSSIBLE and search as shown in the figure below. This macro is set by other options, so it cannot be removed:
Remove CONFIG_BCMA_POSSIBLE. The macro was not found, so it cannot be removed. CONFIG_SND_USB
-> Device Drivers
-> Sound card support
-> Advanced Linux Sound Architecture
[ ] USB sound devices //Remove USB sound card driver
5) Remove CONFIG_USB_LIBUSUAL
-> Device Drivers
-> USB support
[ ] The shared table of common (or usual) storage devices
The size after cropping is as follows
Make a patch for the kernel
Before making a patch, you first need to make distclean to clear all configuration files, including the menuconfig menu. The menuconfig menu is generated by reading the .config file. So we need to save the .config file as follows:
cp .config config_ok //Save to config_ok file
make distclean
cd ../
mv linux-3.4.2 linux-3.4.2_new //Change file name
tar -xjf linux-3.4.2.tar.bz2 //Decompress the source files that need to be compared
diff -urN linux-3.4.2 linux-3.4.2_new > linux-3.4.2_new.patch //Generate patch file linux-3.4.2_new.patch
Previous article:Detailed explanation of the LCD display project of S3c2440
Next article:DATASHEET register packaging trap--S3C2440 as an example
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Weekly review information
- Calculating sound decibels
- Indian engineer sues SpaceX, alleging discrimination at work
- Urgent! The device just came out yesterday, and today my teammates ran away!
- "Notifying employees of slacking off at work", Gome responds
- Uncover the real reason behind the explosive development of TWS headphones
- Layman asks questions about ZigBee
- [Bluesun AB32VG1 RISC-V board "encountered" RTT] Encountered a problem, please solve it
- Analysis of common reasons for howling in switching power supplies
- Pressure sensor temperature compensation