‘diff ‘ command is the easiest way to create unix kernel patch.Follow below given steps to create patch
1.Before using the ‘diff ‘ command, run
make clean
and
make mrproper
commands in source directories of both experimental and original kernel to remove executable and object files.if you don’t run this command you will end up with a messy patch.
2.Now use ‘diff’ command as follow
diff ['options'] [ 'from-file'] [ 'to-file'] > ['patch-file-destination']
for example
diff -rcNP /usr/src/linux-3.1.4-org /usr/src/linux-3.1.4 > /tmp/patch.diff
a patch file will be generated at /tmp .
enjoy!!