Wednesday, July 21, 2010

How to compile kernel


How to compile the kernel:

If you do not want to change the kernel version, directly to the fourth step.

The first step: in any subdirectory (but usually in / usr / src / under) untar the new kernel source code unlock:
tar xvfz linux-xxxx.tar.gz (eg linux-2.0.35.tar.gz)
Or patch (patch):
gzip-cd patch-2.0.35.gz | patch-p0
Once on shore, skip to Step Four patch

The second step: rm / usr / src / linux
This is usually a symbolic link.


The third step: in / usr / src / build a symbolic link next to your new kernel directory.
Ln-s / usr/src/linux.2.x.xx / usr / src / linux
Old versions of the kernel may need to do some work:
cd / usr / include
rm-rf asm linux scsi
ln-s / usr/src/linux/include/asm-i386 asm
ln-s / usr / src / linux / include / linux linux
ln-s / usr / src / linux / include / scsi scsi

Fourth step: the current directory into / usr / src / linux
cd / usr / src / linux

Step Five: become a super user
su

Step Six: Configuring the kernel
If you are under the X window and want to have a graphical interface, you say:
make xconfig
Note: You need to install Tk / Tcl package and the X Server in 800x600 resolution above.
If you do not or do not want to use under the X Window graphical interface, you say:
make config or make menuconfig (recommended)
After answering questions one by one and wait a while, so prompt appears, or the graphical interface disappeared
System on the configured.

Step Seven: Build a new kernel, you said:
make dep; make clean
make zImage (or will further reduce the kernel with make bzImage)
Note that the case must launch on!
Also make zlilo / make install so choose.

Step eight: If you use a module, you also need to build and install modules
make modules
make modules-install
depmod-a

Ninth step: look at your / etc / lilo.conf to see is that the directory with that file as
image. For example: image = / boot / vmlinuz (slackware version is / vmlinuz)
The / usr / src / linux / System.map copied to / boot directory,
Will / usr/src/linux/arch/i386/boot/zImage copied to / boot directory and renamed the vmlinuz
I do not renamed coverage approach, the recommended method is:
With a new file name will copy the new kernel to the appropriate directory, such as
cp / usr/src/linux/arch/i386/boot/zImage / boot/zImage2
Then edit / etc / lilo.conf file, the original core of that section of the copy, such as
image = / boot / vmlinuz
root = / dev/hda1
label = linux
After copying the image into / boot/zImage2 the label into newlinux.
This new kernel with the old kernel can coexist, when the new kernel can not start, there is back up over there.
Note copy and placement, if not set the default is the first who is who is the default boot entry.

10th step: install the new kernel and reboot.
Lilo (Oh, do not forget this step! And attention to look at output)
shutdown-r now

Warning: you should have alternate means of start, or start a new kernel can not you cry no tears! :-)

Compile time in my 120 MHz Pentium 32 MB of main memory on the machine to 20 minutes, in my P2 400 on just a few minutes.

More details see / usr / src / linux / readme, and using "man lilo" "man lilo.conf" "man initrd" command to see such information,
Before you begin to read the information is a good habit!
Tips for beginners: LILO boot after "LILO:" prompt, press the TAB key to display all the startup items (defined by the label).






Recommended links:



Professional VOB IPod 3G2 To AVI



Youtube to MPEG Pro



Geography Education brief



LasVegas MPEG To FLV



mp3 To aac



2008 Zhongguancun Top Ten News: PREMIER Wen inspected Zhongguancun selected



Cisco's Chambers stress and strengthen the country



Fireworks 8 Dream Trip (5): The New Changes In The Menu



CONVERTING mov to wmv



Avi to mp4 converter



Premier Compilers And Interpreters



Introduction Art - Screen Savers



matroska File



Professional CD Sound RA to CD-R Cloner



Kunlun Hotel Liaocheng use Maxima



introduction Icons



No comments:

Post a Comment