How to apply the Kernel patch & How to generate a Kernel patch

Source: Internet
Author: User

How to apply the kernel patch

 

Code View:
Bash> cd/usr/src
Bash> wget www.kernel.org/pub/linux/kernel/people/akpm/patches/X.Y/X.Y.Z/X.Y.Zmm2/
X.Y.Z-mm2.bz2

Apply the patch:
Bash> cd/usr/src/linux-X.Y.Z/
Bash> bzip2-dc ../X.Y.Z-mm2.bz2 | patch-p1

The-dc option asks bzip2 to uncompress the specified files to standard output. This is piped to the patch utility,
Which applies changes to each modified file in the code tree.

 

 

To generate a kernel patch out of your changes, use the diff command:


Code View:
Bash> diff-Nur/path/to/original/kernel/path/to/your/kernel> changes. patch

Note that the original kernel precedes the changed version in the diff-ing order. As per 2.6 kernel
Patch submission conventions, you also need to add a line at the end of the patch that says this:

Signed-off-by: Name <Email>
With this, you cershould that you wrote the code yourself and that you have the right to contribute it.

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.