Find the answer to your Linux question:
Results 1 to 7 of 7
Hello, i have just downloaded a new souce from kernel.org and have decided to patch it but there is a problem. here is my source and my patch: source:linux- 2.6.25.8(unpacked) ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2009
    Posts
    14

    problems patching my source


    Hello, i have just downloaded a new souce from kernel.org and have decided to patch it but there is a problem. here is my source and my patch:
    source:linux- 2.6.25.8(unpacked)
    patch : patch-2.6.26.8.bz2

    now when i try to patch it using the command:
    from the linux-2.6.25.8 directory:
    bzcat ../patch-2.6.26.8.bz2 | patch -p1

    i got the following :
    "the next patch would delete the file Documentation/ftrace.txt, which does not exist! Assume -R [n]"
    when i entered "n" it gave this :

    apply anyway? [n]
    when i entered n again i got this:
    Skipping patch.
    1 out of 1 hunk ignored
    patching file Documentation/networking/udplite.txt
    can't find file to patch at input line 1377
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |diff --git a/Documentation/video4linux/CARDLIST.au0828 b/Documentation/video4linux/CARDLIST.au0828
    |index 86d1c8e..e441214 100644
    |--- a/Documentation/video4linux/CARDLIST.au0828
    |+++ b/Documentation/video4linux/CARDLIST.au0828
    --------------------------
    File to patch:


    please, anyone knows how i could solve this problem because i don't know what file to patch it's asking for?

  2. #2
    Linux User Krendoshazin's Avatar
    Join Date
    Feb 2005
    Location
    London, England
    Posts
    471
    The problem here is that kernel patches are designed to patch a specific version. The 2.6.26.8 patch is meant to patch 2.6.26, just as the 2.6.26 patch is meant to patch 2.6.25. I'm not entirely sure how you would patch 2.6.25.8 (I imagine you would reverse the patch with -R and then apply, for example, the 2.6.25.9 patch). Just grab the sourcecode for the version you want and forget the patch.

  3. #3
    Just Joined!
    Join Date
    May 2009
    Posts
    14
    Hello ,

    thanks alot. now i got it patched . my next task is to configure and compile my source. do hope i dont get into any ptifall this time

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User Krendoshazin's Avatar
    Join Date
    Feb 2005
    Location
    London, England
    Posts
    471
    Quote Originally Posted by Krendoshazin View Post
    I'm not entirely sure how you would patch 2.6.25.8 (I imagine you would reverse the patch with -R and then apply, for example, the 2.6.25.9 patch).
    This is just a "for your information". To answer my own question I've just discovered the incr directory of the kernel directory: Index of /pub/linux/kernel/v2.6/incr
    You can easily upgrade from 2.6.25.8 to 2.6.25.9 with an increment patch. However, from, for example, 2.6.25.4 to 2.6.25.9 no such patch exists. So my original assumption holds true: it would be easier to roll 2.6.25.4 back to 2.6.25 with the 2.6.25.4 patch and then apply the 2.6.25.9 patch.

  6. #5
    Just Joined!
    Join Date
    May 2009
    Posts
    14
    Hello,

    i am curious about that. explain more. could u give examples? one major thing i still find amiss is why do i need to apply the patch? suppose i have a 2.6.22 source, what patch would be ok for this source and why do i need such patch? i was only applying an example from a textbook but the question 'why' is still in the dark. i only know 'how'

  7. #6
    Linux User Krendoshazin's Avatar
    Join Date
    Feb 2005
    Location
    London, England
    Posts
    471
    Quote Originally Posted by admindesk View Post
    Hello,

    i am curious about that. explain more. could u give examples? one major thing i still find amiss is why do i need to apply the patch? suppose i have a 2.6.22 source, what patch would be ok for this source and why do i need such patch? i was only applying an example from a textbook but the question 'why' is still in the dark. i only know 'how'
    To understand why you have to first understand what a patch is. When changes are made to a file - bugs fixes, typos, etc - the file has been modified. We can then take this modified file and compare it to the original file with diff, this creates a diff file (a patch) that lists all the changes from the original to the modified version. Applying this diff file with patch forces these changes to be made to the sourcecode. So when we apply a patch we are updating the sourcecode.

    As for an example of what I mean. When you update 2.6.25 to 2.6.25.9 with the 2.6.25.9 patch you create changes to the original files; these changes are all in the patch and thus the patch can be used to reverse those changes - the patch contains the lines to replace as well as what to replace them with. So we patch the source with 'patch -p1 -i patch-2.6.25.9' and we can also reverse those changes with 'patch -R -p1 -i patch-2.6.25.9'.
    Because you can't update from 2.6.25.5 to 2.6.25.9 with a patch you would have to reverse 2.6.25.5 back to 2.6.25 by removing all the changes that happened between 2.6.25 to 2.6.25.5. Once those changes have been removed we can then apply the 2.6.25.9 patch. If we kept the 2.6.25.5 sourcecode then the 2.6.25.9 patch would fail because it doesn't find what it expects to see.

  8. #7
    Just Joined!
    Join Date
    May 2009
    Posts
    14
    thanks is all i can say.

Posting Permissions

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