Stefan's blag and stuff

Projects — blockdiff

blockdiff is a binary patch tool for block base file and disk formats (like ext2,3,4 and btrfs). It's similar to bsdiff but not as general, because blockdiff is built on a more stricter assumption about the internal file format. The diff algorithm only considers very long byte sequences, blocks of around ~4 KiB, not single bytes. That's why the runtime and memory usage of blockdiff is minimal compared to bsdiff. Of course at the cost of not being as general applicable as bsdiff. The main usage area of blockdiff should be filesystem based A/B Updates of embedded devices.

For the commandline interface and examples see blockdiff's manpage.

For more information about binary patch tools see bsdiff's homepage, the Wikipedia article Delta Update and Google's Chrome Updater Courgette.

NOTE: The commandline interface and the patch file format of blockdiff is not considered stable yet. Wait for the 1.0.0 release :-)

Features and Limitations


Limitations (Or Keep in mind):

Homepage and Code

The project's website is:

The source code can be found in the git repositories:

$ git clone
$ git clone

Documentation and Install

To generate the manpage and documentation just execute:

$ make

Then to view the manpage execute:

$ man ./blockdiff.1

To install the program in $HOME/bin execute:

$ make install

To install the programm and the manpage system-wide in /usr execute:

$ make prefix=/usr install install-doc

For an overview of all Makefile targets execute

$ make help


The source code of blockdiff is licensed under GPLv2 and GPLv3. For the license text see files LICENSE.GPLv2.txt and LICENSE.GPLv3.txt or visit Licenses.

I chose not to license the program as GPLv3 only, because the normal company lawyer freaks out when they hear the license name GPLv3. So they can calm down and only have to acknowledge the GPLv2 license text.