fix: symlink contents inside /opt/data instead of replacing Docker VOLUME

The upstream Maintainerr image declares /opt/data as a Docker VOLUME.
Attempting to rm -rf /opt/data fails with "Resource busy" because mount
points cannot be removed. Instead, we now:
1. Copy seed data from /opt/data to /config (persistent storage)
2. Clear contents inside /opt/data (rm -rf /opt/data/*)
3. Symlink each item in /config back into /opt/data

This ensures the VOLUME directory stays intact while all data is
redirected to persistent storage.

Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/82a46feb-2e9c-4c40-b193-614167e6d5c3

Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-31 18:55:51 +00:00
parent 33654b0aa5
commit 9235b23a93
2 changed files with 16 additions and 4 deletions

View File

@@ -1,4 +1,7 @@
## 3.2.0-3 (2026-03-31)
- Fix addon never starts: symlink contents inside /opt/data instead of replacing the Docker VOLUME directory
## 3.2.0-2 (2026-03-31)
- Fix configuration lost after container restart by symlinking /opt/data to persistent /config directory