How to apply a patch correctly?
8,231
When patching Linux kernel to the next minor version, you should use incremental patch. For your case, you should patch with patch-3.13.7-8.xz
. This will patch your kernel source 3.13.7 to 3.13.8.
Related videos on Youtube
Author by
A. Jain
Updated on September 18, 2022Comments
-
A. Jain almost 2 years
I am trying to patch a linux 3.13.7 source tree to 3.13.8 using the
patch-3.13.8.xz
file. Since the patch file is inxz
format, I used the following command to apply it while in the source tree:unxz -cd ../patch-3.13.8.xz | patch -p1
But I receive:
Reversed (or previously applied) patch detected! Assume -R? [n]
I have checked
man patch
for the-R
flag and the description makes no sense to me. Can someone please explain what is going on and what I need to do to fix this?-
Admin about 10 yearsSo instead of using
unxz -cd ../patch-3.13.8.xz | patch -p1
, I can put it in reverse mode withunxz -cd ../patch-3.13.8.xz | patch -p1 -R
? -
Admin about 10 yearsWell, no. You should investigate why the patch you are applying has already been applied. It's usually a sign something is wrong.
-
Admin about 10 yearsI have tries answering yes to all
Reversed (or previously applied) patch detected! Assume -R? [n]
questions and yet most seem to succeed, but some fail. I haven't actually compiled the source before in this particular tree so I guess it would be Ok to download the newlinux
3.13.8 source tree anyway. -
Admin about 10 yearsYes, I should have said "why patch thinks the patch has already been applied". Programs can make mistakes.
-
Admin about 10 years@Shadur Is this flag to be used with the
patch
command? -
Admin about 10 yearsYes. Basically, it tells
patch
to do absolutely everything except actually alter the files, so you can see if the patch goes through cleanly.
-