Snapshots are built almost every day. Installing them requires downloading
hundreds of megabytes, which can take a tediously long time, even though
the source changes have been minimal.
One solution is to build from source, but there are problems with that, too.
And if somebody's already done the work to build a snapshot, why not just use
it? The problem is one of distribution, not production.
Because the changes in snapshots are fairly small, we can distribute them
as binary patches. Creating the patches
is the hard part, but I've taken care of that. All you need is the client
script which checks for updates and applies them.
What you need:
- bluesnapper.pl
- bsdiff, p5-DBI, p5-DBD-SQLite, p5-libwww packages
- a somewhat recent snapshot installed, with the matching etc.tgz files.
i386 or amd64 only.
First, download all the pieces. Create /var/db/bluesnapper/{etc,xetc}
directories. Extract the etc and xetc sets in them. Yes, this means you
will have etc/etc and xetc/etc directories. Remember to use tar's p flag.
As root, run bluesnapper.pl. It will figure out what snapshot you are at,
download, and install updates. bluesnapper will in turn run sysmerge, so
don't leave it unattended.
How it works:
- I build sqlite databases containing all the binary patches for each snap.
- bluesnapper tracks what snap you are on via two means. Initially, it
guesses based on the md5 of existing files. After that, it just remembers
the last snapshot applied.
- The bluesnapper script downloads and applies diffs automatically.
- Files in the etc and xetc sets are mirrored in /var/db/bluesnapper. After
applying updates, a new set is created and sysmerge is run.
- Before each patch is applied, the md5 of the original is checked.
bluesnapper is smart enough to know about bsd and bsd.mp and will patch the
right file. It will skip over any file that doesn't have a matching md5,
so you can keep any custom kernels or other binaries.
Todo list:
- pkg support. It's getting closer to done, but it's more complicated than
base sets.
- Downloading one off files. If you patch a binary to fix a bug, once it's
out of sync with snapshots it will never be patched again. bluesnapper
should download individual files and fix this, optionally.
Things you should know:
- bluesnapper itself tries to avoid screwing things up, but...
- Snapshots are unstable. Sometimes they break. bluesnapper will happily
download and install a broken snapshot.
- There's no more security here than regular snapshot downloads.
- I'm only providing updates for i386 and amd64.
- sysmerge is interactive, so it may not be the best idea to run bluesnapper
from cron. (It doesn't take long to run, you can sit and watch it.)
Enjoy.
That's all.