Trim ATM closure to recover eMMC headroom #55

Open
opened 2026-06-13 22:03:04 +00:00 by padreug · 0 comments
Owner

Migrated from aiolabs/lamassu-next#55 — opened by @padreug on 2026-05-26.\n\n## Problem

The 25.11-built disk-image-sintra is 7.3GB actual / 11GB sparse. On a 15GB eMMC, that leaves only ~4GB free after flashing. The next cross-release upgrade (eventually 26.05) will hit the same disk-full wall we just hit on 24.05 → 24.11.

GC tightening (commit 1847ab8: weekly → daily 03:30 + persistent) helps for in-release upgrades. It does NOT help cross-release — old gen must stay until new gen activates, and there's just not enough room.

The cleanest fix is to make the closure itself smaller so an extra cross-release upgrade fits in headroom without reflash.

Targets (ordered by size impact)

Item Estimated size Notes
linux-firmware-zstd (monolithic) ~1GB+ Ships hundreds of NICs / GPUs / Bluetooth chips we'll never use. Replace with a minimal subset for Intel iGPU (intel-graphics-firmware) + the specific Sintra WiFi chipset. Check if hardware.enableRedistributableFirmware = true is even necessary on UP Board (Cherry Trail iGPU firmware ships in linux-firmware-intel which is separate).
environment.systemPackages in deploy/nixos/configuration.nix:101-131 ~200-400MB htop, vim, git, curl, wget, usbutils, pciutils, lsof, minicom, screen, v4l-utils, fswebcam. None of these need to be in the closure — install ad-hoc via nix shell nixpkgs#<tool> when debugging. Keep sqlite (used by atm-transactions.sh).
Xorg stack + openbox + pipewire ~600MB Could move to a smaller compositor (cage, sway-kiosk) but Electron + GPU on minimal-X is fiddly. Lower priority — investigate but don't expect a clean win.
Electron + nodejs from unstable ~400MB Hard to trim without losing the kiosk. Could explore native Tauri rebuild but that's a different project.

Realistic ceiling: 1.5-2GB trim with low-risk changes (firmware + systemPackages).

Out of scope

  • External boot (USB / SATA) — separate decision per ATM, not a closure change.
  • Switching off Electron — different project.

Acceptance

  • nix build .#disk-image-sintra produces an image where ls -lh result/nixos.img reports actual size ≤ 6GB.
  • Sintra still boots, kiosk still functions, validator/dispenser still HAL-accessible.
  • No regression in debugging workflow (document the nix shell pattern for tools we drop).

Context

  • Caught during the 24.05 → 25.11 upgrade journey (2026-05-26 session). The 24.05 → 24.11 in-place attempt died on No space left on device; we pivoted to a fresh dd-from-image flash, but the next bump faces the same wall.
  • Related: GC tightening landed in 1847ab8, README dd count bump in 6473c76.
> _Migrated from [aiolabs/lamassu-next#55](https://git.atitlan.io/aiolabs/lamassu-next/issues/55) — opened by @padreug on 2026-05-26._\n\n## Problem The 25.11-built `disk-image-sintra` is **7.3GB actual / 11GB sparse**. On a 15GB eMMC, that leaves only ~4GB free after flashing. The next cross-release upgrade (eventually 26.05) will hit the same disk-full wall we just hit on 24.05 → 24.11. GC tightening (commit 1847ab8: weekly → daily 03:30 + persistent) helps for in-release upgrades. It does NOT help cross-release — old gen must stay until new gen activates, and there's just not enough room. The cleanest fix is to make the closure itself smaller so an extra cross-release upgrade fits in headroom without reflash. ## Targets (ordered by size impact) | Item | Estimated size | Notes | |---|---|---| | `linux-firmware-zstd` (monolithic) | ~1GB+ | Ships hundreds of NICs / GPUs / Bluetooth chips we'll never use. Replace with a minimal subset for Intel iGPU (intel-graphics-firmware) + the specific Sintra WiFi chipset. Check if `hardware.enableRedistributableFirmware = true` is even necessary on UP Board (Cherry Trail iGPU firmware ships in linux-firmware-intel which is separate). | | `environment.systemPackages` in `deploy/nixos/configuration.nix:101-131` | ~200-400MB | htop, vim, git, curl, wget, usbutils, pciutils, lsof, minicom, screen, v4l-utils, fswebcam. None of these need to be in the closure — install ad-hoc via `nix shell nixpkgs#<tool>` when debugging. Keep sqlite (used by atm-transactions.sh). | | Xorg stack + openbox + pipewire | ~600MB | Could move to a smaller compositor (cage, sway-kiosk) but Electron + GPU on minimal-X is fiddly. Lower priority — investigate but don't expect a clean win. | | Electron + nodejs from unstable | ~400MB | Hard to trim without losing the kiosk. Could explore native Tauri rebuild but that's a different project. | **Realistic ceiling: 1.5-2GB trim** with low-risk changes (firmware + systemPackages). ## Out of scope - External boot (USB / SATA) — separate decision per ATM, not a closure change. - Switching off Electron — different project. ## Acceptance - `nix build .#disk-image-sintra` produces an image where `ls -lh result/nixos.img` reports actual size ≤ 6GB. - Sintra still boots, kiosk still functions, validator/dispenser still HAL-accessible. - No regression in debugging workflow (document the `nix shell` pattern for tools we drop). ## Context - Caught during the 24.05 → 25.11 upgrade journey (2026-05-26 session). The 24.05 → 24.11 in-place attempt died on `No space left on device`; we pivoted to a fresh dd-from-image flash, but the next bump faces the same wall. - Related: GC tightening landed in 1847ab8, README dd count bump in 6473c76.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aiolabs/bitspire#55
No description provided.