Commit acabd6f
committed
cvd: Handle broken symlinks in default custom action config
When launching older Android trees, the host tools might contain a
broken symlink for cuttlefish_example_action_config.json (pointing to
a non-existent /usr/lib/cuttlefish-common/... path on the host).
Previously, DefaultCustomActionConfig() only checked if the parent
directory existed and returned the first .json file found, without
verifying if the file itself was accessible. This caused
assemble_cvd to abort when trying to read the broken symlink.
This change adds a FileExists() check before returning the detected
config path. If the file is not accessible (e.g., a broken symlink),
it logs a warning and safely ignores it, falling back to an empty
custom action configuration and allowing the launch to proceed.
Test: Local launch of older tree (simulated with broken symlink)
TAG=agy
CONV=9c0d5aa1-08b9-492f-a8dd-54472559c2d31 parent 22ba0c8 commit acabd6f
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
196 | 202 | | |
197 | 203 | | |
198 | 204 | | |
| |||
0 commit comments