Previous section S3C2440 transplant linux3.4.2 Kernel support YAFFS file system We modified the kernel support yaffs2 file system , Cut out the kernel .

List of articles


transplant Linux3.4.2 Links to other articles :


S3C2440 transplant linux3.4.2 Introduction and simple modification of kernel framework

S3C2440 transplant linux3.4.2 Modify the partition of the kernel and make the root file system

S3C2440 transplant linux3.4.2 Kernel support YAFFS file system

S3C2440 transplant linux3.4.2 Kernel clipping of the kernel

Why cut the kernel ?

because mtd Of kernel The partition only has 2M Big , And the actual kernel has 2.37MB, So you need to cut it to less than 2M( Or modify mtd Partition value )

First, cut out the extraneous ones in the kernel CPU/ Board file

adopt vi .config, And then the search 2440, As shown in the figure below :
 Insert picture description here
Then refer to the image above ,make menuconfig

Get into System Type —> SAMSUNG S3C24XX SoCs Support:
 Insert picture description here
As shown in the figure above ,CPU Next, just choose 2440, Under the board file, select only SMDK2440 as well as MINI2440 relevant

Cropping irrelevant file systems ext2、ext3、ext4

again make menuconfig, Get into File systems, Get rid of :

< > Second extended fs support               //ext2< > Ext3 journalling file system support 
< > The Extended 4 (ext4) filesystem

Cut out the CD file system CD-ROM

Get into File systems—> CD-ROM/DVD Filesystems, Get rid of :

< > ISO 9660 CDROM file system support

Tailoring infrequently used miscellaneous file systems

Get into File systems—> Miscellaneous filesystems, Get rid of :

< >   Compressed ROM file system support (cramfs)    // cramfs Compressed file system [ ]     Include support for ZLIB compressed file systems //zlib Compressed file system < >   ROM file system support                            // Romfs

Tailoring through kernel boot information

As shown in the figure below , When the kernel starts , See initialization PS2 Mouse drive
 Insert picture description here
because , We 2440 Board only USB Interface , So it needs to be cut out PS2 Mouse drive :

again make menuconfig, Get into Device Drivers-> Input device support, Get rid of :

[ ]     Provide legacy /dev/psaux device    //PS2 The mouse device file that the mouse points to [ ]   Mice  --->                   // Other mouse drivers , Include PS2 mouse 、I2C mouse 、 Touchpad, etc [ ]   PS/2mouse

adopt .config Cut out the contents of the file

adopt vi .config, Find it as shown in the figure below , because CONFIG_TOUCHSCREEN_USB(USB Touch Pad ) It's rare to see , So get rid of
 Insert picture description here
USB-based Watchdog Cards( be based on usb My watchdog card )

As shown in the figure below , This watchdog card is rarely used , So get rid of CONFIG_SSB_POSSIBLE
 Insert picture description here
USB-based Watchdog Cards( be based on usb My watchdog card )
Sonics Silicon Backplane (Sonics The company's Silicon floor )
As shown in the figure below , This company's products don't use , So get rid of CONFIG_BCMA_POSSIBLE
 Insert picture description here
Find it as shown in the figure below , because CONFIG_SND_USB (USB Sound card ) Not used , So get rid of
 Insert picture description here
Get rid of CONFIG_USB_LIBUSUAL, Not used
 Insert picture description here

Finally, find the clipping content in the previous section , Come on make menuconfig

Get rid of CONFIG_TOUCHSCREEN_USB

-> Device Drivers                                                                    
  -> Input device support-> Generic input layer-> Touchscreens<*>   Samsung S3C2410/generic touchscreen input driver   // Plus the built-in touch screen driver < >   USB Touchscreen Driver                                              // Get rid of USB Touch screen drive 

Get rid of CONFIG_SSB_POSSIBLE
The search is shown below , This macro is set by other options , So I can't get rid of :
 Insert picture description here

Get rid of CONFIG_BCMA_POSSIBLE. The macro was not found either , So I can't get rid of
Get rid of CONFIG_SND_USB

-> Device Drivers-> Sound card support  -> Advanced Linux Sound Architecture[ ]   USB sound devices              // Get rid of USB Sound card driver 5) Get rid of CONFIG_USB_LIBUSUAL-> Device Drivers 
-> USB support[ ]   The shared table of common (or usual) storage devices

The cut size is as follows
 Insert picture description here

Patch the kernel

Before making a patch , The first thing you need to make distclean Clear all configuration files , It also includes menuconfig menu . and menuconfig The menu is read through .config File to generate .
So we need to preserve .config file
Steps are 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             // Unzip the source file that needs 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