Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Overview

Bonk writes bootable drives (USB keys, SD cards, external disks) from Linux, Windows, macOS, Android and ChromeOS. One binary holds the window and the command line; a command-line-only build serves servers and terminals; an Android application covers phones. The command line is the common base: nothing exists only in the window.

Priorities, in this order: fast, convenient, reliable. 64-bit first.

Principles

  • Disk safety. A system disk is never offered nor written. Every write goes through a single gate that checks the target’s identity again just before writing.
  • Nothing more to install. One binary, no runtime, no WebView. As few third-party libraries as possible.
  • Verified end to end. The image is checked before writing; the drive is read back and compared after.
  • No telemetry. The network is used only for the catalog and the downloads the user asks for. Bonk never hosts an image.
  • Host and target parity. Bonk runs on every system it writes drives for, in every architecture it targets, or the gap is stated.
  • Plain interface, no emoji anywhere, minimal documentation.

Stack

  • Rust, Cargo workspace, edition 2024. The compiler version is pinned in rust-toolchain.toml and raised by Dependabot.
  • Window: Iced, wgpu rendering with a mandatory tiny-skia software fallback, light or dark theme.
  • Command line: clap.
  • Android: Kotlin and Compose over the Rust core.

Workspace

CrateRole
bonkthe only binary: window without a command, command line otherwise
bonk-corepure code over a BlockDevice trait: partition tables, FAT32, exFAT, BIOS boot code, ISO 9660, UDF, WIM, write, read back, GPT repair, image analysis, route choice, vault
bonk-halsafety filter and the Platform trait: enumeration, raw access, unmount, privileges; all system-specific code
bonk-opsthe single write gate and the stable error codes; no network
bonk-catalogresumable downloads, proxy, Tor, signed catalog, vault GRUB assembly
bonk-clicommands, text and JSON output, the bonk serve service, the elevated helper
bonk-uiscreen state and rules, shared by the window and Android
bonk-guithe Iced window; writes through a bonk write subprocess
bonk-androidnative library of the Android application

bonk-core depends on nothing in the workspace and on no system API. bonk-cli and bonk-gui do not know each other. These rules are enforced by a test. Details: reference/architecture.md.

Invariants

These do not change without a decision in decisions.md.

  1. A host system disk is never listed nor writable. The target’s identity is checked again just before the write. Command line: –yes is required, –dry-run exists, the target is named by a stable identifier.
  2. The interface never runs as root or administrator. Only disk operations are elevated: UDisks2 and polkit, a UAC helper, authopen.
  3. No write to a real device during development or tests without the maintainer’s agreement: image files, loop devices, QEMU.
  4. The image is checked before writing and the drive read back after.
  5. No telemetry.
  6. No image is ever hosted or redistributed: official addresses and checksums only.
  7. No emoji: interface, command output, logs, documentation, code, commits.
  8. No secret in a repository.
  9. Everything is available from the command line and logged locally; nothing is sent.
  10. One write gate, in bonk-ops. The command line, the service and the window all go through it.
  11. Stable contracts: error codes Exxxx, exit codes 0 to 6, versioned JSON schemas, service protocol version. An incompatible change needs a decision and a version bump.
  12. Bonk ships for every system it writes drives for; binaries are built and attested at each tag, every week and on demand.

Hosts

HostElevationStatus
LinuxUDisks2, polkitpublished
WindowsUAC helperpublished
macOSauthopenpublished
AndroidUSB without rootpublished, ARM64 and x86_64
ChromeOSCrostini and the Android applicationpublished; window in Crostini not done

Platform detail: reference/platforms.md.