Article Title: describes how to compile the Linux kernel. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
1. Install the compiling environment first.
Enter the root account:
> Su
Enter Password
Install necessary tools:
> Apt-get install build-essential
(Install gcc, make, etc)
> Apt-get install libncurses-dev
(Library files required for installation of make menuconfig)
> Apt-get install kernel-package, fakeroot
(Some configuration files and tools for generating kernel-image in the Debian system)
> Apt-get install initramfs-tools, module-init-tools
2. Install kernel-source:
It can be installed from the Ubuntu source. The advantage is that it is simple, and the installed kernel is Debian. The disadvantage is that the kernel is not the latest kernel.
> Apt-get install linux-source
You can also download the kernel installation from www.kernel.org. There should be a lot of kernel.org images. Select the fastest one to download, because the file to be downloaded is large. I will introduce how to install the 2.6.24 kernel and install the ck patch.
Download the linux-2.6.24.tar.bz2 and patch-2.6.24.bz2 and store them in the/usr/src directory.
> Tar xvjf linux-2.6.24.tar.bz2
> Ln-s linux-2.6.24 linux
(If the linux directory already exists, delete it first)
> Cd linux
> Bzcat ../patch-2.6.24.bz2 | patch-p1
So far, the kernel source files and patches have been installed.
3. Compile the kernel
Decompress the source package to/usr/src/linux-2.6.24 and create a link named linux to/usr/src/linux-2.6.24 under/usr/src ).
Input in shell
Root @ FE2000 :~ # Cd ..
Root @ FE2000:/# cd/usr/src/linux
Root @ FE2000:/usr/src/linux # make mrproper
Root @ FE2000:/usr/src/linux # make menuconfig
Or make gconfig
At this time, qconf has read the default configuration. You can also do this:
In qconf, choose File-> Load to read other settings files.
For example/boot/config-2.6.18-23-686
Configure the. config file in qconf. Selecting "Y" is to compile it into the kernel, and selecting "M" to compile it into a module for dynamic kernel calling. If "N" is selected, it is not installed. You can also keep the default options ......
Below are just a few simple items:
General setup
Optimize for size (Look out for broken compilers !) Enthusiasts can select Y to get a smaller kernel.
Processor type and features
Symmetric multi-processing support if you do not have a multi-thread processor, you can select N
Processor family depends on your CPU.
For High Memory Support Memory larger than 1 GB, select "4 GB" and less than 1 GB, and do not plan to upgrade to 1 GB in the future. Select "off ".
Bus options (PCI, PCMCIA, EISA, MCA, ISA)
PCI support
PCI Express support vintage machines no PCI-E device available N
ISA support newer machines do not have an ISA Device. You can select N
Generally, N is selected as the MCA support.
NatSemi SCx200 support is generally N
PCI Hotplug Support
Support for PCI Hotplug (EXPERIMENTAL) if there is no PCI Hot swapping device, select N
Device Drivers
Block devices
Packet writing on CD/DVD media
Enable write caching (EXPERIMENTAL) If you have a burner and want to Enable the write cache function, select Y
ATA/ATAPI/MFM/RLL support
[1] [2] Next page