troubles patching kernel source

phil-news-nospam_at_ipal.net
Date: 07/29/04


Date: 29 Jul 2004 06:44:32 GMT

I'm trying to make some patches that can apply to the kernel source.
In certain contexts they work fine. In others they don't work at all
(even with the same version of kernel freshly extracted from the same
exact tarball). The errors are that the file to be patched is not
found. But there are some inconsistent behaviours with the patch
program that I need to work out. I've tried various values for -p and
the problems persist and don't seem to vary with changing -p so it
seems not to be a -p issue. Still, I'd like to know exactly what value
is standardly used for -p when applying patches to the kernel, such as
either -p0 or -p1. Knowing that I can avoid making a wrong solution
to the other problem (I don't want to end up solving it in a way that
is inconsistent with usual practices).

The kind of silliness I'm running into with patch is that sometimes it
refuses to patch saying file not found (the file to be patched) even
though the file is there, but sometimes it works when the file is the
first one in the patch file, and other times it works when the file is
the second one. This not leading to any clear direction on how to set
up multiple source trees where original and edited source can be compared
to produce correct patch files. It seems the correct way would be to
have the old file be the first one and the new file be the second one
when running diff to make the patchfile. But today it's not working
that way (yesterday it did). Today it tries to patch the 2nd file but
yesterday it tried to patch the 1st file. I think patch is trying to
be "too smart" and getting it wrong.

How do you organize your source trees in order to make a diff for patch?

-- 
-----------------------------------------------------------------------------
| Phil Howard KA9WGN       | http://linuxhomepage.com/      http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/   http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------


Relevant Pages

  • 9_Recommended error codes (specifically return code 5)
    ... * "return code 2" indicates patches are already installed. ... * "return code 25" means a patches requires another patch that is not yet installed. ... With or without using the save option, the patch installation process ... Installing 114008-01... ...
    (SunManagers)
  • Re: [PATCH] new CSA patchset for 2.6.8
    ... Please don't send patches as attachments, and please don't send more than ... one patch per email. ... judging how useful this feature is to Linux implementors and how well this ... > functional kernel. ...
    (Linux-Kernel)
  • Re: Documentation - how to apply patches for various trees
    ... >> explanation of the various kernel trees and how to apply their patches. ... +a patch to the kernel or, more specifically, what base kernel a patch for ... +and what new version the patch will change the source tree into. ...
    (Linux-Kernel)
  • Re: Documentation - how to apply patches for various trees
    ... >> explanation of the various kernel trees and how to apply their patches. ... +a patch to the kernel or, more specifically, what base kernel a patch for ... +kernel source directories it was generated against. ...
    (Linux-Kernel)
  • [PATCH] add EOWNERDEAD and ENOTRECOVERABLE
    ... that uses them yet, I know of two patches in development, ... There is interest in robust mutexes in Linux, ... Even though there are kernel components to the robust mutex ... I know that it is rare for an unused patch to be accepted; ...
    (Linux-Kernel)