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

Architecture

Eight libraries and one binary. The dependency rules are checked by a test in crates/bonk/tests.

Dependency rules

  • bonk-core depends on no other crate of the workspace and on no system API.
  • bonk-catalog depends on bonk-core only.
  • bonk-ops depends on bonk-core and bonk-hal, never on bonk-catalog: it has no network.
  • bonk-cli and bonk-gui do not know each other.
  • System-specific code lives in bonk-hal, behind the Platform trait. Two known exceptions: display variables in bonk-gui, accepted by the test, and bonk-android.
  • bonk-gui and bonk-android both build on bonk-ui, which holds screen state and rules without drawing.

Path of a write

  1. With –image, the signed catalog gives the address and the checksum.
  2. An address is downloaded into the cache, after the target and the confirmation are checked.
  3. The write job opens the image once, analyzes it, chooses the route (raw, Windows extraction, hybrid, or a refusal that names the alternative), and checks the checksum.
  4. The target is opened with the right elevation (UDisks2, UAC helper, authopen), unmounted, its identity checked again.
  5. Write in 4 MiB blocks, flush, read back with the cache dropped, GPT repair, read the table again.

Contracts

  • Error codes Exxxx by hundreds: 0 usage, 1 disks, 2 safety, 3 image, 4 write, 5 configuration, 6 service, 7 format. bonk explain gives the text.
  • Exit codes 0 to 6.
  • JSON output versioned; bonk schema prints the schemas.
  • bonk serve speaks JSON lines with a protocol version.

Outside the Bonk repository

bonk-catalog publishes the signed manifest; bonk-packages, homebrew-bonk, BonkWeb and bonk-security serve packages and pages. See repositories.md.