fix(migration): survive oversized tarballs — tmpfs cap, pre-reboot RAM gate, auto-restore on pre-format failure#523
Conversation
…orrect SSID encoding
…back rotation and verifies nothing
|
Round-two field failure, second commit: the init script predates the boot-on-ext4 layout. The tarball's top-level |
48112f6 to
a2382e6
Compare
|
Restacked on top of #521 (this PR now includes #521's commits — merge #521 first, then this fast-forwards). Reason, from the live rehearsal: both PRs carried full copies of |
…wner-1000 files (pre-stage runs as the app user)
…oot RAM feasibility check, auto-restore Raspbian on pre-format failure
…de, verify per-partition, never panic
a2382e6 to
997d2e7
Compare
From a live failure on a 2GB Pi: the initramfs copies the migration tarball into RAM, and a 1GB tarball hit the tmpfs default cap (50% of RAM) — then the failure stranded the headless device in a console-only debug shell, with recovery requiring SD card surgery.
nixos_migration.sh: iftarball + 400MB > MemTotal, fail on the running OS with a clear message, before/bootis touched.mkfsrestoresconfig.txt/cmdline.txtfrom the.premigrationbackups, removes the boot flag, and reboots back into the old OS. ADESTRUCTIVEmarker arms at the first format; only failures after that point drop to the debug shell.Companions: the migration closure itself shrinks ~760MB on the fork's
nixosbranch (fulllinux-firmware→ Broadcom blobs), and #522 adds a release-time budget so an oversized tarball can never ship again.🤖 Generated with Claude Code