Re: Minimizing disk usage for kernel development.

From: William Stearns (wstearns@pobox.com)
Date: Fri Feb 25 2000 - 14:09:55 EST


On Fri, 25 Feb 2000, Mike A. Harris wrote:

> I'm wondering what you all do to minimize the amount of disk
> space it takes to be mucking with the kernel?
>
> I've got a pristine 2.2.14 tree installed, as well as 3 copies of
> it all slightly modified. Add to that 2.3.x and I'm almost out
> of disk space.
>
> Any suggestions as to how to minimize the space, considering a
> lot of the files are dupes?
>
> I was thinking of making my pristine tree's "immutable", and
> hardlinking or symlinking the files in another dir, and then only
> copying the changed files.
>
> Would this work? Would I be able to build ok?
>
> Any ideas and suggestions appreciated!

        This came from a Kernel-FAQ, although it doesn't seem to be in the
current FAQ. Anyways:

<quote>
Of course you need to set up two identical source directories to be able
to diff the tree later. A nice trick -- it requires a little bit of
consideration, though -- is to create the 'your-source-tree' from hard
links to the 'original-source-tree':

    $ tar xzvf linux-2.1.anything.tar.gz
    $ mv linux linux-2.1.anything.orig
    $ cp -av --link linux-2.1.anything.orig linux-2.1.anything

This will hardlink every source file from the original tree to a new
location; it is very fast, since it does not need to create more than 20
megabytes of files.

You can now apply patches to the linux-2.1.anything source tree, since
patch does not change the original files but move them to <filename>.orig,
so the contents of the hard-linked file will not be changed.

Assuming that your editor does the same thing, too (moving original files
to backup files before writing out changed ones) you can freely edit
within the hardlinked tree.

Now the changed tree can be diffed at high speed, since most files don't
just have identical contents, they are identical files in both trees.
Naturally removing that tree is quite fast, too.

Thanks to Janos Farkas <chexum@shadow.banki.hu> for that trick.
</quote>

        Cheers,
        - Bill

---------------------------------------------------------------------------
        Q: Is it possible to set up masquerading timeouts that TCP
connection never expires even if there are no any packets traveling?
        A: Sure.
        # ipchains -M -S 13564800 0 0
        That'll last you up until January 1, 2000, and after the rioting
will start and you won't have to worry about masquerading any more. 8-)
        -- Paul Rusty Russell <Paul.Russell@rustcorp.com.au>
--------------------------------------------------------------------------
William Stearns (wstearns@pobox.com). Mason, Buildkernel, named2hosts,
and ipfwadm2ipchains are at: http://www.pobox.com/~wstearns/
--------------------------------------------------------------------------

-
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/



This archive was generated by hypermail 2b29 : Tue Feb 29 2000 - 21:00:13 EST