Applying Patch to the kernel

Posted on 2005-05-10
Last Modified: 2009-07-29

          i am using Redhat Enterprise 4 AS. and i am trying to install opensource 'snare' auditing tool..  In order for snare to log, the kernel must be integrated with snare. So for the Redhat Enterprse 4, there is no integrared kernel but a patch is available with the extension .diff ( .diff file). Since i am totally new to apply patch to kernel , i dont know what to do with a diff file. I searched and found that patch can be applied with a .patch file using.... patch -p1 < file.patch command being in the kenrel directory. But i dont know what to do with the .diff file. So can anyone of you tell me how to apply the patch with a diff file
  My source kernel resides in   /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9/   which contains the Makefile etc.... and the diff file is /root/snare-0.9.7-

 So please tell me how can apply patch to the kernel using the .diff file.

Thanks and regards
Question by:mshajan
    LVL 38

    Expert Comment

    RedHat Enterprise Linux has some special twist on the kernel, so you need to make sure the patch you have is
    compatible to RHEL AS 4, not for generic 2.6.x kernel. Otherwise, it won't work.

    Author Comment


       Hi wesly,
                        thanks for ur reply, but if i get the right patch for the redhat kernel ( a .diff file) can u tell me how can i apply that .diff patch file...

    Thanks and regards
    LVL 38

    Accepted Solution

    .diff file is same as .patch file in most of case.
    After you applied the patch, you need to recompile the kernel.
    Check the URL for recompile kernel :
    ("kernel source code" section)

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
    Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now