Commit 77df91c
committed
chksysconfig: merge missing settings instead of overwriting user config
The verify function checks for a missing system.hostname to detect a
corrupt or truncated system.cfg. The intent is to restore defaults so
the system boots correctly. However, the current implementation runs
`rsync -a /usr/config/ /storage/.config` which overwrites the entire
user config tree — WiFi credentials, SSH settings, emulator preferences
and per-game overrides are all replaced with factory defaults.
This creates a cycle: the full rsync restores system.hostname, but
EmulationStation's save logic strips settings that match its internal
defaults (including system.hostname). On the next hard crash, the
hostname is missing again, triggering another full overwrite.
Replace the destructive rsync with a merge that adds keys present in
the reference config but missing from the user config. Existing user
settings are preserved. Retroarch config restoration is separated to
only run when those specific files are actually missing.
Observed on RK3566 (RGB30) during thermal shutdown and on Retroid
Pocket 5 during hard crashes from stress testing.1 parent 18d80a9 commit 77df91c
1 file changed
Lines changed: 25 additions & 4 deletions
Lines changed: 25 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
21 | 36 | | |
22 | 37 | | |
23 | 38 | | |
24 | 39 | | |
25 | 40 | | |
26 | 41 | | |
27 | | - | |
| 42 | + | |
28 | 43 | | |
29 | | - | |
30 | | - | |
31 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
32 | 53 | | |
33 | 54 | | |
34 | 55 | | |
| |||
0 commit comments