Linux Kernel construction experience-general Linux technology-Linux programming and kernel information. The following is a detailed description. First, clear the following items:
$ Sudo make-kpkg clean
Then
$ Sudo make-kpkg-initrd? Revision = lk_517 kernel_image kernel_headers modules_image
You can change the value of lk_517 to the image name, which must end with a number. Finally, the image package and the header package are generated. You can also use binaryreplacement to combine image.headers.doc. source, which is the most complete package.
Make-kpkg is a script that can automatically replace the "make dep; make clean; make bzImage; make modules" command sequence. What are the two most common parameters? Append-to-version and? Revision.
? The append-to-version option allows us to specify an additional kernel version, which can be a question point of the kernel name. We can use numbers, "+", but do not use underscores. Do you want to avoid setting? Append-to-version is equivalent to "-686", "-K7", "-iSCSI", because these values are often used by the Pre-compiled kernel of Debian.
The kernel module is located in the/lib/modules subdirectory. Each kernel has its own subdirectory. Every time we install a new kernel with a new name, the package installer creates a new subdirectory under the/lib/modules directory to save its own modules. This means that every time we use? When a new value of append-to-version is used to compile a kernel, we can ensure that this kernel has a new name, and its modules will not conflict with other kernel modules.
NOTE: If we use the same name to install a kernel, the installer overwrites the installed kernel and Its modules .? Revision only affects the name of the Debian package, not the kernel name. And? Append-to-version is similar. We can only use numbers, "+", ".", and do not use underscores "_". If we don't do anything? When revision specifies a value, make-kpkg will use "10.00.Custom". Is it different? The value of revision can avoid conflicts between kernels with the same name.
After the kernel is built successfully, you can see three. deb files in the/usr/src directory. This includes linux-image-2.6.20-custom_2.6.20-custom-10.00.Custom_i386.deb (containing real Kernels) and linux-headers-2.6.20-custom_2.6.20-custom-10.00.Custom_i386.deb (containing the files needed to compile additional kernel modules ).
The name format of the kernel-image file is as follows:
Kernel-image-(kernel-version )(? Append-to-version )_(? Revision) _ (architecture). deb
I use this method to install:
Sudo dpkg-I xxx. deb
You can even transfer the two deb packages to other ubuntu systems and install them in the same way. This means that you no longer need to compile them again.
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.