Preventing Backup Wipes on Pwnagotchi MemoryFS Write-Back
pwnagotchi
python
wifi
The Risk
Pwnagotchi mounts volatile RAM/zram overlays over SD card paths to reduce flash wear, then periodically syncs back to disk. If a mount was already active or a mount step hit an error, re-initializing zram or syncing an unready overlay risked corrupting or wiping backed-up files.
Hardening pwnagotchi/fs/__init__.py
- Guarded mount setup inside exception handling and passed
setup_zram=not is_mountedso already-mounted overlays are not re-initialized. - Promoted mount/sync failures from
debugtowarninglogs and ensured clean unmount on initial sync errors before starting sync daemon threads.