Creating and applying a TFC patch

To port our changes to another version of the linux kernel the following steps are needed:

  1. prepare a TFC patch file
  2. clean this patch file
  3. try to apply it
  4. correct errors and apply it again

How to prepare a TFC patch file

For simplicity, say we are in the directory


First of all, we need a copy of the vanilla kernel sources from

tar xzf linux-

Second we need a clean copy of the TFC sources, i.e. a copy without the .svn directories. The name of the directory can be anything, but we use linux-

svn up linux-
svn export linux- linux-

Now we create the patch file

diff -Naur linux- linux- >TFC-r198.patch

Cleaning the patch file

It is worth checking the patch file. If there were changes like printk() lines in the SVN, it is better to remove these from the patch.

Suggested method: use mc (midnight commander) ;) It can open the patch file as a "directory" and easily edit the parts.

Try to apply the patch

download the version of the kernel you want to patch with TFC

tar xzf linux-2.6.......tar.gz

Now we will apply the patch ... or at least try to. If there are errors during the patch process, these should be corrected by hand (and if possible, the same changes should be done in SVN as well)

cd linux-2.6......
patch -p1 <../patch-TFC-r198.patch | tee ../patch.out

If you don't know tee, "man tee"

Warning: applying a patch twice can have strange results. If something goes wrong and you correct the errors in the patch file, restart from uncompressing the new kernel!

Last modified 12 years ago Last modified on Apr 18, 2007, 6:02:06 PM