-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
Tetsuya1126 edited this page Dec 3, 2025
·
8 revisions
# Architecture
This system is built around:
- systemd service + timer
- OverlayFS
- Stage-based state machine
- Cooldown window
- Watchdog fail-safe recovery
The goal is to guarantee:
- Safe upgrade
- SD card protection
- Automatic overlay recovery
---
## Core files
| File | Purpose |
|------|----------|
| overlay-auto-update.sh | Main controller |
| overlay-auto-update.timer | Weekly scheduler |
| overlay-auto-update.service | Controlled execution |
| STATE_FILE | Stage & cooldown bookmark |
## Work flow
βββββββββββββββββββββ
β systemd timer β
βββββββββββ¬ββββββββββγγγ[STAGE2 guard]
|γ γγγγγ- if DONE_AT exists -> cooldown
v
ββββββ΄βββββ
β STAGE 0 β (Overlay ON)
ββββββ¬βββββ
|
disable overlay + reboot (systemd timer -> script rerun)
|
v
ββββββ΄βββββ
β STAGE 1 β (Overlay OFF)
ββββββ¬βββββ
|
apt upgrade
|
set_stage 2
|
reboot (systemd timer -> script rerun)
|
v
ββββββ΄βββββ
β STAGE 2 β
ββββββ¬βββββ
|
+------------------+------------------+
| |
Overlay OFF Overlay ON
restore overlay + reboot cleanup
|
v
Normal mode