From TR-181 routes to UCI: a minimal mapping implementation
A complete, runnable mapping from an AMX data model to UCI: ODL, event callback, libuci writes, and a GitHub demo repository.
7 posts
A complete, runnable mapping from an AMX data model to UCI: ODL, event callback, libuci writes, and a GitHub demo repository.
Using tr181-routing and mod-routing-uci as an example, follow a static route from the AMX data model to UCI and then netifd.
Three levels of UCI integration: the shell uci command, libuci in C, and an AMX UCI backend module. Includes code skeletons and the uloop blocking pitfall.
The AMX amxd_dm is first an in-memory object tree. Only %persistent objects/parameters are saved by amxrt as an ODL file. UCI remains a separate /etc/config persistence layer. This article separates the four layers and who saves what.
UCI itself is small: at runtime it is /sbin/uci → libuci → libubox; at build time it is CMake + C99 + libubox headers/libs (Lua optional). ubus/procd belong to the OpenWrt integration layer, not to UCI. With a dependency table, CMake options, a PC build, and verified ldd/CLI/C-API results.
UCI turns configuration under /etc/config into a three-level package/section/option tree, with the uci command and libuci. This article follows “file → command → commit → scripts → pitfalls → boundaries” to explain what it does — and what it does not.
Subscribe via RSS to get new posts automatically.
Technical questions, feedback and leads: use the guestbook.