Burin
Flash OS images to SD cards and USB drives. A port of
balenaEtcher from Electron + Node (etcher-sdk,
drivelist) to Tauri v2 with a pure-Rust backend: a ~6 MB app
instead of ~150 MB.
A burin is the engraver’s cutting tool: the thing you etch with.
Download
Grab an installer from Releases:
.deb / .rpm / .AppImage for Linux, .dmg for macOS (Apple silicon and Intel),
.msi / .exe for Windows.
v0.1 is a preview. Linux is the tested platform. The macOS and Windows builds are
produced by CI but have not yet been tried on real drives, and they are unsigned:
on macOS right-click → Open (or xattr -dr com.apple.quarantine Burin.app), on Windows
choose “More info → Run anyway” in SmartScreen. Double-check the target drive — flashing
erases it.
Architecture
┌──────────── GUI (unprivileged) ─────────────┐ ┌──── burin-writer (root/admin) ─────┐
│ React UI ──invoke/events── src-tauri │ pkexec │ re-lists drives, re-validates │
│ (src/) drive watcher │ UAC │ targets, unmounts, writes, verifies│
│ flash session ─┼osascript──► burin-core::writer::flash │
│ ▲ │ │ │
│ └── JSON lines over 127.0.0.1 + one-time token ──┘ │
└─────────────────────────────────────────────┘ └────────────────────────────────────┘
| Crate / dir |
Role |
crates/burin-core |
Drive enumeration (Linux lsblk, macOS diskutil, Windows Get-Disk), image sources from files or http(s) URLs (raw, gz, xz, bz2, zstd, zip; pure-Rust decoders), multi-target writer with xxh3 read-back verification, drive constraints, IPC protocol |
crates/burin-writer |
Privileged CLI. Trusts nothing from the GUI: only drives it enumerates itself, refuses system drives unless --allow-system, refuses the drive holding the image |
src-tauri |
Tauri app: commands, hotplug polling, elevation, IPC session |
src |
React UI modelled on Etcher’s three-step flow |
Writing details: 4 MiB page-aligned chunks; Linux O_DIRECT | O_EXCL (fails if anything still holds the disk),
macOS /dev/rdiskN + F_NOCACHE, Windows \\.\PhysicalDriveN with FILE_FLAG_NO_BUFFERING after
locking/dismounting its volumes. A failing drive is dropped while the others continue.
Verification re-reads each drive bypassing the page cache and compares xxh3-128.
URLs are streamed straight to the drives by the writer (no temporary file). When the server
supports Range requests the download is seekable: the exact size is read from the xz index /
zip directory / gzip trailer, and a dropped connection resumes (up to 5 retries). Without ranges
it falls back to a plain stream. TLS uses the OS (native-tls with the system root store).
Inspect any image or URL without writing:
cargo run -p burin-core --example inspect -- https://downloads.raspberrypi.com/raspios_lite_arm64_latest
Develop
Requirements: Rust (stable), Node 20+, and the Tauri prerequisites.
npm install
npm run tauri dev # builds burin-writer as a sidecar first
cargo test --workspace # end-to-end flashes into files (run `npm run build && npm run sidecar` once first)
npm run tauri build # installers in target/release/bundle
Try the writer without the GUI (loop device as a safe target):
truncate -s 64M /tmp/fake.img && sudo losetup -f --show /tmp/fake.img # → /dev/loopN
sudo target/debug/burin-writer --allow-virtual --image some.img.xz --device /dev/loopN
BURIN_SHOW_VIRTUAL=1 npm run tauri dev # show loop devices in the UI
Status
Done: everything above. Linux is tested on real drives; CI runs the test suite on Linux,
macOS and Windows, but macOS and Windows have not been tried on real drives yet.
Not yet ported from Etcher:
- Cloning a drive (source = another drive); URLs with basic-auth credentials
.dmg (UDIF) images and trimming unused ext partitions (“autoBlockmapping”)
- Raspberry Pi Compute Module usbboot, Etcher Pro specifics
- Auto-update (
tauri-plugin-updater), i18n, analytics
- Windows: volumes without a drive letter are not locked; drive listing uses PowerShell (native SetupAPI would be faster)
- macOS: code signing / notarization;
osascript elevation could become an SMAppService helper
- Linux: a polkit policy file for a nicer prompt in .deb/.rpm packages
License
Apache-2.0, like the original Etcher. See LICENSE and NOTICE.
“balena” and “Etcher” are trademarks of balena.io; Burin is not affiliated with balena.io.
评论