Linux Kernel compilation and cropping (ARM)

Source: Internet
Author: User

System: ubuntu10.10

1. First, create an arm-Linux-GCC cross-compilation environment:

Download arm-Linux-Gcc-3.4.1.tar.bz2

Copy and decompress

# Cd/
Copy arm-Linux-Gcc-3.4.1.tar.bz2 to the root directory
# Tar jxvf arm-Linux-Gcc-3.4.1.tar.bz2

This will generate a/usr/local/ARM directory.

2. Download The linux-2.6.30.4.tar.bz2 source package to www.kernel.organd decompress the package in the main directory.

Check the top-level makefile, find the arch and cross_compile definitions, and change:

Arch? = Arm

Cross_compile? = Arm-Linux-

Then you need to modify the path:

Add export Path = $ path:/usr/local/ARM/3.4.1/bin/at the end of the. profile file in the main directory/

3. Specify initialization at startup

 

When the kernel is started, perform initial configuration based on the partition settings.

 

Modify ARCH/ARM/machs3c2410/machsmdk2410.c
File

 

Vi arch/ARM/machs3c2410/machsmdk2410.c

 

Modify smdk2410_devices []. Specify that the flash
Partition Information

 

Static struct platform_device * smdk2410_devices [] _ initdata = {

 

& Initi_device_usb,

 

& Amp; cloud_device_ LCD,

 

& Amp; cloud_device_wdt,

 

& Amp; initi_device_i2c,

 

& Amp; cloud_device_iis,

 

/* Add the following statement */

 

& Amp; cloud_device_nand,

 

};

 

Save and exit.

 

 

 

1.4 configure the kernel

 

Support mounting devfs at startup

 

To support devfs for our Kernel
And at startup and in/sbin/init
It can be automatically mounted before running/Dev is devfs
File System,
Modify

 

FS/kconfig
File

 

VI fs/kconfig

 

Find menu "pseudo filesystems"

 

Add the following statement:

 

Config devfs_fs

 

Bool "/dev File System Support (obsolete )"

 

Default y

 

Config devfs_mount

 

Bool "automatically mount at Boot"

 

Default y

 

Depends on devfs_fs

 

 

4,
Configure the kernel to generate the. config file

 

Cp arch/ARM/configs/s3c2410_defconfig. config

 

Make menuconfig

 

Libncurses is missing. Run the following command:

Sudo apt-Get install libncurses5-dev

If the message is missing, run:

Sudo apt-Get install-F

Then:

Sudo apt-Get install libncurses5-dev

Then makemenuconfig

That's all.

Pop-up:

 

 

This is the interface for selecting a module. I did not modify it first, quit directly, and then execute:

Make zimage

Compile the kernel:

 

Compilation completed:

 


We can see that the zimage size is 1.8 m:

 

Then configure again and remove loadable module support

And networksupport, re-compile:

 

However, the size of the zimage generated this time has changed to 2 MB.

 

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.