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
| Crate | Role |
|---|---|
| bonk | the only binary: window without a command, command line otherwise |
| bonk-core | pure 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-hal | safety filter and the Platform trait: enumeration, raw access, unmount, privileges; all system-specific code |
| bonk-ops | the single write gate and the stable error codes; no network |
| bonk-catalog | resumable downloads, proxy, Tor, signed catalog, vault GRUB assembly |
| bonk-cli | commands, text and JSON output, the bonk serve service, the elevated helper |
| bonk-ui | screen state and rules, shared by the window and Android |
| bonk-gui | the Iced window; writes through a bonk write subprocess |
| bonk-android | native 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.
- 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.
- The interface never runs as root or administrator. Only disk operations are elevated: UDisks2 and polkit, a UAC helper, authopen.
- No write to a real device during development or tests without the maintainer’s agreement: image files, loop devices, QEMU.
- The image is checked before writing and the drive read back after.
- No telemetry.
- No image is ever hosted or redistributed: official addresses and checksums only.
- No emoji: interface, command output, logs, documentation, code, commits.
- No secret in a repository.
- Everything is available from the command line and logged locally; nothing is sent.
- One write gate, in bonk-ops. The command line, the service and the window all go through it.
- 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.
- Bonk ships for every system it writes drives for; binaries are built and attested at each tag, every week and on demand.
Hosts
| Host | Elevation | Status |
|---|---|---|
| Linux | UDisks2, polkit | published |
| Windows | UAC helper | published |
| macOS | authopen | published |
| Android | USB without root | published, ARM64 and x86_64 |
| ChromeOS | Crostini and the Android application | published; window in Crostini not done |
Platform detail: reference/platforms.md.