HOWTO: Use xdelta

From Sabayon Wiki
Revision as of 17:37, 12 February 2009 by Zambayoni (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Xdelta provides the ability to generate deltas between a pair of files and later apply those deltas. It operates similar to the diff and patch commands. We use xdeltas during development, and when a release has minimal changes. This way we can distribute smaller files that can be used to patch an older iso to make it current.

To use xdelta you, of course, need to have it installed. If you do not, run this:

# emerge =dev-util/xdelta-1.1.4-r1 


# equo install dev-util/xdelta-1.1.4-r1 

NOTE: We do not want xdelta version 3, so be sure to emerge it like that.

To apply xdeltas do the following:

Split the ISO, using 2gb pieces, which should be 3 parts, with the last part being only a few hundred mb.

$ split -d -b 2000000000 SabayonLinux-x86-3.4a.iso  old.0 

You need to download the xdelta patches:

     xdelta patch sl-x86-3.4a-to-3.4e-0.xdelta
     xdelta patch sl-x86-3.4a-to-3.4e-1.xdelta
     xdelta patch sl-x86-3.4a-to-3.4e-2.xdelta

to the same folder as the SabayonLinux-x86-3.4a.iso

This is how to apply the patches:

$ xdelta patch sl-x86-3.4a-to-3.4e-0.xdelta old.000 new.000
$ xdelta patch sl-x86-3.4a-to-3.4e-1.xdelta old.001 new.001
$ xdelta patch sl-x86-3.4a-to-3.4e-2.xdelta old.002 new.002

To rebuild the new iso, use 'cat' as follows:

$ cat new.00* >  SabayonLinux-x86-3.4e.iso

Thats it! You may also want to download the md5sum to where you built the iso and run:

$ md5sum -c SabayonLinux-x86-3.4e.iso.md5

That will verify the iso was built properly.

After you have verified the iso is good, you should probably clean up the extra files, so that you arent wasting ~8gb of space:

$ rm new.* && rm old.*