Skip to content

v0.1.1

Choose a tag to compare

@jzbz jzbz released this 22 Aug 22:05
· 44 commits to master since this release
v0.1.1
32ac77a

A maintenance release. Same on-disc format, and a set written by 0.1.0 reads
identically here.

What changed

Filenames can no longer drive your terminal. Both readers escaped C0
controls and DEL but passed the C1 controls through in both of their spellings,
so a filename holding U+009B reached an xterm as CSI through index and list.
Both now decode UTF-8 to tell a C1 control from a continuation byte — U+4E9B
ends in 0x9b and must survive intact — and the two are held to byte-identical
output by the cross-implementation suite.

brb.sh no longer needs a few hundred megabytes twice. It read
unsquashfs -ll whole into a variable and then parsed that into an array, so
both existed at once; on a million-file disc that is the difference between a
restore working and not, on exactly the low-RAM rescue machine the bash reader
exists for. It streams now, carrying the pipeline's exit status in-band so the
listing is still disbelieved unless the tool succeeded.

A hostile disc can no longer exhaust memory during ingest. brb.sh read a
disc-supplied SHA512SUMS with no line cap where the Go reader has always
stopped at 2²⁰. A directory posing as a disc has no size limit.

A short write during a restore is an error again. Of three chunked copy
loops, one had lost the io.ErrShortWrite check its siblings carry, so a copy
that stopped early would have written a truncated file and reported success.
All three now share one implementation that keeps it.

One config file drives both readers. KEEP_IMAGES and ASSUME_YES are
keys brb.sh has always read and the Go build refused outright — which meant
the sample configuration in the README would not load. Both are accepted and
honoured now. Note that ASSUME_YES=1 answers every confirmation, including
the one before a restore overwrites its destination.

MANIFEST.txt records paths that could not be read. They were reported once
to a terminal that is long gone by the time anyone reads the discs, and a
restore quietly missing a file looks exactly like a backup that never had it.

doctor stops recommending pv, which nothing in either implementation has
ever run, and reports flock, which brb.sh does run.

The README no longer claims the two readers behave identically. They restore
identically — same files, same bytes, same refusals — but they differ around the
edges, and those differences are a table now, every row of it checked by running
both. The destination-writability caveat on restores is stated as well.

With this release the suite's ledger of known divergences between the two
implementations is empty for the first time.

brb bin-packs a directory tree into disc-sized groups using first-fit
decreasing packing, builds one self-contained SquashFS image per disc, encrypts
it with age, computes par2 recovery data over the
ciphertext, and images each disc as ISO 9660 for BD-R, BD-R DL or BDXL — built
on demand as you burn.

Every disc is independent: losing one loses only the files that lived on it,
and every disc carries the full directory structure of the original tree.
Restoring needs nothing but the Linux kernel and standard tools — repair with
par2, decrypt with age, mount the SquashFS. No brb, no Python, no bespoke
archive format.

Why 0.1.x

The number describes the tool, not the discs. Both readers are held to the same
on-disc format by a cross-implementation suite that builds a set with the Go
build and reads it with both, but the format has not earned a stability promise
yet, and neither has a 1.0. A disc written by this release is permanent
whatever the version says, and carries its own reader.

Artifacts

File What it is
brb-v0.1.1-linux-amd64 static binary, x86-64 — writes and reads
brb-v0.1.1-linux-aarch64 static binary, aarch64 — writes and reads
brb-v0.1.1.sh bash reader: doctor, ingest, restore, mount, list, index, verify-disc. It deliberately cannot write a set
brb-v0.1.1-src.tar.gz complete source, dependencies vendored, rebuilds with no network
SHA512SUMS hashes of the four above

Verify what you downloaded:

sha512sum --ignore-missing -c SHA512SUMS

The binaries are static — no libc, no interpreter, no shared libraries. The
source tarball rebuilds offline:

tar xzf brb-v0.1.1-src.tar.gz && cd brb-0.1.1/go && go build -mod=vendor ./cmd/brb

Requirements

Linux. Writing a set needs mksquashfs and unsquashfs (squashfs-tools 4.5 or
newer — 4.4 lacks -cpiostyle0 and is refused, which rules out Debian 11 and
Ubuntu 20.04), par2 and xorriso. It needs no age binary: encryption uses
filippo.io/age as a library. A restore through brb needs only unsquashfs
and par2; the final step can instead be a kernel mount,
sudo mount -o loop,ro disc07.squashfs /mnt (the images are zstd-compressed,
so kernel 4.14 or newer). Restoring with brb.sh, or by hand, also needs the
age binary. Building from source needs Go 1.25 or newer.

Installation

go install does not work on this repository, and no spelling of it does:
go/go.mod declares the module path as github.com/jzbz/brb while the module
lives in the repository's go/ subdirectory. Take a binary above, or build
from a checkout: cd go && go build -o ~/.local/bin/brb ./cmd/brb.

Generate a keypair before the first backup — brb init-key, or
brb init-key --rescue-key for a second, passphrase-protected identity.
brb backup refuses to start without a recipients file.

Before you rely on this

Test a restore before trusting a set. Every run is a full backup, not an
incremental one, and a completed set cannot be updated in place. A restore
overwrites its destination, mode and mtime included. Lose the age secret key
and the archive is unrecoverable — it is never written to a disc. The set is
not signed; the format has no signing key. See the README's Limitations section
for the rest.

MIT licensed.