Re: How to write patches

From: Matthias Andree (matthias.andree@stud.uni-dortmund.de)
Date: Sat Dec 30 2000 - 12:30:38 EST


On Fri, 29 Dec 2000, Sourav Sen wrote:

>
> Hi,
>
> This question may seem naive, but can anyone tell me if there is any
> structured way of writing patches?

1. get a base tree, e. g. 2.2.18, and unpack it into /usr/src
   (rename your old /usr/src/linux first)
2. rename linux you got in 1. to linux-2.2.18 or whatever is appropriate
3. cp -a -l linux-2.2.18 linux-2.2.18-ss1 (your initials and a number)
   that makes hard links which speeds up diff a lot
   WARNING: IF YOU HAVE AN EDITOR THAT DOES NOT RENAME THE ORIGINAL TO A
   BACKUP FILE NAME, YOU MUST NOT USE -l HERE! (You'd end up editing the
   copy AND the original and your diff would be empty.)
   (break link and copy on write would be a cool feature for the fs...)
4. ln -sfn linux-2.2.18-ss1 linux
5. go edit your ss1 tree with an editor that makes backups by renaming
   before it writes out its files (emacs does in default configuration,
   vi does not!)
6. if your -ss1 kernel is ready for release, save your .config from
   /usr/src/linux somewhere you'll find it (for convenience).
7. cd /usr/src/linux ; make distclean
8. cd /usr/src
9. diff -Nur linux-2.2.18 linux-2.2.18-ss1 | gzip -9c >patch-2.2.18-ss1.gz

With diff, that's OLD NEW (or FROM TO), nothing really difficult since
it's the same way as in mv or cp.

-- 
Matthias Andree
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Dec 31 2000 - 21:00:14 EST