How balena-io/etcher works
Etcher is an Electron desktop app for safely flashing OS images to SD cards and USB drives. The main user workflow is to choose an image or source, select a destination, flash it, and review the outcome; the README also highlights write verification and Raspberry Pi USB device boot support. The source index confirms the UI entry point and a WebSocket-backed utility API that dispatches scanning, metadata lookup, and writing. Some UI-to-backend wiring and the flash engine’s internal verification path were not shown, so those links are omitted or marked unverified.
Main entry points: MainPage.tsx Main page · app.ts App bootstrap · api.ts Utility API · source-selector.tsx Source selection
Components 20
Desktop experience
- Electron shell
lib/gui/etcher.ts - App bootstrap
lib/gui/app/app.ts
Flash workflow
- Main page
lib/gui/app/pages/main/MainPage.tsx - Source selection
lib/gui/app/components/source-selector/source-selector.tsx - Drive selection
lib/gui/app/components/drive-selector/drive-selector.tsx - Target selection
lib/gui/app/components/target-selector/target-selector.tsx - Workflow state
lib/gui/app/models/store.ts - Flash progress
lib/gui/app/models/flash-state.ts - Flash results
lib/gui/app/components/flash-results/flash-results.tsx - Flash page
lib/gui/app/pages/main/Flash.tsx - Drive safety rules
lib/shared/drive-constraints.ts
Flash services
- Utility API
lib/util/api.ts - Image writer
lib/util/child-writer.ts - Drive scanner
lib/util/scanner.ts - Source metadata
lib/util/source-metadata.ts
Platform support
- User settings
lib/gui/app/models/settings.ts - Analytics
lib/gui/app/modules/analytics.ts
Other components
- User
- Raspberry Pi USB boot
- Write verification
Connections 18
- User → Main page: uses
- App bootstrap → Main page: renders
lib/gui/app/app.ts - Main page → Source selection: renders
lib/gui/app/pages/main/MainPage.tsx - Main page → Target selection: renders
lib/gui/app/pages/main/MainPage.tsx - Source selection → Drive selection: offers source-drive choice
lib/gui/app/components/source-selector/source-selector.tsx - Main page → Flash page: renders
lib/gui/app/pages/main/MainPage.tsx - Source selection → Workflow state: updates selection
lib/gui/app/components/source-selector/source-selector.tsx - Drive selection → Workflow state: updates selection
lib/gui/app/components/drive-selector/drive-selector.tsx - Drive selection → Drive safety rules: checks drive status
lib/gui/app/components/drive-selector/drive-selector.tsx - App bootstrap → Flash progress: observes progress
lib/gui/app/app.ts - Flash page → Flash results: presents outcome
- Utility API → Image writer: dispatches writes
lib/util/api.ts - Utility API → Drive scanner: starts scans
lib/util/api.ts - Utility API → Source metadata: requests metadata
lib/util/api.ts - Main page → User settings: uses settings
lib/gui/app/pages/main/MainPage.tsx - App bootstrap → Analytics: initializes analytics
lib/gui/app/app.ts - Image writer → Write verification: verifies written data
- Image writer → Raspberry Pi USB boot: supports USB device boot