lkml.org 
[lkml]   [2000]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: How to write patches
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/

\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.032 / U:0.636 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site