3.6 KiB
Update and Recovery Flow
Shared Paths
/etc/init.d/shared defines the main update and persistence paths:
| Variable | Path |
|---|---|
GAMES_PATH |
/games |
SPIKE_MENU_PATH |
/games/spike3/spike_menu |
OS_UPDATE_PATH |
/connectivity/os_update |
DOWNLOADED_SPK_PATH |
/connectivity/update |
MACHINE_REBOOTS_PATH |
/connectivity/machine_reboots |
CORE_FILE_PATH |
/connectivity/dump/cores |
GAME_RESTARTS_PATH |
/tmp/game_restarts |
DOWNLOADED_SPK_AVAILABLE |
/connectivity/update/UPDATE_REQUESTED |
CONNECTIVITY_CACHE_CLEARED |
/tmp/connectivity_cache_cleared |
Kernel / Boot Partition Update
S95game checks /connectivity/os_update for:
boot.imgboot.img.sha1boot.sigboot.sig.sha1config.txtconfig.txt.sha1
If any are present, all must be present. It validates SHA-1 before copying.
Install behavior:
- Mount
/dev/mmcblk0p1at/boot. - Compare current
/boottarget hash to expected hash. - Copy file if needed.
- Sync and re-check installed hash.
- Unmount
/boot. - Delete staged update files.
- If anything was updated, sync, remount
/dataand/connectivityread-only, call/sbin/reboot -f, and hang.
The expected boot partition files are:
/boot/boot.img/boot/boot.sig/boot/config.txt
Post-install Hook
Before normal startup work, S95game runs /connectivity/os_update/post_install_hook.sh if present, then deletes it and syncs.
Game Software Update
/etc/init.d/update checks two sources for .spk update files:
- Connectivity-downloaded update files under
/connectivity/updatewhen/connectivity/update/UPDATE_REQUESTEDexists. - USB flash drives mounted from
/dev/sda1or/dev/sdaat/media.
Accepted filename patterns:
*.spkcase-insensitive.*.spk.NNN.000case-insensitive extension, with three digits before.000.
When a valid update is found:
- Kill
reboot_monitor,conagent_monitor, andgame_monitor. - Kill
conagentandgame. - Wait until
pidof gameis empty. - Start
/etc/init.d/update_monitor. - On success path, display an update-complete message and hang for power cycle.
Spike Menu Update Monitor
/etc/init.d/update_monitor runs the SPIKE menu update application from tmpfs:
- Deletes
/tmp/spike_menu. - Copies
/games/spike3/spike_menu/game,image.bin, andassetsto/tmp/spike_menu. - Runs
/tmp/spike_menu/game. - Re-runs while
/tmp/spike_menu.restartexists. - Deletes
/tmp/spike_menuon exit.
The tmpfs copy is intentional because an update may overwrite image.bin while it is memory-mapped by the update process.
Connectivity Cache Recovery
clear_connectivity_cache in /etc/init.d/shared deletes:
/connectivity/cache/connectivity/files/connectivity/media_overlay
It then touches /tmp/connectivity_cache_cleared.
The comments identify additional intended /connectivity content:
- ALSA and Bluetooth persistent state.
- IC metadata and media caches.
- QR code storage.
- Net game save state/playback under
/connectivity/files/gkpd_4. - Connectivity software download cache.
- Sentinels such as
UPDATE_REQUESTED,UPDATE_COMPLETED, and.swdl_tod.
Core Dumps
Startup creates /connectivity/dump/cores, prunes stale .7z files, and keeps either:
- No core files if
/connectivityis more than 90% full. - Otherwise, at most 3 newest core files.
Core pattern:
/connectivity/dump/cores/core.%h.%t
The export helper copy_newest_corefile_to_usb.sh encrypts the newest core with 7za and a passphrase file, then copies the encrypted archive to a USB drive.