Re: diff -X exclude_file for patching live kernels?

Andreas Bombe (andreas.bombe@munich.netsurf.de)
Sat, 16 Oct 1999 16:53:23 +0200


On Fri, Oct 15, 1999 at 09:00:42AM +0100, Tigran Aivazian wrote:
> Hi guys,
>
> Does some kind soul have an exclude file for being able to run
>
> diff -urN -X exclude_file linux linux-patched > my.patch 2>&1
>
> i.e. I can put patterns like "*.o" ".config" etc etc but it will take time
> to find them all out.
>
> This would allow making patches from the compiled patched tree without
> having to do "make mrproper" each time.

In addition to what others wrote I have yet another way to get these
results. I have to point out that I use emacs in its default
configuration which renames files to their backup name and creates the
modified file under the original name.

Basically I use three directories for each version of Linux:
linux-2.x.orig, linux-2.x, build-2.x. The orig dir contains the
untouched original Linux tree, linux-2.x is a file by file hardlink to
the orig files (cp -lr linux-2.x.orig linux-2.x). build-2.x is then a
symlinked copy of linux-2.x (cp -sr /use/absolute/path/linux-2.x
build-2.x).

When I edit linux-2.x, the hardlinks are severed because of the backup
rename and therefore don't modify the orig tree (patch also works this
way). build-2.x has to be created after you add new files to linux-2.x,
otherwise they would be missing. The symlinks however won't get
severed like the hardlinks do so they always point to the current
sources. Modify in linux-2.x, configure and make in build-2.x.

The hardlinked trees also have another advantage: if diff finds two
files pointing to the same inode, it knows they are identical and skips
them. If you don't have changes all over the kernel, a diff only takes
a few seconds. Don't forget to do make distclean or something similar
on the linux-2.x tree to remove the backup file, they'll end up in your
patch otherwise.

When updating the orig tree, make a current diff on your work, kill
linux-2.x and build-2.x, update/patch orig, copy hardlink linux-2.x,
apply your patch, copy symlink build-2.x.

-- 
    Andreas E. Bombe <andreas.bombe@munich.netsurf.de>
    http://home.pages.de/~andreas.bombe/
RSA 0x886663c9  30 EC 09 73 84 7B 55 83  C4 7A 91 D9 9D C5 4B B0
DSA 0x04880A44 72E5 7031 4414 2EB6 F6B4  4CBD 1181 7032 0488 0A44

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