openwrt-uci-defaults
Installation
SKILL.md
OpenWrt uci-defaults and First-Boot Config
First-boot configuration must be deterministic and idempotent: /etc/uci-defaults scripts run at boot S10 and are deleted only when they exit success (boot uci_apply_defaults, boot L7-L20). Anything non-idempotent will re-run forever. All mechanics below are verified against the local OpenWrt source snapshot (see Offline Baseline).
Determine Task Type
| If the user wants to... | Path |
|---|---|
| Change default UCI values on first boot of a flashed image | uci-defaults script → Workflow A |
Ship a complete known-good /etc/config/<pkg> from scratch |
Preseeded final file → Workflow B |
| Diagnose "my uci-defaults runs every boot" | Workflow C |
| Make uHTTPd serve a custom docroot/CGI | Workflow A + uHTTPd Config |
| Write an init.d service script | Hand-off → openwrt-procd-init |
Prerequisites / Preflight
On the target device (or its image manifest):