Commit 187b86a
committed
fix: validate adrenotools driver after extract to prevent cross-game cascade
The Adrenotools driver dir is shared across all containers using the same
driver version (e.g. files/contents/adrenotools/Turnip_Gen8_V25/). When tar
reports success but the extracted .so is silently truncated (storage hiccup,
OOM, partial flush), every container that dlopens the binary inherits the
bad state — manifesting as a black-screen cascade across games until the
user reinstalls one of them, which forces a fresh re-extract.
extractDriverFromResources now verifies the post-extract dir before
returning success:
- meta.json exists and parses
- the libraryName from meta.json points at an existing .so
- that .so is at least 1 MB (real Turnip/Adreno builds are 5-20 MB;
anything smaller is partial)
If any check fails the dir is deleted and false is returned, so the next
launch starts from a clean slate instead of waiting for a manual reinstall.
Costs a few stat() calls plus one small JSON parse — sub-millisecond.
Catches truncated extracts (silent storage glitch). Doesn't catch
fully-extracted-but-internally-corrupt .so files; that would require
SHA-validating against an embedded checksum we don't have.1 parent 73c235d commit 187b86a
1 file changed
Lines changed: 38 additions & 0 deletions
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
143 | 153 | | |
144 | 154 | | |
145 | 155 | | |
146 | 156 | | |
147 | 157 | | |
148 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
149 | 187 | | |
150 | 188 | | |
151 | 189 | | |
| |||
0 commit comments