Find the answer to your Linux question:
Results 1 to 4 of 4
Dear All, I want to merge the patch of a kernel with Main kernel version of that patch e.g: I have a kernel 2.6.18 and the patch is 2.6.18-rmk7, then ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2006
    Posts
    74

    How to merge a Kernel Patch with Main source of Kernel?


    Dear All,

    I want to merge the patch of a kernel with Main kernel version of that patch e.g: I have a kernel 2.6.18 and the patch is 2.6.18-rmk7, then how to merge a patch into the main source of kernel? what is the method for this?

    Thanks in Advance,
    Nishant Desai

  2. #2
    Linux Guru antidrugue's Avatar
    Join Date
    Oct 2005
    Location
    Montreal, Canada
    Posts
    3,211
    Quote Originally Posted by Nishant Desai
    I have a kernel 2.6.18 and the patch is 2.6.18-rmk7
    You would do something like that :
    Code:
    cd /usr/src
    tar jxf /path/to/linux-2.6.18.tar.bz2
    mv linux-2.6.18 linux-2.6.18-rmk7
    Then on with the patch. First make sure that the patch will apply cleanly :
    Code:
    cd linux-2.6.18-rmk7
    bzcat /path/to/linux-2.6.18-rmk7.bz2 | patch -p1 --dry-run
    If it outputs fine, then apply the patch :
    Code:
    bzcat /path/to/linux-2.6.18-rmk7.bz2 | patch -p1
    More details here :
    http://wizah.blogspot.com/2005/12/de...l-compile.html
    "To express yourself in freedom, you must die to everything of yesterday. From the 'old', you derive security; from the 'new', you gain the flow."

    -Bruce Lee

  3. #3
    Just Joined!
    Join Date
    Jun 2006
    Posts
    74
    Hiii,

    Thanks for the info dude, but can u please explain me the steps, actually i ve try to find the commands with the info and help, but i was still wondering about the points, like the 'tar jxf /path/to/linux-2.6.18.tar.bz2', what could be the path of linux? should i put the source under the /usr/src or at any of the dir and to extract it? what the bzczt command exactly will do?

    While applying the patch, why to do it twice? what it mean by checking that it applies neatly?

    Thanks,
    Nishant

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru antidrugue's Avatar
    Join Date
    Oct 2005
    Location
    Montreal, Canada
    Posts
    3,211
    Well, say for example that you downloaded the Linux 2.6.18 kernel from kernel.org, then file will by called linux-2.6.18.tar.bz2. And /path/to/ refers to the location of that file.

    Say you downloaded the file in /home/desai/, then
    Code:
    cd /usr/src
    tar jxf /home/desai/linux-2.6.18.tar.bz2
    will uncompress the file in /usr/src/, thus creating a directory called /usr/src/linux-2.6.18/ will all kernel files in it.

    Then you change the name of that directory to match the name of the patch you want to apply :
    Code:
    cd /usr/src/
    mv linux-2.6.18 linux-2.6.18-rmk7
    Then, before apply the patch, you first try it with the option "--dry-run" (aka do nothing, just check if the patch can apply smoothly without errors). Again, say you have the patch patch-2.6.18-rmk7.bz2 in /home/desay/ :
    Code:
    cd /usr/src/linux-2.6.18-rmk7/
    bzcat /home/desay/patch-2.6.18-rmk7.bz2 | patch -p1 --dry-run
    If it says "all OK", then apply the patch for real (so without the "--dry-run" option) :
    Code:
    bzcat /home/desay/patch-2.6.18-rmk7.bz2 | patch -p1
    That's pretty much it, then you can configure & compile & install.
    "To express yourself in freedom, you must die to everything of yesterday. From the 'old', you derive security; from the 'new', you gain the flow."

    -Bruce Lee

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •