mirror of
https://github.com/pollen-robotics/microduck.git
synced 2026-12-03 02:47:45 +08:00
adopt_base_edits ran only at robotd startup. An edit made while robotd was stopped (robotctl configure, policy add on a bench board) created the user layer first, so adoption never ran and the old edits stayed in /etc, to be lost at the next OS update. Every writer now adopts under its own hold of the lock before writing. Also: one read_optional helper instead of three copies, padd calls config_stamp directly, and mediad's comments name both layers. Tested on a Radxa Zero 3W (microduck OS, daemon 0.17.9 with robotd, robotctl and updaterd bind-mounted): adoption at start, adoption on a robotctl write with robotd stopped, an edit through robotd, a restored base keeping the user's values, a broken user layer leaving robotd up, the token move with its symlink, and mediad's sandbox reading both files. Assisted-by: Claude:claude-opus-5-5